Object Detection
The Object Detection node enables detection of objects within images using ONNX models. It supports a wide range of architectures, including DETR and YOLO, and accepts image data in multiple formats such as Buffers, base64 strings, or tensors.
This node is ideal for computer vision use cases like identifying objects in images, counting items, or performing scene analysis directly within Node-RED.
Inputs
General
- Property: input
- Type: object,buffer,stringor tensor.
- Description: The input image or tensor to classify. See the Details section for supported formats.
Model Selection
- model: Path to a local ONNX model file or the name of a model to download from Hugging Face.
- type: Data type for the model when using a model name. Supported values include q8(default),fp16,fp32,int8, and others.
Note: When a model name is provided, the node automatically downloads and caches it locally if it is not already available.
Configuration
- threshold: Minimum confidence score (0.0–1.0) required for a prediction to be included in the output. This can also be passed dynamically via msg.threshold.
Outputs
- payload: Contains the detection results. Depending on the model type and processing support, the output can be an array or an object.
Details
Supported Input Formats
The node supports multiple input formats depending on the model’s requirements:
- 
Buffer — Binary image data, typically from a file or camera input. 
- 
Base64 string — Base64-encoded image data. 
- 
Jimp Image Object — An image object (e.g, output from node-red-contrib-image-tools).
- 
Tensor — A pre-processed tensor object in the following format: {
 "data": [0.0, 0.1, 0.2, ...],
 "type": "float32",
 "dim": [1, 3, 224, 224]
 }
TIP: If the model supports batching, the input can be an array of images in one of the supported formats.
Model Selection
The model property defines which ONNX model to use. You can either:
- Provide a local path (for example, /data/models/yolov5.onnx), or
- Specify a model name available on Hugging Face (for example, Xenova/detr-resnet-50).
When a model name is provided, it is automatically fetched and cached locally for reuse.
Model Type Options
- auto— Automatically selects the most suitable type.
- fp32— Standard 32-bit floating-point model.
- fp16— Half-precision 16-bit floating-point model.
- int8— 8-bit integer quantized model.
- uint8— 8-bit unsigned integer model.
- q8— Quantized Int8 model (default).
- q4— Quantized Int4 model.
- q4f16— Quantized Int4 with Float16 model.
- bnb4— BNB4 quantized model.
Output Format
When Supported (YOLO/DETR Models)
If the model output is recognized by the node, msg.payload contains structured detection results:
[
  {
    "label": "dog",
    "score": 0.9796,
    "bbox": [130, 218, 309, 538]
  },
  {
    "label": "person",
    "score": 0.9451,
    "bbox": [420, 110, 640, 520]
  }
]Each object includes:
- label: Detected class name (for example, dog, person, car)
- score: Confidence score for the detection
- bbox: Bounding box coordinates [x_min, y_min, x_max, y_max]
When Not Supported (Raw Output)
If the node cannot interpret the model output automatically, it returns the raw response:
{
  "result": [...],
  "labels": {
    "0": "person",
    "1": "bicycle",
    "2": "car"
  }
}You can then use a Function node for custom post-processing.
Notes
- The node currently supports DETR and YOLO-style object detection models.
- YOLO models currently accept only single-image input (batching support will be added in future releases).
- Ensure that your model is compatible with ONNX Runtime and designed for object detection tasks.
- For improved performance on devices with limited resources, use quantized models such as q8.