100 Commits
Author SHA1 Message Date
jetson 1c26f9f95b feat(zones): use native 1080p zones, sync FCP main, and auto-sync default preset 2026-11-17 12:26:30 +07:00
jetson b9d4bd11b3 feat(counting): align max_step_dy (160) and unload_confirm (1) with FCP main 2026-11-17 11:15:35 +07:00
jetson 3cc0919fb1 feat(pipeline,config): sync detection thresholds, filter order, and multi-model tracking with FCP main 2026-11-17 10:19:54 +07:00
jetson ff55a733d6 feat(counting,zones): align corridor filter and default palet zone with FCP main 2026-11-17 09:39:47 +07:00
jetson f15caf8b7f docs: note Python >=3.10 requirement 2026-11-16 16:43:37 +07:00
jetson 08a0e54065 feat(ui): paste/import zone JSON in the calibrator + surface editor in nav 2026-11-12 16:19:16 +07:00
jetson 0fe59abb4a chore: tidy stale 1920x1080 docstrings and drop dead writer 2026-11-12 15:43:08 +07:00
jetson 6610a466ee fix(docs): scope the live-system claims and fix the RTSP instructions 2026-11-12 15:30:13 +07:00
jetson 0e76c096bb docs: zone calibration workflow, counting gates and the 1280x720 zone space 2026-11-12 14:39:17 +07:00
jetson 5c295c5849 feat(tools): record an RTSP stream for recounter/live parity runs 2026-11-12 14:32:05 +07:00
jetson 3ede31b554 fix(ui): harden the frame API and align the OpenCV calibrator 2026-11-12 14:21:12 +07:00
jetson c34ac85643 feat(ui): interactive zone editor over the analysis frame 2026-11-12 13:52:01 +07:00
jetson 8abc103401 fix(viz): draw the calibrated count band instead of the ROI bounds 2026-11-12 13:17:19 +07:00
jetson 6664cefd18 feat(viz): draw the calibrated counting and truck polygons 2026-11-12 13:06:09 +07:00
jetson 7662890cc5 feat(counting): port FCP's ID-switch, corridor and single-count gates 2026-11-12 11:49:40 +07:00
jetson cd596ca857 fix(zones): close the preset-space and file-handling residuals 2026-11-12 11:20:14 +07:00
jetson a0ea7d9f8e fix(zones): validate the preset space and make zone writes race-free 2026-11-12 11:04:44 +07:00
jetson b00701a936 feat(zones): validate, save and reset zone presets (localhost only) 2026-11-12 10:23:29 +07:00
jetson 7b3c5be2a9 feat(zones): ship FCP's calibrations in the 1280x720 analysis space 2026-11-12 09:40:57 +07:00
jetson 957ab0297d feat(zones): ship FCP's calibration in the 1280x720 analysis space 2026-11-12 09:29:33 +07:00
jetson 9cb32e9ec6 docs: correct AGENTS.md conversion description 2026-11-06 14:42:50 +07:00
jetson 2259cdb275 docs: add AGENTS.md for repository onboarding 2026-11-04 12:20:31 +07:00
jetson ad702faccc fix: export TensorRT engine from .pt source, not ONNX 2026-11-04 11:08:09 +07:00
jetson 7a14672b71 ui: improve contrast for convert button and model class badges 2026-11-04 10:56:13 +07:00
jetson bc537984d6 docs: sync README, ERD, changelog with model upload/conversion feature 2026-11-04 10:39:49 +07:00
jetson 1b032edfd3 feat: upload models and convert to .engine from web UI 2026-11-04 10:25:27 +07:00
jetson d3d58ffcde fix: harden the output lifecycle (range requests, temp files, job gate)
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).
2026-10-28 15:47:28 +07:00
jetson d7c1415975 docs: changelog, README and plan for the one-video-per-job output lifecycle
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.
2026-10-28 15:13:23 +07:00
jetson 5e2a31792f feat: a finished job leaves one compressed video, expired after 5 days
The annotated output was kept uncompressed forever: a 20-minute clip left
a 724 MB file in output/job-*/, and the download route wrote a second
"_compressed.mp4" next to it (both kept).

