Small-target annotation helper for UAV tank images.
- Read existing Pascal VOC XML files and keep them as hand-labeled seeds.
- Infer the 5-step layout cycle from filenames such as
A001_...png. - Generate draft boxes from:
- seed anchors learned from existing XML files,
- local contrast small-object candidates,
- template matches from existing tank crops.
- Optionally ask a local multimodal model to select/check each candidate crop.
- Write review artifacts:
review.csvwith coordinates, source, score, and VLM decision,draft_contact_sheet.jpgwith boxes overlaid.
For low-labor annotation, use --auto: the VLM checks several candidates around
each expected anchor, keeps the first positive target, and drops confident false
positives. The CSV remains a log, not the main review surface. If you prefer a
conservative no-empty review pass, add --keep-rejected-anchors; rejected anchor
candidates will be kept as red boxes for final human cleanup.
Analyze a folder:
python tank_voc_assistant.py analyze --image-dir "<image-folder>"Smoke-test the first 10 images with the local VLM, without writing XML:
python tank_voc_assistant.py draft --image-dir "<image-folder>" --review-dir ".\review_auto_test" --limit 10 --dry-run --autoGenerate missing XML files next to images, preserving existing XML. This is the recommended low-labor mode:
python tank_voc_assistant.py draft --image-dir "<image-folder>" --review-dir ".\review_auto_full" --autoConservative variant that avoids empty XML files by keeping rejected anchor candidates as red boxes:
python tank_voc_assistant.py draft --image-dir "<image-folder>" --review-dir ".\review_auto_full_keep_rejected" --auto --keep-rejected-anchorsAudit mode only, without automatic VLM candidate selection:
python tank_voc_assistant.py draft --image-dir "<image-folder>" --review-dir ".\review_audit" --vlm-checkRepair only XML files that currently contain no objects. This keeps existing
non-empty XML files untouched, checks candidates with the local VLM, writes
repair.csv after every image, and renders repair_contact_sheet.jpg at the end:
python tank_voc_assistant.py repair --image-dir "<image-folder>" --review-dir ".\repair_empty" --empty-only --max-candidates 8 --vlm-timeout 45If you want every empty XML to receive reviewable fallback boxes even when the
VLM rejects every candidate, add --keep-best-when-empty:
python tank_voc_assistant.py repair --image-dir "<image-folder>" --review-dir ".\repair_empty_fallback" --empty-only --keep-best-when-empty --max-candidates 8 --vlm-timeout 45Run a dry batch first:
python tank_voc_assistant.py repair --image-dir "<image-folder>" --review-dir ".\repair_empty_test" --empty-only --limit 5 --dry-run --max-candidates 8 --vlm-timeout 45