Files

74 lines
3.2 KiB
YAML

# config.yaml — tunable pipeline parameters (single source of truth).
# Edit values here instead of the code. Restart the web app / re-run CLI to apply.
# Zones (polygons) live in zones.json. Tracker hyperparams live in cfg/tracker.yaml.
# Missing keys fall back to built-in defaults — partial files are fine.
detection:
sack_conf: 0.35 # detector confidence for sack (FCP config.yaml:109)
box_conf: 0.35 # detector confidence for box
truck_conf: 0.45 # truck detector confidence
# Per-class minimum bbox area (px^2) — literal values in the 1280x720
# analysis frame (scale factor is 1.0, so no rescaling happens).
min_bbox_area:
sack: 1500
box: 1000
truck: 5000
iou:
dedup: 0.5 # cross-model duplicate merge threshold
suppress_sack_box: 0.4 # drop sack overlapping a box (box label wins)
synthetic: 0.3 # synthetic track ID matching
sticky_truck: 0.3 # keep previous main truck pick
sack_nms: 0.45 # primary sack ByteTrack NMS IoU (FCP config.yaml:111)
box_nms: 0.7 # box ByteTrack NMS IoU (FCP config.yaml:115)
roi:
ema_alpha: 0.15 # truck ROI smoothing
deadband_px: 10 # skip EMA when all edges moved less than this
freeze_after: 3 # consecutive detections before freeze mode locks
stabilizer:
ema_alpha: 0.35
max_hold: 10 # FCP parity: predict.py:668 (max_hold_frames=10)
# Batch lifecycle (FCP config.yaml:123-124 — the values the batch FSM is
# built with, karung_counter_semarang/predict.py:739-745).
batch:
timeout_seconds: 20.0 # sack-idle: N s with no crossing AND no sack
# in the truck area -> batch pauses (WAITING)
truck_gone_tolerance_seconds: 30.0 # truck-gone: in WAITING, N s with no sack and
# no truck signal -> batch ends
# Counting gates (FCP main, src/config_loader.py:104-107).
counting:
capture_below_px: 100 # corridor below the line: deep truck bed, never counts
max_step_dy_px: 160 # per-step vertical jump = ID switch -> reset track history
max_gap_frames: 15 # frames a track may vanish before its history resets
unload_confirm_frames: 1 # consecutive "above" frames needed to confirm an unload
pipeline:
detect_interval: 1 # detection+tracking every N frames (1 = every frame, most accurate)
sup_det_interval: 5 # supplementary models every N frames
truck_det_interval: 5 # truck ROI detection every N frames (FCP predict.py:882 — truck model every 5th frame)
preview_every_n: 5 # preview JPEG every N frames
fcp:
# FCP model-mode letter -> {model stem: engine-contributed classes}, for
# POST /api/analyze. Mirrors karung_counter_semarang config.yaml
# models.modes engines[].classes exactly (v4-best serves the truck-only
# role in B/D — NOT the truck-detector weights). C = active_mode.
mode_models:
A:
v4-best: [truck, sack]
B:
v4-best: [truck]
"yolo11n-bbox-100ep-sack+box-20260909-best": [sack, box]
C:
v4-best: [truck, sack]
"yolo11n-bbox-100ep-sack+box-20260909-best": [box]
D:
v4-best: [truck]
best: [sack]
"yolo11n-bbox-100ep-sack+box-20260909-best": [box]