Author: Yael Vicente
Last Updated: April 2025
License: MIT
COCO Annotation Merger is a cross-platform desktop application that provides an intuitive graphical interface for merging COCO-format annotation files used in computer vision tasks such as object detection and instance segmentation.
Built with Tkinter and Python, this tool simplifies annotation management for datasets of varying structures or annotation tasks.
- ✅ Merge multiple COCO JSON files with the same category schema.
- ✅ Merge two files with different categories (e.g., strawberries + flowers).
- ✅ Merge all annotations from two folders and combine them by image.
- ✅ Convert merged annotations to bounding boxes only (masks removed).
- ✅ Automatically remaps IDs for images, annotations, and categories.
- ✅ Prevents category ID conflicts.
- ✅ Displays per-category statistics after merging.
- ✅ Lightweight, clean, and intuitive GUI.
- ✅ One-click .exe (Windows) and .AppImage (Linux) builds.
COCO_Annotation_Merger/
├── app/
│ ├── assets/ # Logo and resources
│ │ ├── logo.ico
| | ├── logo.png
| | └── screenshot.png
│ ├── gui_components/ # Task-based GUI modules
│ │ ├── task_convert_segment_to_bbox.py
│ │ ├── task_merger_dual.py
│ │ ├── task_merger_multi.py
│ │ ├── task_merger_single.py
│ │ └── task_selector.py
│ ├── scripts/ # Core merger logic (OOP)
│ │ ├── coco_annotation_merger.py
│ │ ├── convert_segmentation_to_bbox.py
│ │ ├── strawberry_flower_annotation.py
│ │ └── strawberry_flower_annotations_combiner.py
│ └── main.py # GUI entry point
├── requirements.txt # Python dependencies
├── LICENSE # MIT License
├── .gitignore
├── build_linux.sh # File to automate app creation on Linux
├── build_windows.sh # File to automate app creation on windows
└── README.md # You're here 📘
- Go to the Releases
- Download
COCOAnnotationMerger.exe - Double-click to launch!
- Download the
.AppImagefile from Releases - Make it executable:
chmod +x COCOAnnotationMerger.AppImage ./COCOAnnotationMerger.AppImage
git clone https://github.com/Yael27V/COCO_Annotation_Merger.git
cd COCO_Annotation_Mergerpython3 -m venv env_gui
source env_gui/bin/activate # or use env_gui\Scripts\activate on Windowspip install -r requirements.txtpython app/main.py- Suitable for annotation files that share identical category sets.
- Perfect for combining annotations from multiple annotators or batches.
- Handles merging different task annotations (e.g.,
fruit_ripe,fruit_unripe+flower). - Category IDs are auto-adjusted to prevent overlap.
- Each annotation corresponds to one image.
- Matches images across folders and consolidates their annotations.
- Removes segmentations from all annotations.
- Keeps
bbox,area, andcategory_idintact. - Useful for converting segmentation tasks into detection-only datasets.
After merging or converting, the app shows:
- 🖼️ Total number of images
- 🏷️ Total number of annotations
- 📚 Breakdown of annotations per category (with names and IDs)
- Compute IoU (Intersection over Union) across annotations
- Evaluate Fleiss' Kappa agreement between annotators
- Export summary statistics as JSON/CSV
- Format conversion (Pascal VOC, YOLOv8)
- Drag & Drop support
- Dark mode 🌙
The app uses a custom icon:
assets/logo.ico # Used for GUI window icon (Windows)
assets/logo.png # Used for splash/screenshot/logo
You can replace these with your own logo if desired.
This project is licensed under the MIT License.
You are free to use, modify, and distribute it as needed.
Yael Vicente
- Agricultural Mechatronics Engineering, 8th Semester
- 📧 yaelnaimvicentevaldivieso@gmail.com
- https://www.linkedin.com/in/yael-vicente-437467235/
Pull requests and feedback are welcome!
If this project helps you, please ⭐ star the repo and share it with your colleagues in the annotation or ML community.
Thanks to the open-source community and the creators of the COCO dataset format for building the foundation of modern computer vision annotation standards.
