A Tkinter-based desktop application for annotating images with bounding boxes and polygons. Perfect for preparing datasets for computer vision tasks.
- Box & Polygon Annotation: Draw axis-aligned bounding boxes or freeform polygons on images.
- Labeling : Assign labels to each annotation via dropdown; editable and customizable.
- Undo/Redo: Mistakes? Easily undo (Ctrl+Z) or redo (Ctrl+Y) actions.
- Zoom & Pan: Mouse wheel to zoom; middle-click drag to pan the image.
- Multi-image Navigation: Open a folder or single image, then use
< Prev/Next >to cycle through. - Save & Load: Export annotations to JSON or CSV; reload existing annotation files.
- Color-coded Labels: Each label gets a unique color for easy visualization.
- Dark Mode: Toggle between light and dark UI themes via
View → Dark Mode. - Menu & Toolbar: Intuitive menu bar with icons and keyboard shortcuts.
-
Clone the repository:
git clone https://github.com/Aysenur-Erkin/image_annotator_tk.git cd image_annotator_tk -
Create a virtual environment (optional but recommended):
python -m venv .venv source .venv/bin/activate # Linux/Mac .\.venv\Scripts\activate # Windows
-
Install dependencies:
pip install -r requirements.txt
-
Run the app:
python app.py
-
Open images: Click
File → Openor use the 📂 icon / Ctrl+O to select a folder or single file. -
Select annotation mode: Choose Box or Poly from the toolbar or via Tools menu (B/P keys).
-
Draw annotations:
- Box: Click and drag.
- Polygon: Click to place vertices, press Enter to finish, Esc to cancel.
-
Assign labels: Pick from the dropdown or type a new label and press Enter / click outside.
-
Undo/Redo: Use the ⬅️ / ➡️ icons or Ctrl+Z / Ctrl+Y.
-
Zoom & Pan: Scroll wheel to zoom, middle mouse to drag.
-
Save & Load: Use the 💾 Save JSON or 📥 Load JSON buttons (or File menu).
| Shortcut | Action |
|---|---|
| Ctrl + O | Open image/folder |
| Ctrl + S | Save annotations |
| Ctrl + L | Load annotations |
| Ctrl + Z | Undo |
| Ctrl + Y | Redo |
| Ctrl + B | Select Box tool |
| Ctrl + P | Select Polygon tool |
- Add new labels directly in the dropdown.
- Icon & Theme: Swap out PNGs in
resources/or tweak colors inmain_window.py.
This project is released under the MIT License. See LICENSE for details.
