Ultralytics YOLO supports a wide range of models, from early versions like YOLOv3 to the latest YOLO11.
This component has undergone limited testing. In addition to partial functional testing, only the following models have been confirmed to work: yolov5mu.pt, yolov8n, and yolo11s.pt
yolo
component uses the official ultralytics
python package. A GPU is used when available.
Models are not installed by default. See below for steps to define the model as well as make them available to Viseron.
Configuration
Configuration example
/config/config.yaml
yolo:
object_detector:
model_path: /detectors/models/yolo/my_model.pt
cameras:
viseron_camera1:
fps: 1
scan_on_motion_only: true
log_all_objects: false
labels:
- label: dog
confidence: 0.7
trigger_event_recording: false
- label: cat
confidence: 0.8
Object detector domain config.
Camera-specific configuration. All subordinate keys corresponds to the camera_identifier
of a configured camera.
Camera identifier. Valid characters are lowercase a-z, numbers and underscores.
The FPS at which the object detector runs.
Higher values will result in more scanning, which uses more resources.
When set to true
and a motion_detector
is configured, the object detector will only scan while motion is detected.
A list of labels (objects) to track.
Lowest confidence allowed for detected objects. The lower the value, the more sensitive the detector will be, and the risk of false positives will increase.
Lowest value: 0
Highest value: 1
Minimum height allowed for detected objects, relative to stream height.
Lowest value: 0
Highest value: 1
Maximum height allowed for detected objects, relative to stream height.
Lowest value: 0
Highest value: 1
Minimum width allowed for detected objects, relative to stream width.
Lowest value: 0
Highest value: 1
Maximum width allowed for detected objects, relative to stream width.
Lowest value: 0
Highest value: 1
DEPRECATED. Use trigger_event_recording
instead.
If set to true
, objects matching this filter will start the recorder.
If set to true
, objects matching this filter will trigger an event recording.
If set to true
, objects matching this filter will be stored in the database, as well as having a snapshot saved. Labels with trigger_event_recording
set to true
will always be stored when a recording starts, regardless of this setting.
The interval at which the label should be stored in the database, in seconds. If set to 0, the label will be stored every time it is detected.
If set to true
, the recorder will stop as soon as motion is no longer detected, even if the object still is. This is useful to avoid never ending recordings of stationary objects, such as a car on a driveway
Drop frames that are older than the given number. Specified in seconds.
When set to true and loglevel is DEBUG
, all found objects will be logged, including the ones not tracked by labels
.
A mask is used to exclude certain areas in the image from object detection.
List of X and Y coordinates to form a polygon
X-coordinate (horizontal axis).
Y-coordinate (vertical axis).
Zones are used to define areas in the cameras field of view where you want to look for certain objects (labels).
Name of the zone. Has to be unique per camera.
List of X and Y coordinates to form a polygon
X-coordinate (horizontal axis).
Y-coordinate (vertical axis).
A list of labels (objects) to track.
Lowest confidence allowed for detected objects. The lower the value, the more sensitive the detector will be, and the risk of false positives will increase.
Lowest value: 0
Highest value: 1
Minimum height allowed for detected objects, relative to stream height.
Lowest value: 0
Highest value: 1
Maximum height allowed for detected objects, relative to stream height.
Lowest value: 0
Highest value: 1
Minimum width allowed for detected objects, relative to stream width.
Lowest value: 0
Highest value: 1
Maximum width allowed for detected objects, relative to stream width.
Lowest value: 0
Highest value: 1
DEPRECATED. Use trigger_event_recording
instead.
If set to true
, objects matching this filter will start the recorder.
If set to true
, objects matching this filter will trigger an event recording.
If set to true
, objects matching this filter will be stored in the database, as well as having a snapshot saved. Labels with trigger_event_recording
set to true
will always be stored when a recording starts, regardless of this setting.
The interval at which the label should be stored in the database, in seconds. If set to 0, the label will be stored every time it is detected.
If set to true
, the recorder will stop as soon as motion is no longer detected, even if the object still is. This is useful to avoid never ending recordings of stationary objects, such as a car on a driveway
Path to a YOLO model.More information
here.
Minimum confidence to consider a detection.
This minimum is enforced during inference before being filtered by values in labels
Lowest value: 0
Highest value: 1
Intersection Over Union (IoU) threshold for Non-Maximum Suppression (NMS).
Lowest value: 0
Highest value: 1
Enable/disable half precision accuracy.
If your GPU supports FP16, enabling this might give you a performance increase.
Specifies the device for inference (e.g., cpu, cuda:0 or 0).
Pre-trained models
These steps should assist in locating models, configuring your container to access them, and configuring Viseron to use them.
Finding models
Pre-trained YOLO models can be found online or you can train them yourself.
Examples of where to find pre-trained models:
There are models for many different tasks, including object detection. If you are not sure if there is a problem with Viseron please confirm your
Viseron environment with a stock YOLO model from Ultralytics. For example: yolov8n.pt
This component does not provide any training capabilities. See the Ultralytics training documentation for more information.
Where to place models
Place your YOLO models in a directory of your choice.
There will be a later step to map the directory to the container. Therefore, choose a location supported by docker compose. If in doubt, do not use a SMB or NFS share.
Configuring Docker to make models available to Viseron
The following docker-compose.yaml
snippet will show how to map the directory above to the container:
/docker-compose.yaml
volumes:
- {models path}:/detectors/models/yolo
This is the only change to docker-compose.yaml
required for this component.
Configuring Viseron to use a model
Modify the model_path
setting in your Viseron config.yaml
to point to one of the model(s) you installed. See the example above.
Only one model can be used at a time.
Image resizing
Images inferenced by the component are resized by the underlying ultralytics
package to match the model's input size.
There is no functionality to resize the image in the yolo
component configuration before inferencing.
Labels
When Viseron loads the model, it will print that model's labels to the log.
cd {location of Viseron docker-compose.yaml}
docker compose logs | grep "Labels"
viseron | 2025-05-29 08:19:04.943 [INFO ] [viseron.components.yolo.object_detector] - Labels: {0: 'bicycle', 1: 'bird', 2: 'bus', 3: 'car', 4: 'cat', 5: 'dog', 6: 'motorcycle', 7: 'person', 8: 'truck', 9: 'squirrel', 10: 'car-light', 11: 'rabbit', 12: 'fox', 13: 'opossum', 14: 'skunk', 15: 'racoon'}
Troubleshooting
To enable debug logging for
yolo
, add the following to your
config.yaml
/config/config.yaml
logger:
logs:
viseron.components.yolo: debug