Now the job compresses its own output when it finishes: the encode goes to
a temp file, is validated, and replaces the source atomically
(os.replace) under the SAME name. One video per job, the client never sees
a "_compressed" file, and the API's output_path stays valid. A failed
encode or a result that still overshoots the cap leaves the original
untouched, so nothing is ever lost.

The job videos are deleted 5 days after the job (scripts/purge_expired_
outputs.py, cron daily 03:17); the job dir, the thumbnail and the sample
frames stay, so the jobs list still renders.
2026-10-28 15:10:05 +07:00
jetson ce93c68dc2 docs: changelog and plan for the cross-model dedup fix
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).
2026-10-28 12:02:48 +07:00
jetson ac2a2350ad fix: dedup across models only - a same-model overlap is a real sack
The merged pipeline ran a same-class IoU-0.5 dedup over ALL detections,
including the primary model's own tracked detections. FCP keeps every
tracked detection - the detector's own NMS already removed the duplicates
inside a model (predict.py:891). Two sacks stacked on the truck overlap by
more than IoU 0.5, so the recounter dropped one of them and lost its
crossing: 54 detections dropped in 400 frames of the test clip, and 3
fewer sacks than FCP on the 20-minute clip (158 vs 161).

The dedup now compares only detections from DIFFERENT models, and the
tracked primary always wins: an extra carries a synthetic track id, and
swapping the id would lose the track's crossing history.
2026-10-28 11:31:03 +07:00
jetson f43044cc9e test: pin the status page's 'Batches closed' label 2026-10-28 10:50:23 +07:00
jetson b2c0ce0011 docs: label the batch count as closed batches and record the FCP cross-check
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.
2026-10-28 10:44:28 +07:00
jetson 82896969d6 docs: changelog and plan for the batch-lifecycle parity wave
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.
2026-10-28 10:04:59 +07:00
jetson 59d8c5521d fix: require the truck to be inside the counting area (FCP predict.py:893-902)
The fixed-mode truck signal accepted any truck in the frame; FCP keeps a
truck only when at least 50% of its bbox overlaps the detection polygon
and uses that as the batch's truck signal (predict.py:964).
2026-10-28 10:02:51 +07:00
jetson 1c313d97d8 fix: match FCP's batch lifecycle (count every frame, predict.py:739-745) 2026-10-28 09:57:26 +07:00
jetson 2ca4cb6c3d fix: degrade a broken zone calibration instead of publishing a wrong count
The whole-branch review found three ways a broken zones.json could reach a
published count:

- build_static_roi indexed the truck_area points directly, so a 1-element
  point (IndexError) or an infinite coordinate (OverflowError) escaped the
  app's guard and became a 500. It now reuses _scaled_points and raises
  ValueError, which the guard already handles.
- A missing or short truck_area fell back to an invented heuristic box that
  was still published as a calibrated "fixed" zone. It now degrades to
  dynamic mode instead.
- A degenerate (zero-area) counting polygon was built successfully and
  filtered out every detection, silently publishing zero counts. It is
  now rejected like any other malformed calibration.

Also: the app guard catches IndexError/KeyError/OverflowError, the zone
preset comment no longer claims 1920x1080 coordinates are authored for
1280x720, and two FCP citations are corrected.
2026-10-28 09:45:25 +07:00
jetson 23ede68f28 docs: changelog for the FCP counting-parity branch and plan corrections
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.
2026-10-28 09:23:19 +07:00
jetson 76b902d318 fix: harden the deferred minors from the parity branch review
- zone_config: a count_line without x_start/x_end/y fell back to the
  frame-space ROI bounds and scaled them a second time (400 -> 266).
- app: _resolve_fcp_mode answers JSON 400 when config.yaml is invalid
  instead of raising through to a Flask 500.
- config: the DEFAULTS fallback (missing/empty config.yaml) is validated
  like a real config, and a test pins DEFAULTS to the shipped config.yaml.
- job: add_job downgrades zone_mode "fixed" to "dynamic" when no calibrated
  ROI was supplied — the label now matches what the job counts against.
- counting: correct the FCP citation (src/counting.py:171).
- tests: the analyze_env stub was missing the new result fields, so every
  /upload job ended in FAILED; cover the truncation fields in both job
  endpoints, /upload/reuse zone mode and the broken-config path.
