DetectorYolo¶
processing extra: detector-yolo
Annotate frames using YOLO models. For more info about the models, see here: https://github.com/ultralytics/ultralytics
Note
The detector-yolo extra installs ultralytics, which is distributed under
the AGPL-3.0 license, unlike juturna-nodes (MIT). Check that its terms are
compatible with your use before installing it.
- Node type:
DetectorYolo- Input:
ImagePayload- Output:
ImagePayload- Extra:
detector-yolo
$ pip install "juturna-nodes[detector-yolo]"
License¶
This node needs the detector-yolo extra, which installs
ultralytics. Ultralytics is
distributed under the AGPL-3.0 license, unlike juturna-nodes (MIT): check that
its terms are compatible with your use before installing it.
The YOLO weights (such as the default yolo11n.pt, which ultralytics
downloads from the releases of
ultralytics/assets) are AGPL-3.0
as well: that repository is AGPL-3.0, and the
Ultralytics/YOLO11 model card
declares agpl-3.0. Ultralytics also sells an Enterprise License that
lifts the AGPL-3.0 terms for its software and models
(ultralytics README).
The detector-yolo extra also installs PyTorch (BSD-3-Clause, its LICENSE
file) and opencv-python (Apache-2.0, its license on PyPI), which
ultralytics depends on.
Detect objects in frames with an Ultralytics YOLO model, and transmit the frame with the boxes drawn on it.
Role: processing
Node type:
DetectorYoloInput:
ImagePayloadOutput:
ImagePayload, the annotated frameExtra:
detector-yolo(pip install "juturna-nodes[detector-yolo]"), AGPL-3.0
How it works¶
On warmup the node loads model with ultralytics (a name such as
yolo11n.pt is downloaded by ultralytics on first use), moves it to
device, and runs it once on a black 640x640 image, so that the first real
frame does not pay the CUDA initialisation.
For every frame, the node runs one prediction restricted to the targets
classes and to scores of at least confidence, draws the result on the frame
with ultralytics (Results.plot()), and transmits the drawn frame with the
detections in meta. There is no tracking across frames: each frame is
detected on its own.
When the upstream stream stops, the node simply receives no more frames: it keeps no state between frames and transmits nothing on its own.
Arguments¶
Argument |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Ultralytics model name or path |
|
|
|
|
|
|
|
Class names to detect; a name the model does not know fails the warmup |
|
|
|
Minimum score of a detection |
|
|
|
Half precision ( |
Input message¶
Field |
Use |
|---|---|
|
RGB |
|
Copied to the output |
Output message¶
The same version and timers as the input, and:
Field |
Content |
|---|---|
|
The RGB frame with boxes and labels drawn by ultralytics |
|
Size of the drawn frame |
|
Copied from the input |
|
List of |
|
The ultralytics |
Limits¶
meta['annotations']cannot be serialised to JSON as it is.When frames come faster than the model, they queue up: limit them at the source (for example with the
fpsargument ofVideoCapture).
Configuration¶
Default node arguments, as defined in the node config.toml file. Any of
them can be overridden in the node configuration of a pipeline.
[arguments]
model = "yolo11n.pt"
device = "cpu"
targets = ["person"]
confidence = 0.25
half = true
[meta]
Pipeline usage¶
{
"name": "detector_yolo",
"type": "DetectorYolo",
"configuration": {}
}
Reference¶
- class DetectorYolo(
- model: str,
- device: str,
- targets: list,
- confidence: float,
- half: bool,
- **kwargs,
Node implementation class