- Add sack_side_exit_left and sack_side_exit_right polygons to zones.json
- Side detection allows counting sacks exiting through truck sides
- All tests pass
- src/counting.py: ghost table matches new track IDs to recently-vanished
tracks within reid_dist/reid_window; inherits above/below/loaded history
so occlusion-split sacks still count when they reappear below the line
- config.yaml: duplicate_circle_radius 30->20; add reid_dist=400,
reid_window_frames=200 knobs under counting
- src/config_loader.py: parse reid_dist/reid_window_frames
- predict.py: pass reid knobs into MultiClassLineCounter
- tests: 3 new re-ID tests + config expectations
stride 2 ran inference+line-cross every 2nd frame (~6-7Hz); a fast sack
moves 50-100px between inference frames, coarsening y1 timing/dedup.
Expected cost: det+box on every frame, fps ~13 -> ~9-10. Revert the
one line if accuracy does not improve within ~24h.
A: manual/do_manual stops always record (covered/container trucks load
nothing the camera sees) - /api/batch/stop and log_manual_batch_stop
drop the 0/0 discard gate; auto finalize_batch keeps it.
B: office mode switch on active batch -> confirm dialog retries POST
{force:true}; backend force skips the 409 (office gate unchanged).
Predict keeps counts across a mid-batch flip (manual start seeds
set_counts from state file instead of reset; auto start reuses an
existing active_batch_info instead of minting a duplicate number).
85 tests pass (stop-discard tests flipped to keep; force 409/200/403).
P0: after a reboot /dev/shm is empty -> S2 skipped all encodes ->
/api/live-video 503'd before the generator could count the viewer ->
viewers.json stayed 0 forever. Live view ON showed nothing (both ports).
- predict: one unconditional write when the frame file is missing
- dashboard: count viewer before the 503 guard, _unwatch() on 503/finally
P1: split pre-draw into grab/det/truck/box/state in [PERF].
verified: frame files created after restart, office+operator 200,
viewers.json 1/0 during connect -> 0/0 after, 85 tests pass
S3 instrumentation showed draw+enc = 27-33ms of a 79-116ms frame loop
(~30%) even with zero viewers.
- dashboard: viewers.json counter (total/full) written under lock on
connect/disconnect
- predict: PERF log every 100 frames (loop/pre-draw/draw/enc/fps/viewers)
- S2: no viewer -> skip dashboard.draw + overlays + both encodes
- S1: encode 720p only for ?full=1 clients, preview only for preview clients
measured: viewers=0 draw=0ms enc=0ms loop 79->51-88ms;
preview viewer enc=11ms (was 18-25ms for both encodes)
stream (A):
- predict writes _480.jpg (854x480 q60) alongside full frame
- /api/live-video serves preview by default, ?full=1 for 720p, falls
back to full until a preview exists
- monitoring.html: 480p/720p pills (default 480p, localStorage)
report (B1 - stop losing numbers):
- seed MultiClassLineCounter from current_batch.json on startup
(mid-batch restart no longer zeros the count)
- finalize orphan auto batch at startup instead of dropping the row
- finalize_batch: single transaction, timeout=10, 3 retries, loud log
- atomic state-file write (tmp + os.replace)
report (B2 - make History/Excel agree):
- day-detail header computed from the same rows as the table
(was daily_summaries -> header never matched rows)
- camera/object_label scope on all reads + exports
- one-time net backfill migration (1809 legacy rows, user_version=1)
- exports: Boxes/Net/Plate/DO/Model columns + TOTAL row, inclusive range
- DB busy now 503 instead of empty 200; CUTOFF_TIME env split removed
The batch-read try lived inside the live_status except handler, so a
successful FPS read fell through and returned None -> HTTP 500 on both
ports. Counts froze and the stop button never appeared.
display:none only — element IDs, JS handlers and endpoints stay intact,
so re-enabling is dropping three inline styles. Default batch mode is
manual for the POC, so operators shouldn't see DO/OCR controls.
Both the static modal HTML and the confirmStartBatch() manual-branch
override now say 'Pastikan truk terparkir sempurna di posisi pemuatan
sebelum memulai batch.' Guidance only — manual mode still counts on
static geometry with no truck-presence check.
- canonical_plate (uppercase alnum, strips space/dot/hyphen) at all plate
write sites; pretty_plate for render (history, XLSX, operator tile) so
B 1234 XYZ and B1234XYZ are one plate everywhere
- group_dos_by_plate compares canonical plates -> no false mixed_plates
- warn-only (never blocking) plate format hint in operator + monitoring modals
- batch.default_mode: manual (auto merged truck loads when a sack sat in the
counting ROI); operator banner explains plate -> start -> stop
- docs + AGENTS known-limitation note; 85 tests pass
Big docked truck bbox rests 1-2px past detection_polygon bottom edge, so
100%-containment made truck_in_area flicker False -> batch 15 split (6+276)
on 2026-09-29 while the truck never left. v4-best.engine detected it at
conf 0.92-0.97 in every replayed frame (no model miss, no retraining).
- truck gate: frac_inside >= 0.5 instead of contains(bbox)
- batch.truck_gone_tolerance_seconds (new, 30) authoritative; drop the
hardcoded batch_mgr._truck_gone_tolerance = 30.0 override;
batch.timeout_seconds documented as sack-idle pause only
- [TRUCK] truck_in_area transition debug log
Catalog all 25 archived files: reference implementations, calibration
utilities, one-time DB migration/fix scripts, model export/debug tools,
and the rpo_iki experiment variant (+ recovery instructions).