2026-10-28 09:23:14 +07:00
jetson 8a82b8b866 fix: count inside FCP's calibrated count-line x-window (predict.py:701 parity) 2026-10-28 08:41:08 +07:00
jetson 3d9cce2261 feat: flag truncated clips in the job result 2026-10-27 17:28:02 +07:00
jetson fcafc98b17 feat: fail fast on invalid config (FCP src/validation.py parity) 2026-10-27 17:12:40 +07:00
jetson 4697bda488 fix: correct the FCP batch-reset citation and cover the real on_batch_start contract 2026-10-27 17:05:57 +07:00
jetson 5e4add2238 fix: reset per-track counting state at batch start (FCP predict.py:1020 parity) 2026-10-27 16:40:03 +07:00
jetson f54521c1d8 fix: feed the batch seam the counter's own stream and harden the zone polygon builders 2026-10-27 16:27:28 +07:00
jetson fc94189040 fix: drive batch FSM with real crossing events (FCP predict.py:1064 parity) 2026-10-27 15:50:35 +07:00
jetson acc74dcb62 chore: match FCP truck detection cadence (every 5 frames) 2026-10-27 14:55:52 +07:00
jetson 70acfbb90f chore: align stabilizer max_hold with FCP (10 frames) 2026-10-27 14:54:43 +07:00
jetson 3c354c6d81 chore: align detection thresholds with FCP (sack conf 0.30, box area 1000) 2026-10-27 14:53:23 +07:00
jetson b396b0ded0 docs: move the counting-polygon entry under [Unreleased] 2026-10-27 14:39:42 +07:00
jetson fe26410c19 fix: polygon-filter sacks/boxes only and degrade on a malformed calibration 2026-10-27 14:39:42 +07:00
jetson b1c73bb55b docs: changelog for the counting-polygon filter (d74ca41) 2026-10-27 14:19:49 +07:00
jetson d74ca41e2e feat: filter counts calibrated counting polygon (FCP predict.py:939 parity) 2026-10-27 14:19:26 +07:00
jetson f8f3049531 fix: degrade to dynamic on an unreadable zone calibration 2026-10-27 14:01:24 +07:00
jetson d53e9426fb docs: changelog for the static-zone default (f4e7b5d) 2026-10-27 13:52:31 +07:00
jetson f4e7b5da49 feat: count against calibrated static zone by default (FCP parity) 2026-10-27 13:51:08 +07:00
jetson 354b1b3148 fix: gate unloading on prior loading (FCP src/counting.py:168 parity) 2026-10-27 13:41:34 +07:00
jetson af58bd4f49 fix: correct stale pipeline docstrings and log the decoded source size 2026-10-27 13:30:57 +07:00
jetson ac064cda0f docs: changelog for the 1280x720 frame and 640x640 model input (fcdfed1) 2026-10-27 13:30:51 +07:00
jetson fcdfed1e51 feat: analyse and write at 1280x720 with pinned 640x640 model input (FCP parity) 2026-10-27 12:54:43 +07:00
jetson 167e20f26c docs: plan — pin analysis frame to 1280x720 and model input to 640x640 (FCP parity)
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.
2026-10-27 12:33:21 +07:00
jetson e27b373ac7 docs: changelog for source-name output filenames (e963ba0) 2026-10-27 11:26:16 +07:00
jetson e963ba0cb4 feat: append source clip name to annotated output filename
Output was a fixed name (merged_annotated.mp4) so every download looked
the same. The source clip name is now appended at the back:
merged_annotated_rekap_2026-10-27.mp4

- src/naming.py: annotated_output_name() + source_stem(); client upload
  name wins, stored file name is the fallback (reuse endpoint), unsafe
  chars replaced, stem capped at 80 chars
- src/job.py: Job.source_stem + add_job(source_stem=...); both output
  paths go through the helper
- app.py: capture the sanitized client filename before the collision
  suffix is added
- cli.py: same helper for the CLI output name

