Review of the compression branch (ce93c68..d7c1415): one Important and the
cheap real Minors, each with a RED test first.
- app.py: drop the manual Content-Length override - it broke ranged
requests (206 announcing the full length while sending a slice).
send_file sets it and the 206/Content-Range itself.
- app.py: the download route serves video extensions only, never the temp
of an encode in flight.
- src/compress.py: the encode temp is unique per attempt (mkstemp), is
validated (playable video) and fsynced before it replaces the original;
a failing os.replace keeps the original and cleans the temp up instead
of raising into the route. The compressed video keeps the source mode.
- src/compress.py: a stale temp of a killed encode is swept after 2 h
instead of the 5-day video expiry.
- src/job.py: cancelled and failed jobs are not re-encoded; the job shows
"Compressing..." while the encode runs.
- ERD.md: the $OUTPUT_DIR/*_compressed.mp4 row is gone.
328 tests pass (was 319).
CHANGELOG: a finished job leaves one compressed video (compressed in place
under the plain name) and the job videos expire after 5 days.
README: the output lifecycle - one video per job, 5-day retention.
Plan: the implementation plan this branch followed.
CHANGELOG: the same-class dedup dropped overlapping sacks (FCP keeps every
tracked detection) - published counts increase, the 20-minute test clip now
reports the same 161 in / 1 out as FCP.
Plan: Task 14 (dedup across models only) and the full-clip cross-check
result (161 / 1 / 160 on both sides).
The status page showed "Batches: 0" for a clip with an open batch, which
reads like "no batch was counted". The number is the count of FINISHED
batches, so say so.
Plan: record the FCP cross-check that was run on this box (a 60 s excerpt,
model mode C: FCP 6/0/6 vs the recounter 6/0/6 - the same counts) with the
exact commands.
Plan: add Task 12 (a broken zone calibration degrades instead of publishing
a wrong count) and Task 13 (FCP's batch lifecycle — count every frame, the
FSM's arguments, a real truck signal), update the file structure and the
verification steps, and record the two remaining gaps as out of scope (the
dynamic-mode counting line, the truncated flag in the UI).
CHANGELOG: the batch-lifecycle change (published counts and batch_count can
change for every clip), the zone-calibration hardening and the review-wave
fixes.
CHANGELOG: the thresholds, cadence, count-line window, batch lifecycle,
fail-fast config and truncation-flag changes, with their consequences for
the published counts. The Task 0 entry now says the annotated output is
1280x720 (an explicit output_height below 720 still downscales it).
Plan: add the Task 11 section (FCP's calibrated count-line x-window),
correct the Task 1 and Task 7 FCP citations, and refresh the file
structure and the verification snippet.
Task 0 added to the FCP parity plan: the decoded frame is resized to
1280x720 before inference (FCP predict.py:826), imgsz=640 is passed
explicitly on every track()/predict() call (FCP predict.py:467), and the
annotated output is written at exactly 1280x720.
Consequences pinned in the plan: the static zone and the counting polygon
are scaled in FCP's frame (build_static_roi(zone, 1280, 720)), and
min_bbox_area becomes literal FCP px^2 (config_loader.py:67) instead of
a scaled approximation.
Also fixed the Verification snippet: TruckROI has no line_x_start /
line_x_end fields, so it printed an AttributeError; expected output is
now '220 400 936'. Baseline test count refreshed 195 -> 204.
Audit of karung_counter_semarang (FCP) vs feedmill_recounter found the
counting core only partially synced: the unload-after-load gate, the
counting-polygon centroid filter, the calibrated static count line,
sack conf 0.30, box min_bbox_area 1000, stabilizer max_hold 10 and
real batch-FSM crossing events were never ported. Plan lists 10
TDD tasks, each pinned to the FCP file:line it mirrors. FCP itself
is read-only.
Live E2E from .96: POST /api/analyze on 192.168.192.93:9050 -> 202 ->
job COMPLETED. Earlier 'firewall blocks everything' conclusion was
wrong: only ICMP ping is dropped; TCP works fine. Reverse tunnel was
built then reverted (e3a905e/cb483c0) per operator policy — doc now
records direct URL as the sanctioned path, with 401/409/400 handling
guidance and the real API key location.