forked from zakaria/chicken-counting-sukawarna-det
feat: add engine auto-recompilation, mortality detection, multi-execution batching, and dashboard updates
- Add engine_utils for TensorRT compatibility verification, auto-recompilation from .pt models, and YAML auto-updates - Add mortality detection pipeline (mortality.py, test_run_mortality.sh, mortality_config.yaml) - Add multi-execution batch modes (parallel_processes, tensor_batching, hybrid) in batch_runner.py - Add daily test run automation scripts and video processing runners - Add dashboard REST API, live stream endpoints, and web UI templates - Clean up git tracking by ignoring __pycache__, .pyc, and build artifacts
This commit is contained in:
1 parent
c05f3d98d0
commit
010f6e1493
97 files changed
+3361
-643
No files matched your search
Executable → Regular
+8
-5
@@ -1,7 +1,7 @@
|
||||
camera_id: coop_cam_03
|
||||
source: /media/jetson/DATA/record/try-sukawarna.mp4
|
||||
source: ../record/try-sukawarna.mp4
|
||||
detection:
|
||||
model_path: /media/jetson/DATA/chicken-sukawarna/chicken-detection-model-v26n-300e-best-2026-05-02-NEW.engine
|
||||
model_path: models/chicken-detection-model-v26n-300e-best-2026-05-02-NEW.onnx
|
||||
classes: [0]
|
||||
ignored_classes: [1, 2]
|
||||
conf: 0.35
|
||||
@@ -10,6 +10,9 @@ detection:
|
||||
device: "0"
|
||||
min_box_area_px: 6000
|
||||
validate_while_inside: true
|
||||
# Example is coop_cam_03 — same ID-flip guard as batch CC3.
|
||||
dedupe_radius_px: 24
|
||||
dedupe_frames: 12
|
||||
detection_zone:
|
||||
enabled: true
|
||||
buffer_above_px: 250
|
||||
@@ -18,7 +21,7 @@ detection_zone:
|
||||
tracker:
|
||||
tracker_config_path: configs/trackers/botsort_chicken.yaml
|
||||
persist: true
|
||||
track_buffer: 75
|
||||
track_buffer: 90
|
||||
roi:
|
||||
points:
|
||||
- [80, 340]
|
||||
@@ -63,7 +66,7 @@ overlay:
|
||||
- [0, 255, 255]
|
||||
display:
|
||||
show_window: false
|
||||
output_path: /media/jetson/DATA/try-sukawarna-vis.mp4
|
||||
output_path: ../try-sukawarna-vis.mp4
|
||||
encoder: auto
|
||||
output_bitrate_kbps: 4000
|
||||
codec_preference: [avc1, mp4v, H264]
|
||||
@@ -75,5 +78,5 @@ feedback:
|
||||
enabled: true
|
||||
every_n_frames: 900
|
||||
save_images: false
|
||||
image_output_dir: /media/jetson/DATA/chicken-sukawarna/output/checkpoints
|
||||
image_output_dir: output/checkpoints
|
||||
log_to_terminal: true
|
||||
Executable → Regular
+15
-5
@@ -1,16 +1,16 @@
|
||||
batch:
|
||||
root_dir: /media/jetson/DATA/.Codes/VIDEOS/cycle7/kandang-atas
|
||||
root_dir: ../VIDEOS/cycle7/kandang-atas
|
||||
camera_glob: "kandang_*_camera_{num}_*.mp4"
|
||||
output_subdir: output
|
||||
compress_max_mb: 200
|
||||
delete_intermediate: false
|
||||
checkpoint_every_n_frames: 3000
|
||||
location: kandang-atas
|
||||
db_path: /media/jetson/DATA/.Codes/chicken-counting-sukawarna-det/db/chicken_counts.db
|
||||
db_path: db/chicken_counts.db
|
||||
|
||||
defaults:
|
||||
detection:
|
||||
model_path: /media/jetson/DATA/.Codes/chicken-counting-sukawarna-det/models/chicken-detection-model-v26n-300e-best-2026-05-02-NEW.engine
|
||||
model_path: models/chicken-detection-model-v26n-300e-best-2026-05-02-NEW.onnx #pt = accuracy, onnx = speed
|
||||
classes: [0]
|
||||
ignored_classes: [1, 2]
|
||||
conf: 0.35
|
||||
@@ -19,15 +19,18 @@ defaults:
|
||||
device: "0"
|
||||
min_box_area_px: 3000
|
||||
validate_while_inside: true
|
||||
# Dedupe off by default; enabled only on CC2/CC3 (see cameras below).
|
||||
dedupe_radius_px: 0
|
||||
dedupe_frames: 12
|
||||
detection_zone:
|
||||
enabled: true
|
||||
buffer_above_px: 250
|
||||
buffer_below_px: 250
|
||||
show_in_overlay: true
|
||||
tracker:
|
||||
tracker_config_path: /media/jetson/DATA/.Codes/chicken-counting-sukawarna-det/configs/trackers/botsort_chicken.yaml
|
||||
tracker_config_path: configs/trackers/botsort_chicken.yaml
|
||||
persist: true
|
||||
track_buffer: 75
|
||||
track_buffer: 90
|
||||
gate:
|
||||
mode: two_line
|
||||
lines_y: [420, 730]
|
||||
@@ -97,6 +100,10 @@ cameras:
|
||||
CC2:
|
||||
camera_num: 2
|
||||
count_anchor: [900, 120]
|
||||
detection:
|
||||
# ~5% double-count from ID flips; tight radius only.
|
||||
dedupe_radius_px: 24
|
||||
dedupe_frames: 12
|
||||
roi:
|
||||
points:
|
||||
- [20, 380]
|
||||
@@ -106,6 +113,9 @@ cameras:
|
||||
CC3:
|
||||
camera_num: 3
|
||||
count_anchor: [900, 120]
|
||||
detection:
|
||||
dedupe_radius_px: 24
|
||||
dedupe_frames: 12
|
||||
roi:
|
||||
points:
|
||||
- [20, 330]
|
||||
|
||||
Executable → Regular
+3
-3
@@ -1,5 +1,5 @@
|
||||
batch:
|
||||
root_dir: /media/jetson/DATA/.Codes/VIDEOS/cycle7/kandang-atas
|
||||
root_dir: /home/asus/.Codes/VIDEOS/cycle7/kandang-atas
|
||||
camera_glob: "kandang_*_camera_{num}_*.mp4"
|
||||
output_subdir: output
|
||||
compress_max_mb: 200
|
||||
@@ -8,7 +8,7 @@ batch:
|
||||
|
||||
defaults:
|
||||
detection:
|
||||
model_path: /media/jetson/DATA/.Codes/chicken-counting-sukawarna-det/chicken-detection-model-v26n-300e-best-2026-05-02-NEW.engine
|
||||
model_path: /home/asus/.Codes/chicken-counting-sukawarna-det/chicken-detection-model-v26n-300e-best-2026-05-02-NEW.engine
|
||||
classes: [0]
|
||||
ignored_classes: [1, 2]
|
||||
conf: 0.35
|
||||
@@ -23,7 +23,7 @@ defaults:
|
||||
buffer_below_px: 250
|
||||
show_in_overlay: true
|
||||
tracker:
|
||||
tracker_config_path: /media/jetson/DATA/.Codes/chicken-counting-sukawarna-det/configs/trackers/botsort_chicken.yaml
|
||||
tracker_config_path: /home/asus/.Codes/chicken-counting-sukawarna-det/configs/trackers/botsort_chicken.yaml
|
||||
persist: true
|
||||
track_buffer: 75
|
||||
gate:
|
||||
|
||||
Executable → Regular
+3
-3
@@ -1,5 +1,5 @@
|
||||
batch:
|
||||
root_dir: /media/jetson/DATA/.Codes/VIDEOS/cycle7/kandang-atas
|
||||
root_dir: /home/asus/.Codes/VIDEOS/cycle7/kandang-atas
|
||||
camera_glob: "kandang_*_camera_{num}_*.mp4"
|
||||
output_subdir: output
|
||||
compress_max_mb: 200
|
||||
@@ -8,7 +8,7 @@ batch:
|
||||
|
||||
defaults:
|
||||
detection:
|
||||
model_path: /media/jetson/DATA/.Codes/chicken-counting-sukawarna-det/chicken-detection-model-v26n-300e-best-2026-05-02-NEW.engine
|
||||
model_path: /home/asus/.Codes/chicken-counting-sukawarna-det/chicken-detection-model-v26n-300e-best-2026-05-02-NEW.engine
|
||||
classes: [0]
|
||||
ignored_classes: [1, 2]
|
||||
conf: 0.35
|
||||
@@ -23,7 +23,7 @@ defaults:
|
||||
buffer_below_px: 250
|
||||
show_in_overlay: true
|
||||
tracker:
|
||||
tracker_config_path: /media/jetson/DATA/.Codes/chicken-counting-sukawarna-det/configs/trackers/botsort_chicken.yaml
|
||||
tracker_config_path: /home/asus/.Codes/chicken-counting-sukawarna-det/configs/trackers/botsort_chicken.yaml
|
||||
persist: true
|
||||
track_buffer: 75
|
||||
gate:
|
||||
|
||||
Executable → Regular
+3
-3
@@ -1,5 +1,5 @@
|
||||
batch:
|
||||
root_dir: /media/jetson/DATA/.Codes/VIDEOS/cycle7/kandang-atas
|
||||
root_dir: /home/asus/.Codes/VIDEOS/cycle7/kandang-atas
|
||||
camera_glob: "kandang_*_camera_{num}_*.mp4"
|
||||
output_subdir: output
|
||||
compress_max_mb: 200
|
||||
@@ -8,7 +8,7 @@ batch:
|
||||
|
||||
defaults:
|
||||
detection:
|
||||
model_path: /media/jetson/DATA/.Codes/chicken-counting-sukawarna-det/chicken-detection-model-v26n-300e-best-2026-05-02-NEW.engine
|
||||
model_path: /home/asus/.Codes/chicken-counting-sukawarna-det/chicken-detection-model-v26n-300e-best-2026-05-02-NEW.engine
|
||||
classes: [0]
|
||||
ignored_classes: [1, 2]
|
||||
conf: 0.35
|
||||
@@ -23,7 +23,7 @@ defaults:
|
||||
buffer_below_px: 250
|
||||
show_in_overlay: true
|
||||
tracker:
|
||||
tracker_config_path: /media/jetson/DATA/.Codes/chicken-counting-sukawarna-det/configs/trackers/botsort_chicken.yaml
|
||||
tracker_config_path: /home/asus/.Codes/chicken-counting-sukawarna-det/configs/trackers/botsort_chicken.yaml
|
||||
persist: true
|
||||
track_buffer: 75
|
||||
gate:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
batch:
|
||||
root_dir: /media/jetson/DATA/.Codes/VIDEOS/cycle7/kandang-atas
|
||||
root_dir: "../VIDEOS/cycle7/kandang-atas"
|
||||
camera_glob: "kandang_*_camera_{num}_*.mp4"
|
||||
output_subdir: output
|
||||
compress_max_mb: 200
|
||||
@@ -7,27 +7,44 @@ batch:
|
||||
checkpoint_every_n_frames: 3000
|
||||
location: kandang-atas
|
||||
db_path: db/chicken_counts.db
|
||||
cycle_start_date: "2026-05-22" #day 0
|
||||
execution_mode: parallel_processes # parallel_processes (default) | tensor_batching | hybrid
|
||||
|
||||
stages:
|
||||
early_cycle:
|
||||
day_min: 0
|
||||
day_max: 15
|
||||
detection:
|
||||
conf: 0.1
|
||||
min_box_area_px: 100
|
||||
roi:
|
||||
min_overlap_ratio: 0.1 # 0.25
|
||||
mid_cycle:
|
||||
day_min: 16
|
||||
day_max: 999
|
||||
|
||||
defaults:
|
||||
detection:
|
||||
model_path: /media/jetson/DATA/.Codes/chicken-counting-sukawarna-det/chicken-detection-model-v26n-300e-best-2026-05-02-NEW.engine
|
||||
model_path: models/NUC5070_chicken-detection-model-v26n-300e-best-2026-05-02-NEW.engine # TensorRT engine (RTX 5070)
|
||||
classes: [0]
|
||||
ignored_classes: [1, 2]
|
||||
conf: 0.55 # ↑ 0.35 → fewer false positives, less tracking CPU
|
||||
conf: 0.40 # mild lift vs 0.35; 0.55 was undercounting
|
||||
iou: 0.55
|
||||
imgsz: 640
|
||||
device: "0"
|
||||
min_box_area_px: 5000 # ↑ 3000 → filter small false positives
|
||||
min_box_area_px: 3000
|
||||
validate_while_inside: true
|
||||
dedupe_radius_px: 0 # off for CC1/CC4; CC2/CC3 enable below
|
||||
dedupe_frames: 12
|
||||
detection_zone:
|
||||
enabled: true
|
||||
buffer_above_px: 250
|
||||
buffer_below_px: 250
|
||||
show_in_overlay: true
|
||||
tracker:
|
||||
tracker_config_path: /media/jetson/DATA/.Codes/chicken-counting-sukawarna-det/configs/trackers/botsort_chicken.yaml
|
||||
tracker_config_path: configs/trackers/botsort_chicken.yaml
|
||||
persist: true
|
||||
track_buffer: 75
|
||||
track_buffer: 90
|
||||
gate:
|
||||
mode: two_line
|
||||
lines_y: [420, 730]
|
||||
@@ -41,7 +58,7 @@ defaults:
|
||||
reverse_exit_threshold: -0.5
|
||||
debounce_frames: 12
|
||||
min_features: 40 # ↓ 60 → less optical flow computation
|
||||
max_corners: 50 # ↓ 80 → fewer corner features
|
||||
max_corners: 50 # ↓ 80 → fewer corner featuresis
|
||||
stride_frames: 3 # ↑ 2 → motion detection every 3rd frame
|
||||
flow_scale: 0.5
|
||||
quality_level: 0.01
|
||||
@@ -83,12 +100,15 @@ defaults:
|
||||
inset_right_px: 60
|
||||
inset_top_px: 0
|
||||
inset_bottom_px: 0
|
||||
min_overlap_ratio: 0.35 # ↑ 0.30 → stricter counting validation
|
||||
min_overlap_ratio: 0.30
|
||||
|
||||
cameras:
|
||||
CC1:
|
||||
camera_num: 1
|
||||
count_anchor: [780, 120]
|
||||
detection:
|
||||
min_box_area_px: 2500
|
||||
conf: 0.35
|
||||
roi:
|
||||
points:
|
||||
- [250, 330]
|
||||
@@ -98,8 +118,10 @@ cameras:
|
||||
CC2:
|
||||
camera_num: 2
|
||||
count_anchor: [900, 120]
|
||||
detection: # per-camera override: wider angle = smaller bboxes
|
||||
min_box_area_px: 3000
|
||||
detection:
|
||||
conf: 0.5 # From 0.45
|
||||
dedupe_radius_px: 32
|
||||
dedupe_frames: 24 # From 18
|
||||
roi:
|
||||
points:
|
||||
- [20, 380]
|
||||
@@ -109,6 +131,9 @@ cameras:
|
||||
CC3:
|
||||
camera_num: 3
|
||||
count_anchor: [900, 120]
|
||||
detection:
|
||||
dedupe_radius_px: 24
|
||||
dedupe_frames: 16 # From 12
|
||||
roi:
|
||||
points:
|
||||
- [20, 330]
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
# Configuration for Mortality Chicken Carcass Detection & Counting
|
||||
mortality:
|
||||
input_dir: "../VIDEOS/cycle7/kandang-atas/mortality"
|
||||
output_dir: null # null = save output_<File Name> in input directory
|
||||
model_path: "models/chicken-detection-model-v26n-seg-300e-best-2026-04-18.pt"
|
||||
device: "0" # "0" for GPU acceleration, or "cpu"
|
||||
conf: 0.7
|
||||
iou: 0.8
|
||||
min_box_area_px: 1500
|
||||
dedupe_radius_px: 30.0
|
||||
two_pass: false # Enable Union 2x Detect & Refine crop pipeline
|
||||
classes: [0] # Class 0 = chicken ONLY; ignores background/text/equipment (classes 1 not-chicken, 2 half-chicken)
|
||||
imgsz: 640
|
||||
Executable → Regular
+3
-3
@@ -1,12 +1,12 @@
|
||||
tracker_type: botsort
|
||||
track_high_thresh: 0.5
|
||||
track_low_thresh: 0.1
|
||||
new_track_thresh: 0.6
|
||||
track_buffer: 75
|
||||
new_track_thresh: 0.65
|
||||
track_buffer: 90
|
||||
match_thresh: 0.8
|
||||
fuse_score: true
|
||||
gmc_method: none
|
||||
proximity_thresh: 0.5
|
||||
appearance_thresh: 0.25
|
||||
with_reid: false
|
||||
model: auto
|
||||
model: auto
|
||||
Reference in new issue
Block a user