Verified live on .93: POST /api/analyze with 'rekap 2026-10-27.mp4' ->
output/job-e0409b05/merged_annotated_rekap_2026-10-27.mp4, download 200.
2026-10-27 11:26:07 +07:00
jetson dbaa87c4e8 docs: plan FCP counting-logic parity for feedmill_recounter
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.
2026-10-26 12:07:52 +07:00
jetson 20f8b8f9e6 docs: update FCP handoff — direct .96→.93:9050 verified, tunnel reverted
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.
2026-10-23 10:04:53 +07:00
jetson cb483c0824 Revert "feat: reverse SSH tunnel so FCP (.96) reaches recounter via 127.0.0.1:9050"
This reverts commit e3a905e170.
2026-10-20 15:49:15 +07:00
jetson e3a905e170 feat: reverse SSH tunnel so FCP (.96) reaches recounter via 127.0.0.1:9050
.96 cannot initiate connections to .93 (firewall drops NEW inbound,
100% ping loss .96->.93), but .93->.96 outbound works. start_tunnel.sh
opens ssh -R from .93 to .96, publishing recounter as .96's own
loopback :9050 - FCP sets RECOUNTER_URL=http://127.0.0.1:9050 and
counting stays on .93 hardware.

- start_tunnel.sh / stop_tunnel.sh (idempotent, keepalive, pidfile/log)
- start_dashboard.sh auto-starts tunnel (SKIP_TUNNEL=1 to opt out)
- stop_dashboard.sh stops tunnel alongside the web UI
- handoff doc section 1b: network solution + RECOUNTER_URL=127.0.0.1:9050
- E2E from .96: 401 no key / 202 with key / job COMPLETED on .93
2026-10-20 15:22:59 +07:00
jetson 43d1dee8b4 fix: conftest isolates RECOUNTER_API_KEY env for non-auth tests 2026-10-20 15:21:12 +07:00
jetson a36bfdab55 chore: document RECOUNTER_API_KEY in .env.example 2026-10-20 13:46:26 +07:00
jetson 371e9593d8 fix: review pass — atomic busy-guard, exact FCP mode filters, docs
- _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
2026-10-20 11:34:34 +07:00
jetson ca0583b734 docs: AI handoff for FCP-side phase 2 (clip repush button) 2026-10-20 11:06:34 +07:00
jetson 540e1b5dcd feat: POST /api/analyze machine endpoint (fcp_mode, 202/409/401)
- /api/analyze: multipart video + fcp_mode letter (A-D) or explicit
  model_stems; 202 {job_id,status_url}; 409 busy guard (one GPU);
  optional X-API-Key auth iff env RECOUNTER_API_KEY set
- config.yaml fcp.mode_models: FCP mode -> recounter stems (mirrors
  platform models.modes; C = current active_mode)
- extract _save_and_queue from /upload (save/transcode/zone/job);
  /upload behavior unchanged
- fix src/job.py: single-model class_filter looked up by filename,
  stem-keyed filters were silently dropped
2026-10-20 10:55:06 +07:00
jetson 97507f8bf8 docs: add ERD.md (Mermaid) and CHANGELOG.md
ERD: no DB in this repo — models in-memory Job/JobResult entities plus
filesystem artifacts (uploads/, output/job-*/, zones.json, models/),
with status state machine and restart/orphan hazards.

CHANGELOG: Keep a Changelog format covering all 83 commits grouped by
date, from 2026-09-15 init through the /upload NameError 500 fix.
2026-10-20 09:24:30 +07:00
jetson 8012f45a5c add: plan for fixed zone mode 2026-10-16 14:18:05 +07:00
jetson b1dd06e650 fix: remove undefined video_path reference in upload route
Previously, app.py:123-125 tried to use  and
 before  was defined.
This caused NameError and 500 Internal Server Error when users uploaded
new videos and pressed 'start analysis'.

The code block (lines 122-125) was duplicate logic - the later transcoding
at line 138 already handles the height check.

Fixes: # (Issue reference not provided)
2026-10-16 11:47:27 +07:00
jetson 37e2d3e296 sync: mirror platform counting params (stabilizer hold, track_buffer, tracker iou)
- stabilizer max_hold 10 -> 25 frames (~1s occlusion hold, platform parity)
- cfg/tracker.yaml track_buffer 60 -> 90 (identical to platform now)
- ByteTrackTracker gains iou=0.7 (passed to model.track, platform parity)
- stabilizer/tracking modules now byte-identical to karung_counter_semarang
- 177 tests pass
2026-10-15 14:12:35 +07:00
jetson 89a265c54c feat: auto-resize uploads to 720p, 720p default output
- src/preview.py: added resize_video_to_max_height() using ffmpeg
  (tries nvenc/v4l2m2m then libx264, atomic overwrite, only if >720p)
