YOLO Worker
Yolo Worker loads a YOLO object-detection model and exposes it as a reusable image classifier for Banalytics tasks. Use it when one or more cameras need real-time object classification through the same model, backend, and worker pool.
Keep model loading separate from detection tasks
The worker owns the OpenCV DNN networks, model files, computation backend, and pool size. YoloDetectionTask instances borrow network instances from this pool, so several detection tasks can share the same loaded model.
Model pool
Creates 1-10 independent YOLO network instances and tracks wait time, processing time, throughput, and total processed count.
OpenCV backend
Uses the selected OpenCV DNN backend and target, such as CPU, CUDA, OpenCL, or OpenVINO when available in the runtime.
Class registry
Reads class names from config.names so detection tasks can offer an exact target-class selector.
Choose worker count for the real workload
Single camera on CPU
Start with workers=1, a tiny model, and a CPU backend/target pair. This is the safest baseline for low-power hosts where capture, motion detection, recording, and YOLO share the same CPU.
Several detection tasks sharing one model
Point multiple YoloDetectionTask instances to the same worker when they use the same model. Increase workers only when wait time grows and the host still has free CPU/GPU and memory.
Accelerated inference
Select CUDA, OpenCL, or OpenVINO only when the installed OpenCV/Bytedeco runtime, drivers, and hardware expose that pair. Test one worker first because extra GPU workers can increase VRAM pressure.
Throughput-first deployment
Use more workers when several cameras submit inference concurrently and the selected backend can run them in parallel. If processing time rises sharply after adding workers, the device is saturated.
Pick the model family and file layout that match latency and accuracy
model.onnx and config.names. ONNX is preferred automatically when present.config.cfg, config.weights, and config.names for Darknet model packages.Configuration parameters
| Parameter | Required | Description | Default |
|---|---|---|---|
Workers | Yes | Number of parallel YOLO inference instances in the pool. Allowed range is 1-10. | 1 |
Model | Yes | Model name from the yolo model registry, for example a YOLOv4 or tiny variant. | Registry default |
Computation configuration | Yes | Colon-separated OpenCV DNN backend and target pair, for example DNN_BACKEND_OPENCV:DNN_TARGET_CPU. | CPU pair |
Tune using worker statistics
Wait time means queue pressure
If requests spend time waiting for a free network, the pool is too small, the model is too slow, or detection tasks submit work too often.
Processing time means inference cost
If processing time increases when workers are added, the CPU, GPU, memory bandwidth, or VRAM is likely over-subscribed.
Each worker loads a network
Increasing workers can multiply native memory or GPU memory usage because every pool instance owns its own OpenCV DNN network.
Restart after model changes
Changing workers, subModelName, or computationConfig requires restart because the network pool must be rebuilt.