54 Commits
Author SHA1 Message Date
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
jetson 7c91081ea8 feat: add zone_mode and fixed_zone fields to Job 2026-09-22 13:03:37 +07:00
jetson ad3e7a7e9e feat: add fixed_zone param to pipelines, skip truck detection when set 2026-09-22 13:01:40 +07:00
jetson 4ad4284d9a feat: zone config loader and static ROI builder 2026-09-22 12:57:36 +07:00
jetson 5bf44d6457 fix: use tracker for counting + throttle supplementary detectors
- Primary model uses ByteTrackTracker.update() every frame (gives track_ids)
- Supplementary models run every 5th frame only (reduces GPU load N->1)
- Counter only receives detections with track_id (fixes zero counts)
- Dashboard draws all detections (tracker + supplementary merged)
2026-09-22 11:42:10 +07:00
jetson fc20a521ee feat: merged detection output + parallel model execution
- Multiple models run simultaneously on each frame via ThreadPoolExecutor
- Detections merged with IoU deduplication (same class, high overlap → keep highest conf)
- Single merged_annotated.mp4 output (not per-model videos)
- Single model still uses existing run_pipeline for backward compat
- Active jobs banner on upload page (polls every 5s)
- GPU warning when selecting 3+ models
- 62/62 tests pass
2026-09-22 11:10:41 +07:00
jetson 163280078f fix: toggle preview display bug, add job deletion, optimize pipeline
- Fix: toggle ON now resets img display to block (was stuck on 'waiting')
- Toggle OFF sends API call to stop preview file writes
- Delete button on status page + jobs page cards
- DELETE /api/jobs/<id> endpoint removes job + output files
- PUT /api/jobs/<id>/preview endpoint toggles preview_enabled
- Pipeline skips resize/encode/write when preview_enabled=False
- Reduced preview defaults: 480px max, JPEG quality 60
- 62/62 tests pass
2026-09-22 10:49:06 +07:00
jetson 09a8829575 feat: live preview toggle, FPS indicator, live counting by object
- Toggle ON/OFF switch to disable preview (faster processing)
- FPS badge showing rolling average processing speed
- Live Loading/Unloading/Net counts updated in real-time
- Pipeline callback pushes stats every 10 frames
- Frontend polls and updates display every 2s
- 62/62 tests pass
2026-09-22 10:36:11 +07:00
jetson b6379e14c9 fix: show live preview img by default (was display:none from SocketIO era) 2026-09-22 10:29:12 +07:00
jetson 39b582a481 docs: update README.md with current features and API
- Added live preview (MJPEG), auto truck detection, video reuse/delete
- Added abort button, model groups with format dropdown
- Updated API endpoints table with all current routes
- Added configuration section with env variables
- Added model formats and truck detection sections
- Updated project structure with preview.py
2026-09-22 10:18:36 +07:00
jetson a5566f3b99 feat: switch live preview from WebSocket to MJPEG streaming
- Pipeline writes JPEG to /tmp/feedmill_preview_{job_id}.jpg (atomic)
- Flask serves MJPEG stream at /api/preview/{job_id}
- Frontend uses native <img src> MJPEG — zero JS needed
- Removed flask-socketio, eventlet, socket.io CDN dependencies
- 33% less bandwidth per frame, native browser decode
- Same proven approach as original karung-counting project
2026-09-22 10:09:22 +07:00
jetson 1e28eb49e2 fix: pass truck centroid to batch manager for state transitions
The legacy batch_mgr.update() method was calling update_truck() with
truck_centroid=None, which prevented the batch from transitioning
from IDLE to TRUCK_STABILIZING (centroid must be non-None).

Now pipeline computes centroid from ROI and passes it through.

Verified: old run had 0 cyan pixels (no tracking), new run has 28190
cyan pixels (tracking active, bounding boxes drawn).
2026-09-21 16:07:04 +07:00
jetson 57afb62542 fix: auto-use truck-detector when model lacks truck class
When a model without 'truck' class is selected (best, karung-dimuat,
yolo11n-bbox), the pipeline now automatically loads the truck-detector
model for truck detection. This ensures the batch manager transitions
to COUNTING_SACKS state and draws bounding boxes on output video.

