Tuning

Temporal smoothing, the FPS-versus-quality levers, small-object recall, and the tiling toggle.

Tuning Helios is config work, not code work: iterate until it works on the machine in front of you, then record the winning values in that machine's profile. The target is ≥ 20–30 FPS with legible, stable boxes.

Temporal smoothing

PPE and danger-zone state is decided by a rolling-window majority vote per track ID, so a violation or intrusion reads cleanly instead of strobing. Three knobs control it:

[default]
smoothing_window      = 8     # frames in the rolling vote (~a quarter-second at 30fps)
smoothing_min_ratio   = 0.6   # fraction of the window that must agree to hold a state
smoothing_evict_after = 15    # frames a vanished track survives before its history is dropped

How the vote behaves:

  • Majority vote. A key is reported True when its true-count divided by its window length is at least min_ratio.
  • Fast onset. A brand-new key with a single sample reports that sample immediately — the window is effectively length 1 — so a violation flashes without waiting for the window to fill.
  • Anti-strobe. Once the window is full, flipping an established state takes ceil(window * (1 - min_ratio)) + 1 consecutive dissenting frames. With window = 4 and min_ratio = 0.6, three True frames followed by one False still yields True (3/4 = 0.75 ≥ 0.6).
  • Bounded memory. A key absent for more than evict_after consecutive frames is dropped, so long sessions do not accumulate state.

Tune it by symptom:

SymptomFix
Violation / intrusion state strobesRaise smoothing_window / smoothing_min_ratio
Violation takes too long to flash (over ~2 s)Lower smoothing_window / smoothing_min_ratio

Record the winning values in the machine's [profiles.<hostname>] table.

FPS versus box quality

All of these are config knobs; none requires a code change.

LeverEffectTry
modelbigger = better quality, sloweryoloe-11s-seg.pt, then -11m-seg, then -11l-seg
imgszsmaller = faster, less precise896 / 640 / 512 / 480
confhigher = fewer boxes, less flicker0.20 – 0.40
target_fpscaps the loop (saves GPU)30
trackertracking algorithm used for countingbytetrack.yaml (light) or botsort.yaml (occlusion)
smoothing_window / smoothing_min_ratioanti-strobe for PPE and zone state8 / 0.6 — raise to stabilize, lower to react faster

The measured FPS shown next to the feed is smoothed over the full loop iteration, after throttling to target_fps — so a value pinned near your target means the loop has headroom, not that it is struggling.

The one-time costs — the AMP check and the model-weight downloads — happen on first run only. Pre-warm them before you need the demo; see Quickstart.

Small-object recall (imgsz)

Small items — especially safety glasses — are the hardest to detect. The first lever is imgsz: a larger inference size improves small-object recall at an FPS cost.

If hard hat or vest recall is weak, raise imgsz (for example 640 to 896) and re-measure FPS, then record the winning value in that machine's profile. Hard hat and vest are the reliable items to lean on; do not promise glasses.

The tiling toggle

Tiling is the second small-object-recall lever. Instead of one full-frame inference, the frame is sliced into overlapping tiles that are inferred independently and merged.

  • It is exposed as a Tiling button in the UI and flips live on the server — no restart, no code change. The tooltip states the trade-off plainly: "Tiling improves small-object recall but disables tracking-based counting while on."
  • It ships off by default, so the default path is byte-for-byte the tracked full-frame path.
  • tiling_enabled in helios.toml seeds the startup default only; the live toggle is authoritative afterward.
  • tile_size (default 640) and tile_overlap (default 128) are config-only — there are no UI sliders.

Tiling costs you tracking

Tiles are inferred independently, so no tile carries a tracker ID. While tiling is on, cumulative line counting and the anti-strobe smoothing both fall back to instantaneous behavior. Turn tiling on when small-object recall matters more than stable counts, and off again when it doesn't.