- _ANALYZE_LOCK: busy-check through enqueue is atomic; overlapping
POSTs can no longer both pass the busy guard (one-GPU contract)
- fcp.mode_models now {letter: {stem: engine_classes}} mirroring FCP
models.modes engines[].classes exactly: B/D use v4-best truck-only
role (not truck-detector), C filters yolo11n to box only — prevents
sack double-count and truck-ROI divergence vs FCP batches
- CHANGELOG: document /api/analyze + stem filter fix
- handoff doc: correct precedence (fcp_mode wins over model_stems),
correct B/D mapping note
- tests: 4 new (mode B/C/D filters, concurrent-submit race) — 195 pass
9.1 KiB
9.1 KiB
Changelog
All notable changes to this project are documented here. Format follows
Keep a Changelog (dated entries; no
version tags are cut in this repo — main is the release line).
[Unreleased]
Added
POST /api/analyzemachine endpoint (540e1b5): multipart video +fcp_modeletter (A–D) or explicitmodel_stems; returns 202{"job_id","status_url"}; 409 busy guard when any job is pending/running (one GPU, atomic check+enqueue under submit lock); optionalX-API-Keyauth iff envRECOUNTER_API_KEYset; all errors JSON. For FCP → recounter clip repush (phase 1 of cross-service recount; FCP sender still TODO, seedocs/ai-handoff-fcp-recount.md).config.yaml → fcp.mode_models: FCP model-mode letter →{stem: engine_classes}, mirroring platformmodels.modes engines[].classesexactly (B/D use v4-best truck-only role, not truck-detector weights).docs/ai-handoff-fcp-recount.md: AI handoff for the FCP-side phase 2.ERD.md(Mermaid ERD) + this changelog (97507f8).
Fixed
- Upload 500 on new video + start analysis:
/uploadreferencedvideo_pathinprobe_video(video_path)before the variable was defined (NameError→ Flask 500). Removed the duplicate premature height-check block; post-saveresize_video_to_max_height()(720p) already covers it (app.py:120-125,b1dd06e). - Single-model class filters silently dropped (
src/job.py): worker looked filters up byModelConfig.filenamewhile UI/API store them bystem—filter_<stem>now honored on single-model jobs (stem-first, filename fallback for legacy callers).
Changed
- Counting/tracking params mirrored from platform (
karung_counter_semarang):stabilizer.max_hold_frames10 → 25 (~1 s occlusion hold),cfg/tracker.yamltrack_buffer60 → 90 (~3.6 s lost-track hold),ByteTrackTrackergainediou=0.7passed tomodel.track().src/stabilizer.py,src/tracking.py,cfg/tracker.yamlnow byte-identical to the platform (37e2d3e). - Auto-resize uploads to 720p, 720p default output — only transcoded when
source is taller than 720p; default output height option set to 720p
(
89a265c).
Added
- Plan doc for fixed-zone mode (
.opencode/plans/fixed-zone-mode.md).
2026-10-14 — Platform parity wave
Added
- Re-attach orphaned output dirs after restart (
d09800c): jobs are in-memory;JobQueue._register_orphans()now re-attachesoutput/job-*older than 300 s as synthetic COMPLETED jobs so they stay deletable from the UI. Younger dirs skipped (may belong to a live process). config.yamlas single source of truth for tunables (7230e2b): detection,min_bbox_area,iou, roi, stabilizer, pipeline blocks; code reads config instead of scattered constants.- Start/stop/restart dashboard scripts (
d89c985):start_dashboard.sh,stop_dashboard.sh,restart_dashboard.sh.
Fixed
min_bbox_areascaled from platform's 1280x720 reference to actual frame size (c2d720e) — hardcoded pixel area mis-scaled at other resolutions.- "Waiting for first frame" placeholder hidden once MJPEG delivers the
first frame (
2efcdb2).
Changed
- Platform detection parity + progress bars (
ce604b0): detection behaviour matched to reference repo; download and processing progress bars on the UI. - Async writer thread + MJPEG mtime guard (
92fd4cb): video encode off the pipeline thread; preview stream only re-sends when file mtime changes.
2026-09-30 — Accuracy defaults
Fixed
- Restored accuracy defaults:
detect_interval=1,sup_det_interval=5(31bfe7c) — earlier throttling to every 2nd/10th frame had cost counts.
2026-09-29 — Fixed ROI + live box counts
Added
- Fixed ROI zone mode as default selection (
f2b5644). - Live box counts + separate sack/box nets on status page (
81e6ae6). - Freeze ROI mode with deadband+sticky jitter fix and explicit
fixed/frozen ROI flags (
4bd9de5). - Stabilize secondary-model detections + box-wins suppression; web UI
moved to port 9050 (
ad41bf0).
Changed
- Tracker throttled to every 2nd frame, supplementary detector interval 10,
720p output option (
07289a4). (Later partially rolled back by31bfe7cfor accuracy.)
2026-09-28 — Counting correctness + downloads
Fixed
- Exclude
truckclass from counting; switch toMultiClassLineCounterwith real class labels (d383759) — trucks were inflating sack counts. - Consistent
Sack In/Sack Outlabels across live panel and result cards (1dbfeca). - Atomic compression writes, enforce 250 MB size limit, job status guard
(
f878110) — no more truncated_compressed.mp4on kill. - Isolate tests from the real
output/dir via conftest autouse fixture (9a276b2).
Added
- Compress downloads to max 250 MB via ffmpeg with mtime-based cache
(
6f86bca). - Propagate sack vs box counts to results and UI (
7932119).
2026-09-22 — Zones, merged pipeline, live preview
Added
- Interactive zone calibration tool (
859d6a0). - Zone config loader + static ROI builder (
4ad4284),zone_mode/fixed_zonefields onJob(7c91081), preset dropdown in the web UI (f0ea95d), visual distinction for fixed zone vs dynamic ROI (2b46231). - Merged detection output + parallel model execution (
fc20a52). - Live preview toggle, FPS indicator, live counting by object
(
09a8829). - Live preview switched from WebSocket to MJPEG streaming (
a5566f3) and 15+ FPS push groundwork (f9e411f).
Fixed
- Use tracker for counting + throttle supplementary detectors
(
5bf44d6) — detections without track IDs never reached the counter. - Absolute
OUTPUT_DIR, resolution scaling for zones, full reference-repo values (35cccd0). - Toggle preview display bug, job deletion, pipeline optimizations
(
1632800). - Show live preview img by default (was
display:nonefrom SocketIO era) (b6379e1).
Changed
- Docs: README updated with current features and API (
39b582a).
2026-09-21 — Job UX + resource management
Added
- Video reuse: re-analyze previous uploads without re-uploading
(
f779f05), delete button for uploaded videos (d353272). - Abort button for job cancellation (
6783ff3). - Video upload
requiredattr removed when an existing video is selected (42c80fd).
Fixed
- Explicit GPU memory cleanup between models to prevent OOM
(
93daa68). - Pass truck centroid to batch manager for state transitions
(
1e28eb4). - Auto-use truck-detector when model lacks
truckclass (57afb62). - Pin
numpy<2.0to resolve Jetson torch incompatibility (a75db4c).
2026-09-18 — Grouped models + TensorRT
Added
ModelGroup+scan_model_groups()for grouped model display (22c7842), grouped selection in JS (d07b3ba), grouped Flask routes (dbd79ed).- TensorRT engine export script (
d32045b).
Fixed
- Graceful error when
onnxruntimeis missing for.onnxmodels (06b013a). - Removed duplicate
v4-best (1).pt(1bc5e06). - Status page: flat progress bar,
created_atformatting (47ffede); dynamicaria-valuenow, focus-visible styles (7b19b5b).
UI wave (2026-09-17 → 09-18)
- Design system foundation, CSS tokens, base template (
fbcff78,c17d480). - Upload page: drag-drop, video preview, model cards (
f245e94); double-toggle bug + hardcoded colors (197c505). - Status page: progress bar, live preview, result cards, polling (
1c54bb1); null safety + connection-lost handling (6323583,1d35c28). - Jobs page: card grid with badges/thumbnails (
b1170f4), semantic cards + flat progress bar (20d5234), accessibility/responsive polish (441a6a8). - Video preview endpoints: thumbnail, sample frames, live frame (
dca6f6b). - Pipeline emits live annotated frames for preview (
f487b5c); clearslatest_frameon failure (87c8da3).
2026-09-16 — Initial working release
Added
- Flask web UI on port 9000 with upload, job status, APIs (
eb77e5b). - CLI entry point:
--video,--model,--filter,--list-models(f38c970). - Async job queue — thread-safe add/get/cancel/list (
e13926d). - Pipeline runner processing video through the counting pipeline
(
5a04cc5); annotated video writer wrapping OpenCV (61c9868). - Model registry scanning
models/with known-class map (f5982a4). - Core pipeline modules copied from
karung_counter_semarang(71c1ae1). - Integration tests for Flask routes (
05bdac5); complete README with usage, CLI, API reference (1377fbb).
Fixed
- Secure upload/download paths, default filter, status enum compare, upload
validation (
40e2dbe). - Final review wave: CLI kwargs, class filter, job locks, upload order
(
2b54cc3). - Relax racy
PENDINGassertion intest_queue_add_job(f14f3b5).
2026-09-15 — Project init
- Project structure and skeleton with
pyproject.toml,config.yaml,cfg/tracker.yaml, README (43a959d,927c84d,7fb0174).