Skip to content

Alexander-68/GoAnnotate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoAnnotate

Visualize, edit and review annotations of YOLO11 detections plus YOLO11 (17-keypoint) and MPII (16-keypoint) pose labels directly against your local image set.

GoAnnotate_screen

Description

GoAnnotate is a single-binary Go + Canvas tool for reviewing and editing YOLO11 detection/pose annotations and MPII pose annotations. The backend serves the embedded frontend and reads/writes label files on disk while the frontend handles high-frequency rendering, zoom/pan, and annotation edits. Pose formats are inferred from keypoint triplet counts in each label line (17 for YOLO11, 16 for MPII). Each loaded dataset has a Task (Auto, Detection, Pose, Pose_mpii). Auto is shown for new or empty datasets until the first labeled image is saved. On that save, bbox-only labels lock the Task to Detection, while any keypoint data locks it to Pose. Once set, the Task stays fixed until you Load a new dataset, and the current Task is displayed in the status panel.

Quick Start

Download executable from Releases. No installation is required. Single file. Try the dataset examples in example_datasets.

Functions

  • Load an images directory and a labels directory, matched by basename (image.jpg -> image.txt).
  • Render bounding boxes, pose skeletons, and keypoint handles with a compact OSD panel that shows file and folder (each capped to the last 36 characters), index/TODO + Task, resolution/zoom, status, per-class counts, selected keypoints (when present), selected object size, and active crop size in pixels.
  • Minimize the status panel to a single-line summary that shows file index, selected object, and keypoint totals.
  • Render zoom-invariant line weights with unfilled keypoint circles and a 1px contrast halo for clearer pose review.
  • Draw zoom-invariant class_id:object_id labels inside the top-left of each bounding box.
  • Edit keypoints and bounding boxes with drag handles and automatic normalized updates.
  • When an object is selected, render only that object's bbox and keypoints.
  • Show keypoint names with visibility (e.g., left ear:1 or right ankle:1) on hover in the main canvas and magnifier.
  • Show a cursor-centered magnifier window on keypoint selection or double-click/tap for precise inspection and editing.
  • Keep the magnifier window anchored on screen once opened so selections inside it do not reposition the view.
  • Move, resize, or minimize the magnifier window using its corner handles.
  • Automatically center the magnifier on the corresponding keypoint when switching objects, based on the closest visible keypoint of the previous selection; if missing, use the nearest lower-index valid keypoint, then higher, or the object's center.
  • Automatically center the magnifier on the corresponding keypoint of the first person (class 0) when switching images; if missing, use the nearest lower-index valid keypoint, then higher, or the object's center.
  • Add new objects and keypoints with automatic keypoint naming and class reuse.
  • Lock the dataset Task to Detection (bbox-only), Pose (17 keypoints), or Pose_mpii (16 keypoints) based on existing labels or the first labeled save; Detection disables keypoints and Pose saves fill missing keypoints with (0,0,0) for consistency.
  • Delete the selected keypoint or object, or open a delete menu to clear all annotations or move the current image and label file into imagesDir/deleted and labelsDir/deleted.
  • Detect YOLO11 (17-keypoint) vs MPII (16-keypoint) pose formats per label line and render the appropriate skeleton.
  • Switch between multiple annotation color schemes for visibility.
  • Save changes to label files on image change with fixed six-decimal precision.
  • Maintain per-label history files in labels-history/<label>.json, storing the original labels (before edits) plus the latest saved labels with a timestamp.
  • Restore initial or latest labels from history when Undo is empty; restore also applies the saved crop box and can restore the original image from imagesDir/deleted on the next save.
  • Define a crop area with Alt + drag, resize it via corner handles, and crop the image on save while remapping annotations to the cropped frame; original image/label files are archived in the deleted subfolders.
  • Auto-fit a crop area to all annotations with up to 10% padding (reduced near borders to keep the crop in-frame) using preset aspect ratios (1:1, 1:2, 2:3, 3:4, 16:9) and automatic orientation.
  • Crop save supports JPEG/PNG images; other formats report a save error.
  • Estimate labels for the current image using up to 8 previous labeled frames with quadratic motion for bounding boxes and keypoints, replacing current labels.
  • Keep the OSD status marked as modified until switching images or undoing all changes.
  • Mark the current image review status as Done after edits are saved.
  • Track review status per image (TODO/Done) in labelsDir/review_status.json; missing or empty means everything is TODO.
  • Allow undo per image (up to 512 actions) and clear undo history when switching images.
  • Preserve the current pan/zoom and magnifier state when switching images.
  • Keep the previous frame visible while loading the next image to avoid blank flashes during navigation.
  • Use a full-screen canvas with overlay OSD, top-right Load/Help buttons, and bottom-left Prev / bottom-right Next buttons for image navigation.
  • Log loaded dataset paths with total and labeled image counts on load.
  • Automatically suggest a Labels Directory when an Images Directory is selected in the UI, prioritized as follows:
    1. YOLO-style: .../labels/{subdir} if images are in .../images/{subdir}.
    2. Sibling: replace images -> labels or image -> label in the folder name (for example, images_mosaics -> labels_mosaics, image-abc -> label-abc).
    3. Subdirectory: imagesDir/labels.
    4. Sibling: ../labels.
    5. Parent: ...
  • Prompt before loading when the selected folders contain no images or no label files.