Changes:
- Added find_truck_detector() helper in model_registry.py
- Added truck_model_config parameter to run_pipeline()
- job.py auto-selects truck-detector when model lacks truck class
- Verified with best.engine + batch-3.mp4: bounding boxes drawn
2026-09-21 13:37:01 +07:00
jetson f9e411f407 feat: 15+ FPS live preview via WebSocket push
- flask-socketio + threading mode (no eventlet monkey-patching)
- preview_queue in pipeline: downscale to 640p, JPEG encode, bounded queue
- encoder thread per job reads queue → SocketIO broadcast to room
- Frontend: SocketIO client replaces HTTP polling, handles preview_frame event
- Configurable: preview_every_n, preview_max_dim, preview_jpeg_quality
- 62/62 tests pass
2026-09-21 11:07:42 +07:00
jetson 42c80fd0fc fix: remove required attr from file input when existing video is selected 2026-09-21 10:32:14 +07:00
jetson d353272a0b feat: add video delete button for uploaded videos 2026-09-21 10:20:02 +07:00
jetson 93daa68668 fix: add explicit GPU memory cleanup between models to prevent OOM 2026-09-21 10:19:29 +07:00
jetson 6783ff3970 feat: add abort button for job cancellation 2026-09-21 09:40:57 +07:00
jetson f779f05190 feat: add video reuse — re-analyze previous uploads without re-uploading 2026-09-21 09:35:29 +07:00
jetson a75db4ca49 fix: pin numpy<2.0 to resolve Jetson torch incompatibility 2026-09-21 09:00:44 +07:00
jetson d07b3bac4c feat: update JavaScript for grouped model selection 2026-09-18 12:04:00 +07:00
jetson dbd79ed442 feat: update Flask routes to use grouped models 2026-09-18 11:46:22 +07:00
jetson 22c78429cf feat: add ModelGroup and scan_model_groups() for grouped model display 2026-09-18 11:42:27 +07:00
jetson d32045b433 feat: add TensorRT engine export script 2026-09-18 11:23:08 +07:00
jetson 06b013a778 fix: graceful error when onnxruntime missing for .onnx models 2026-09-18 10:40:30 +07:00
jetson 1bc5e0634c chore: remove duplicate v4-best (1).pt model file 2026-09-18 10:39:59 +07:00
jetson 16135c1b86 Merge branch 'sdd-main' 2026-09-18 08:16:19 +07:00
jetson 47ffede485 fix(ui): flat progress bar on status page, format created-time 2026-09-18 08:11:53 +07:00
jetson 7b19b5b41a fix(ui): add dynamic aria-valuenow, refine focus-visible styles 2026-09-18 08:06:40 +07:00
jetson 441a6a857e fix(ui): accessibility, responsive, polish pass 2026-09-17 16:23:04 +07:00
jetson 20d523469d fix(ui): jobs page — semantic cards, remove onclick, flat progress bar 2026-09-17 16:19:51 +07:00
jetson b1170f42a9 feat(ui): jobs page — card grid with badges and thumbnails 2026-09-17 16:17:12 +07:00
jetson 87c8da3961 fix(job): clear latest_frame on pipeline failure 2026-09-17 16:14:18 +07:00
jetson f487b5cf03 feat(pipeline): emit live annotated frames for preview 2026-09-17 16:12:35 +07:00
jetson 1d35c285da fix(ui): status page — fix download link path, connection-lost re-show 2026-09-17 16:09:33 +07:00
jetson 63235832d6 fix(ui): status page — null safety, preview visibility, error handling 2026-09-17 16:07:33 +07:00
jetson 1c54bb1a11 feat(ui): status page — progress bar, live preview, result cards, polling 2026-09-17 16:05:22 +07:00
jetson dca6f6b335 feat(api): video preview endpoints — thumbnail, sample frames, live frame 2026-09-17 16:00:02 +07:00
jetson 197c505fa4 fix(ui): upload page — fix double-toggle bug, replace hardcoded colors, improve error handling 2026-09-17 15:56:55 +07:00
jetson f245e9427e feat(ui): upload page — drag-drop, video preview, model cards 2026-09-17 15:53:32 +07:00
jetson c17d48041d fix(ui): add missing --space-7, replace hardcoded colors with tokens 2026-09-17 15:50:57 +07:00
jetson fbcff78543 feat(ui): design system foundation — CSS tokens, base template 2026-09-17 15:49:15 +07:00