YOLO Detection
YoloDetectionTask runs object detection on incoming video frames through a selected YoloWorker. Use it to detect people, vehicles, animals, or other model classes and turn accepted detections into Banalytics MotionEvent automation signals.
Classify frames, filter detections, and fire MotionEvent
The task submits frames to a YOLO worker asynchronously, filters results by target class and zone, optionally draws bounding boxes and labels, updates the motion flag in the execution context, and emits MotionEvent when configured conditions are met.
Object classes
Keep only the model classes that matter for the scene, such as person, car, truck, or dog.
Detection zones
Use trigger and insensitive areas to make events depend on where accepted objects appear in the frame.
Motion events
Downstream rules receive triggered class names, triggered zones, and relative overlap area.
Define what should count as a real detection
Full-frame object detection
Leave detectionAreas empty when any accepted object anywhere in the frame should fire a MotionEvent. In this mode the event uses the wildcard zone *.
Zone-based alarm
Draw trigger zones for places where object presence matters, such as entrance, driveway, gate, shelf, loading area, or restricted zone.
Ignore noisy regions
Add insensitive areas over TV screens, reflections, roads outside the protected area, moving trees, or busy background zones.
Class-specific detection
Select only the required classes in targetClasses. An empty list accepts all classes returned by the selected worker model.
Tune thresholds for false positives and missed objects
confidenceThreshold, use trigger zones, and set a longer eventStunTimeMillis when false positives are costly.confidenceThreshold carefully while validating with drawn classes. This can reveal small or distant objects but increases noise.nmsThreshold to suppress overlapping boxes more strongly, or raise it to keep more neighboring boxes.eventStunTimeMillis to avoid repeated notifications while the same class and zone set remains unchanged.Control inference cost without changing camera FPS
Use detection delay first
Increase detectionDelay when inference is too expensive or worker wait time grows. Lower it only when the worker has spare capacity and faster reaction is needed.
Run after motion detection
Place YOLO after MotionDetectionTask when classification should run only on motion-relevant frames. This is usually cheaper than classifying every camera frame.
Disable drawing for clean output
Keep drawClasses=true while tuning. Disable it when the output stream must stay clean or when rendering overhead matters.
Configuration parameters
| Parameter | Required | Description | Default |
|---|---|---|---|
Image classification model | Yes | Reference to a running YoloWorker that provides YOLO inference. | None |
Target classes | Optional | JSON array of class names to keep. Empty array means all classes from the selected model are accepted. | [] |
Confidence threshold | Yes | Minimum class confidence before NMS and event filtering. Allowed range is 0.1-1.0. | 0.6 |
NMS | Yes | Non-Maximum Suppression IoU overlap threshold. Allowed range is 0.05-1.0. | 0.7 |
Detection areas | Optional | Serialized trigger and insensitive zone polygons used to filter detections by area. | Empty |
Show classes | Yes | Draws accepted bounding boxes and class labels on output frames. | true |
Classification delay | Yes | Minimum interval in milliseconds between YOLO inference submissions. Allowed range is 100-10000. | 500 |
Stun events (ms) | Yes | Minimum interval before repeated MotionEvent firing for the same class-count and zone set. | 1 |
Font scale | Yes | Label font scale factor. Allowed range is 0.3-2.0. | 0.6 |
MotionEvent fields from YOLO detection
| Field | Type | Description | Use |
|---|---|---|---|
triggeredZones | String[] | Zone identifiers overlapped by accepted detections, or ["*"] when no zones are configured. | Route by area |
triggeredClasses | String[] | Distinct class names that passed filtering. | Route by object type |
relativeOverlapArea | double | Sum of accepted detection bounding-box areas divided by the frame area. | Rough coverage signal |
sourceTaskUuid | UUID | Identifier of the YoloDetectionTask that fired the event. | Diagnostics |
config.names exactly. Use the UI selector populated from the worker to avoid spelling mismatches.
Operational notes
Worker must be running
If the selected worker is stopped or overloaded, the video stream can continue but detections may be delayed or absent.
Use worker statistics
High wait time usually means too many detection tasks, too few workers, too low detectionDelay, or a model/backend that is too slow.
Coverage is approximate
relativeOverlapArea is useful for rough object coverage, not for physical size measurement.
Events are motion events
The task emits MotionEvent, not separate object identity events. Use Event Manager rules or actions to route, store, or notify on those events.