Annotation Formats

GoAnnotate auto-detects the pose format by counting keypoint triplets in each label line.

  • YOLO11 pose (17 keypoints): standard COCO order and skeleton.
  • MPII pose (16 keypoints): 0 right ankle, 1 right knee, 2 right hip, 3 left hip, 4 left knee, 5 left ankle, 6 pelvis, 7 thorax, 8 upper neck, 9 head top, 10 right wrist, 11 right elbow, 12 right shoulder, 13 left shoulder, 14 left elbow, 15 left wrist.
  • MPII skeleton connects right ankle -> right knee -> right hip -> pelvis -> left hip -> left knee -> left ankle, pelvis -> thorax, thorax -> shoulders -> elbows -> wrists, and thorax -> upper neck -> head top.

Interactions

Keyboard

  • A: Previous image (wraps first -> last; saves current labels before switching).
  • D: Next TODO image (saves current labels before switching). If no TODO images remain, it advances to the next image (wraps).
  • Left / Right Arrow: Previous / next image (wraps first/last; saves current labels before switching).
  • Home / End: Jump to the first / last image.
  • PageUp / PageDown: Jump 100 images backward / forward.
  • Esc or Ctrl + Z: Undo the last annotation edit (per image, up to 512 actions).
  • Esc or Ctrl + Z when nothing to undo: Open the restore menu for initial/latest label history when both are available.
  • Ctrl + D: Mark the current image as Done (auto-advance to next TODO).
  • Ctrl + A: Mark the current image as TODO (auto-advance to next TODO).
  • V: Cycle visibility of the active keypoint (0 -> 1 -> 2) and update its color.
  • B: Cycle annotation color schemes.
  • Z / C or Up / Down Arrow: Select previous / next object.
  • X: Unselect keypoint (if selected) or unselect object (show all).
  • Delete / F: Remove the selected keypoint or object; if nothing is selected, open the delete menu (all annotations or image + label files).
  • + / E / - / Q: Increment/decrement the selected keypoint name (available IDs only), or increment/decrement the selected object class ID when no keypoint is selected.