- app.py upload: transcode to 720p immediately after save
- app.py upload_reuse: probe first, only transcode if height > 720p
- templates/index.html: 720p output checkbox checked by default
- zones already scale correctly via build_static_roi (reference 1920x1080 -> 720p)
- 177 tests pass
2026-10-15 09:48:23 +07:00
jetson d09800c634 feat: re-attach orphaned output dirs after restart (deletable from UI)
Jobs are in-memory; output/job-* dirs survived restarts but never
appeared in /jobs, leaving 5.2GB undeletable. JobQueue now registers
stale job-* dirs (>5min old) as COMPLETED ghosts so the existing delete
flow rmtree's them. register_orphans=False opt-out. 177 tests pass (+3).
2026-10-14 11:47:03 +07:00
jetson c2d720e86c fix: scale min_bbox_area from platform 1280x720 reference to frame size
Platform force-resizes frames to 1280x720 before detection, so its
1500/5000 px2 thresholds are authored in that space. Applying them raw
at native 1080p made recounter's effective bar 2.25x weaker — false
divergence in double-check runs. _scaled_min_areas scales by frame area
(1080p: 3375/11250, 720p: unchanged).

Platform's get_min_valid_area perspective gate is dead code (zero call
sites) — deliberately not ported, it would make recounter stricter than
platform. 174 tests pass (+1).
2026-10-13 14:50:32 +07:00
jetson 92fd4cbb38 perf: async writer thread + MJPEG mtime guard
- _AsyncWriter: encode+draw overlap GPU inference (queue maxsize=2
  backpressure, order-preserving, first error surfaced at close, never
  masks original exception) — ~15-35% higher end-to-end FPS
- MJPEG endpoint yields only on preview mtime change instead of re-sending
  the same JPEG every 50ms
- 173 tests pass (+5)
2026-10-13 13:52:15 +07:00
jetson ce604b0574 feat: platform detection parity + download/processing progress bars
Alignment with karung_counter_semarang (recount consistency):
- box_conf 0.35, truck_conf 0.45, suppress_sack_box 0.4
- detector/tracker run at min(sack_conf, box_conf) so 0.35 boxes survive
  inference; _apply_class_confs gates box/box_conf, sack/sack_conf
- _apply_min_area guardrail: sack/box 1500, truck 5000 px2
- 168 tests pass (+5)
2026-10-13 11:30:04 +07:00
jetson 2efcdb2316 fix: hide 'Waiting for first frame' placeholder once MJPEG delivers
No load handler existed — placeholder overlay (absolute inset:0) stayed
on top of the live stream forever. Hide on img load; toggle OFF already
re-shows it.
2026-10-13 10:47:44 +07:00
jetson d89c985134 feat: start/stop/restart dashboard scripts 2026-10-13 10:08:43 +07:00
jetson 7230e2b3c8 feat: config.yaml as single source of truth for tunables
- config.yaml (root): detection conf, iou thresholds (dedup/suppress/
  synthetic/sticky), roi (ema/deadband/freeze_after), stabilizer, intervals
- src/config.py: deep-merge file over built-in defaults, missing file safe
- pipelines resolve None-sig params from config; CLI --sack-conf/--truck-conf
  override; TruckROITracker sticky_iou param
- 163 tests pass (+8)
2026-10-13 10:02:43 +07:00
jetson 31bfe7cac0 fix: restore accuracy defaults (detect_interval=1, sup_det_interval=5)
Throttled tracking caused ByteTrack ID switches at crossings -> counter
re-initializes new tracks without counting -> lost In counts; sup=10 put
box holds one detection-miss from expiry. Defaults back to every-frame
tracking; params kept for opt-in throttling. 720p/preview gains kept.
2026-09-30 11:08:40 +07:00
jetson f2b564446f feat: fixed ROI zone mode as default selection
- index.html: checked moves from dynamic to fixed radio; preset config
  visible on load (was only added on change event)
- app.js: when no zone presets exist, fall back to dynamic radio + hide
  preset config (server already falls back to dynamic)
