People draw labelled bounding boxes on images, and every task is reviewed before it is exported. This deck walks through the parts, the task lifecycle and where each lives in the code.
→ next chapter↓ detailsEsc overviewV reading view? all keys
Pressing only → gives the short version: the first slide of each chapter stands on its own. The last slide says what the deck was checked against.
An admin uploads a batch of images. Each image becomes exactly one task, which is annotated, reviewed and, once approved, exported as COCO-style JSON.
task the unit of work: one per image, carries the statusannotation one labelled box, in pixels of the original imagereview one approve or reject decision, kept as historyexport one run that writes all approved boxes to a fileThe work happens in two places:
A FastAPI service handles login, uploads, the task lifecycle, boxes and reviews.
An RQ worker makes a thumbnail per image and builds the COCO export file.
↓ the three roles
/admin · AdminUploadPage/api/images, /api/exports/annotate · AnnotatePage/api/tasks/…/review · ReviewQueuePage/api/reviews/queue, /api/tasks/{id}/reviewsEach level zooms into one box of the level before it. The next slides go through them in this order.
→ steps: one level at a time
Context: the tool as one box, with the three roles that use it.
Containers: what docker compose up starts: three own services and three stores.
Components: the modules inside the api, where the rules live.
↓ how to read the diagrams
enqueue or SQLdashed = a reply, or done in the background↓ zoom into the tool
A move that is not in the table becomes HTTP 409; the wrong role becomes 403. The module imports no framework and no database, so it is tested alone.
pending task↓ states, permissions, then three flows in detail
Lifecycle: approved is final. Arrow colour shows which role makes the move.
Four of the six tables; users and exports are left out here.
| Action | admin | annotator | reviewer | Extra check in the route |
|---|---|---|---|---|
POST /api/images upload a batch | ● | — | — | JPEG or PNG only, else 415 |
POST /api/tasks/next claim | — | ● | — | returns your open task first, if you have one |
PUT /api/tasks/{id}/annotations save boxes | — | ● | — | assignee only; task must be in_progress, else 409 |
POST /api/tasks/{id}/submit | — | ● | — | assignee only; at least one box, else 422 |
GET /api/reviews/queue | — | — | ● | submitted tasks, oldest first |
POST /api/tasks/{id}/reviews decide | — | — | ● | a comment is required when rejecting, else 422 |
POST /api/tasks/{id}/reopen | — | ● | — | assignee only |
POST /api/exports · GET /api/exports/{id} | ● | — | — | none |
GET tasks, one task, one image, annotations | ● | ● | ● | any signed-in user |
The oldest pending row is locked while it is claimed, and skip_locked makes a second request take the next row instead of waiting.
→ steps: upload · the signed URL · the direct download
imagesS3_ENDPOINT inside the network, S3_PUBLIC_ENDPOINT for the browser→ steps through each message
→ steps through each message
image-annotation-tool/
├─ README.md ← start here
├─ docker-compose.yml ← the running parts (L2)
├─ .env.example ← every address and secret
├─ db/migrations/001_init.sql ← the schema
├─ api/app/
│ ├─ main.py ← entry point, routers
│ ├─ routes/ ← one file per resource
│ ├─ state_machine.py ← task lifecycle
│ ├─ auth.py ← login, JWT, roles
│ └─ storage.py · queue.py ← MinIO and Redis clients
├─ api/tests/ ← state machine tests
├─ worker/
│ ├─ main.py ← RQ worker, two queues
│ └─ jobs/ ← thumbnail, COCO export
└─ web/src/
├─ pages/ ← one page per role
├─ components/ ← BoundingBoxCanvas
└─ api/client.ts ← every API call
Where to look first
README.md, section "Starting it"api/app/state_machine.py and its testsapi/app/routes/, registered in main.pyworker/jobs/ and an enqueue helper in api/app/queue.pydb/migrations/ and api/app/models.py together↓ commands
The README describes this as a theoretical example that has never been executed, so treat the commands as intended, not as tried.
A longer written version, with a file reference for every statement, is in the project brief.
Chapters run left to right and their details run downward. Some diagrams build up step by step as you press →.