Mouse

  • Folder picker: Single click enters a folder; double click selects it.
  • Left click: Select keypoint (positions magnifier) or bounding box (selection only).
  • Left drag: Move the selected keypoint (positions magnifier).
  • Left drag on empty space or bbox: Pan the view (positions magnifier).
  • Drag bounding box corners: Resize the bounding box (bbox center cannot be dragged; does not reposition the magnifier).
  • Drag bbox side anchors (shown when the side is long enough): Resize in a single dimension; the opposite side stays fixed.
  • Shift + drag a bbox or crop corner: Resize while maintaining the original aspect ratio.
  • Alt + left drag: Define or replace a crop area (applied on save when switching images).
  • Drag crop corners: Resize the crop area.
  • Ctrl + left drag: Create a new bounding box (uses the last selected class ID or 0).
  • Ctrl + left click (no drag): Add a new keypoint to the selected object on release. It starts from the minimal available ID or from the next available ID above the last selected keypoint (disabled in Detection task).
  • Right drag or Space + drag: Pan the view.
  • Mouse wheel: Zoom (cursor-centered, only when over the image).
  • Hover keypoint (canvas or magnifier): Show the keypoint name and visibility tooltip.
  • Magnifier corners: Drag top-left to move (keeps resizing when it hits the right/bottom edge), drag bottom-right to resize (free aspect), click top-right to minimize and click the '+' to restore. Drag the minimized tile to reposition it.
  • Double click: Center and unminimize the magnifier on the cursor.
  • Click or drag outside the image: No action.

Touch

  • Folder picker: Single tap enters a folder; double tap selects it.
  • Swipe right: Previous image (wraps first -> last; saves current labels before switching, works outside the image too).
  • Swipe left: Next image (wraps last -> first; saves current labels before switching, works outside the image too).
  • Tap a bounding box: Select the object (selection only).
  • Tap a keypoint: Select it and position the magnifier (does not unminimize).
  • Drag a keypoint: Move the selected keypoint (positions magnifier).
  • Drag a bounding box corner: Resize the bounding box without moving the magnifier.
  • One-finger drag: Pan the view (positions magnifier).
  • Pinch: Zoom in or out (centered on the pinch midpoint, only over the image).
  • Pinch inside the magnifier: Zoom the magnifier view.
  • Double tap: Center and unminimize the magnifier on the tap.
  • Drag minimized magnifier: Reposition the minimized tile.
  • Touch outside the image: No action.

UI

  • The app opens with the project popup visible on start.
  • The top-right Load button opens the popup with Images Dir and Labels Dir inputs.
  • The Browse buttons open a dedicated folder picker overlay starting at the path in the field; single click/tap enters a folder and double click/tap selects it. Load warns if no images or labels are found.
  • The Help button below Load opens a popup with usage instructions and shortcuts.
  • The Del button below Help deletes the selection, or opens a delete menu when nothing is selected (image/label deletion archives originals in deleted subfolders).
  • The Undo button below Del undoes the last annotation edit (same as Esc / Ctrl + Z, up to 512 actions per image).
  • When nothing is left to undo, the Undo button opens a restore menu for initial/latest label history when both are available; restores are loaded into the editor and saved on the next save or image switch.
  • The Mark button below Undo opens review controls for the current image or entire folder.
  • The Crop button below Mark opens aspect choices (1:1, 1:2, 2:3, 3:4, 16:9) to auto-fit a crop around all annotations with up to 10% padding (reduced near borders).
  • The Estm button below Crop estimates labels from up to 8 previous images using quadratic motion, replacing current labels.
  • Current Done/TODO saves any unsaved edits before marking and advancing.
  • The bottom-left Prev and bottom-right Next buttons switch images (wrap first/last; disabled when fewer than 2 images).
  • Hovering over buttons shows a tooltip describing the action.
  • Changes are saved automatically as soon as the image is changed. Undo works only within unsaved changes and keeps up to 512 actions per image.
  • Recent folders appear as a dropdown suggestion for each directory field.
  • The GoAnnotate title in the popup links to the project repository.
  • Click the '+' on a minimized magnifier to restore it.
  • The status panel lists File and Folder on the first two lines (each capped to the last 36 characters), then Index/TODO and Task, followed by Resolution/Zoom; the top-right anchor collapses the panel to a single-line summary; click again to restore it.
  • The OSD Modified line shows both edit status and review status (TODO/Done).

Run

Requires Go 1.25+.

go run .

By default, the server listens on 127.0.0.1:8080. You can configure the address and port using the -ip and -port flags:

go run . -ip 0.0.0.0 -port 9090

To restrict all file access (browse/list/read/write/delete/review status) to a specific path, use the -data-root flag:

go run . -data-root C:\my\data\folder

Then open http://127.0.0.1:8080 (or your configured address) in your browser.

Tests

node tests/labels.test.js