2026-09-29 16:54:18 +07:00
jetson 81e6ae6624 feat: live box counts + separate sack/box nets on status page
- live_stats_callback sends box_loading/box_unloading (both pipelines)
- Job live_box_* fields, API JSON exposes them
- status page: 6 live tiles (Sack In/Out/Net, Box In/Out/Net), Box Net
  added to result cards (Jinja + JS), flex-wrap for 6-tile layout
- 155 tests pass (+2)
2026-09-29 16:37:33 +07:00
jetson 07289a419a perf: throttle tracker to every 2nd frame, sup interval 10, 720p output option
- detect_interval=2 on both pipelines; stabilizer 10-frame hold bridges
  skipped frames (GPU inference cut ~half during active batch)
- sup_det_interval 5 -> 10 (still <= stabilizer hold / synthetic max_age)
- preview_every_n default 2 -> 5
- AnnotatedVideoWriter: codec auto-chain gstreamer_nvenc -> avc1 -> mp4v,
  max_height downscale (even dims, INTER_AREA); backend logged
- output_max_height plumbed Job -> web checkbox (720p) -> CLI --output-height
- README: 720p option, CLI flag
- 153 tests pass (+13)
2026-09-29 15:58:55 +07:00
jetson ad41bf01e1 feat: stabilize secondary-model detections, box-wins suppression, port 9050
- SyntheticIdAssigner: track_id=None dets get stable negative IDs so the
  stabilizer hold bridges sup_det_interval gaps -> no flicker, boxes count
- apply primary model class filter in merged path (UI checkboxes work)
- _suppress_sacks_under_boxes: sack dets overlapping box dets dropped
  (models without box class label boxes as sack; stops double counting)
- default web port 9000 -> 9050 (WEB_PORT env still overrides)
- README: port refs, counting zone modes section, project tree
- 140 tests pass (+13)
2026-09-29 15:32:07 +07:00
jetson 4bd9de58e1 feat: freeze ROI mode, deadband+sticky jitter fix, explicit fixed/frozen ROI flags
- zone_mode=freeze: TruckROITracker locks box after 3 consecutive truck
  detections; geometry stays fixed while presence stays live (truck
  departure -> confidence 0 -> batch transitions keep working)
- jitter: 10px deadband skips EMA on tiny bbox noise; sticky main-truck
  pick (IoU>=0.3) prevents ROI jumps between parked trucks
- TruckROI.fixed/frozen flags replace dashboard confidence>=1.0 heuristic
- gate truck_centroid on truck_present in both pipelines
- +22 tests (test_truck_roi.py, test_freeze_plumbing.py); 127 pass
2026-09-28 14:36:21 +07:00
jetson 9a276b21f2 fix: isolate tests from real output/ dir via conftest autouse fixture
Tests imported the global job_queue (bound to real OUTPUT_DIR), creating
8 junk job-* dirs per pytest run (test_app x3, test_download_compress x4,
test_preview x1). Fixture redirects _output_dir to tmp_path and clears
the job registry before each test.
2026-09-28 13:55:47 +07:00
jetson f878110c3c fix: atomic compression writes, enforce size limit, job status guard 2026-09-28 13:38:24 +07:00
jetson 1dbfecaac3 fix: consistent Sack In/Out labels across live and results cards 2026-09-28 13:31:47 +07:00
jetson 6f86bca204 feat: compress downloads to max 250MB via ffmpeg 2026-09-28 09:39:56 +07:00
jetson 7932119e17 feat: propagate sack vs box counts to results and UI 2026-09-28 09:36:27 +07:00
jetson d38375986e fix: exclude truck class from counting, use MultiClassLineCounter, real class labels 2026-09-28 09:30:13 +07:00
jetson 35cccd03b3 fix: absolute OUTPUT_DIR, resolution scaling for zones, full reference repo values 2026-09-22 14:30:05 +07:00
jetson 2b462318ac feat: visual distinction for fixed zone vs dynamic ROI 2026-09-22 13:12:17 +07:00
jetson 859d6a0f0f feat: interactive zone calibration tool 2026-09-22 13:10:45 +07:00
jetson f0ea95dd26 feat: web UI zone mode selector with preset dropdown 2026-09-22 13:08:28 +07:00