Object Detection (D-FINE)

This function block performs real-time object detection on images using a configurable D-FINE model. It is designed for easy visual inspection and filtering of detected objects, letting you balance speed and accuracy through simple UI controls.

πŸ“₯ Inputs (sockets)

Image Provide the image you want to analyze. Accepts color or grayscale images.

πŸ“€ Outputs (sockets)

Result Annotated image with bounding boxes and labels (if Draw Boxes is enabled).

Boxes List of bounding box coordinates for each detection (format: [x1,y1,x2,y2]).

Labels List of detected class names for each detection.

Scores List of confidence scores for each detection.

πŸ•ΉοΈ Controls

Model Choose the D-FINE model size. Options trade off speed vs. accuracy (examples: Nano β€” fastest, Small β€” balanced, XLarge β€” best accuracy).

Select Classes Pick which object classes to keep. If none selected, the block will report all detected classes.

Draw Boxes Toggle visualization of bounding boxes and labels on the output image.

Score Thresh Set the confidence threshold (0–100) used to filter detections. Higher values reduce low-confidence detections.

🎯 Features

  • Multiple model sizes for speed/accuracy tuning via the Model control.

  • Class filtering so you only receive results for classes that matter to your scenario.

  • Optional on-image visualization using the Draw Boxes control with clear color-coded boxes and labels.

  • Outputs provide both visual feedback (Result) and structured data (Boxes, Labels, Scores) for downstream processing.

πŸ“ How to use

  1. Provide an image into the Image socket.

  2. Choose a model with Model depending on your performance needs.

  3. Optionally pick specific classes using Select Classes to reduce irrelevant detections.

  4. Set Score Thresh to filter out low-confidence detections.

  5. Enable Draw Boxes if you want a visual preview on the Result output.

  6. Use the outputs (Boxes, Labels, Scores) to drive further logic or logging.

πŸ“Š What happens when it runs

When executed, the block analyzes the provided image and returns: an annotated preview image (optional), a list of bounding boxes, the corresponding class names, and confidence scores filtered by the chosen threshold and selected classes.

πŸ’‘ Tips and Tricks

  • For visual checks, connect the Result output to the Show Image block to preview detections in a larger viewer (use the Show Image block).

  • If the input images are very large, add Image Resizer or Image Resizer block before this block to speed up inference and reduce memory usage.

  • For small or distant objects, try higher-accuracy models (select via Model) but expect slower processing. For live or low-latency applications prefer faster models like Nano or Small.

  • To focus detection on a region, crop the input with Image ROI Select or Image ROI before feeding the image. This reduces false positives and speeds up detection.

  • If you want to track detections across frames, send Boxes / Labels to Object_Detection_Tracker to obtain stable IDs and tracking history.

  • For clearer visuals or multi-step pipelines, route Result into Draw Detections or into Image Logger / Image Write to save annotated frames for audits.

  • Combine with Image Resizer and Blur/Contrast blocks for preprocessing to improve detection stability under difficult lighting or noisy scenes.

πŸ› οΈ Troubleshooting

  • No detections: lower the Score Thresh slightly and ensure the object class is included in Select Classes. Also verify the input image is clear and focused.

  • Many false positives: increase the Score Thresh and restrict Select Classes to the classes you care about. Cropping the area of interest with Image ROI Select also helps.

  • Slow performance or high memory use: pick a smaller Model, reduce image size with Image Resizer, or skip visualization by turning off Draw Boxes.

  • Inconsistent detections across frames: use Object_Detection_Tracker to stabilize results and obtain persistent IDs.

If you need to preserve results for later review, connect Boxes/Labels/Scores to logging or export blocks such as Image Logger, Image Write, or CSV Export.

Last updated

Was this helpful?