> For the complete documentation index, see [llms.txt](https://docs.augelab.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.augelab.com/function-blocks/blocks-reference/ai-blocks/object-detection-d-fine.md).

# Object Detection (D-FINE)

This function block performs real-time object detection on an input image. It lets you choose a model size (trade-off between speed and accuracy), filter which object classes to detect, set a confidence threshold, and optionally draw color-coded bounding boxes on the output image.

## 📥 Inputs <a href="#inputs" id="inputs"></a>

`Image` The image to analyze for object detections.

## 📤 Outputs <a href="#outputs" id="outputs"></a>

`Result` Annotated image with bounding boxes and labels (present if drawing is enabled).

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

`Labels` Class names for each detected object.

`Scores` Confidence score for each detection.

## 🕹️ Controls <a href="#controls" id="controls"></a>

`Model` Choose model size (examples: Nano / Small / Medium / Large / XLarge) to balance inference speed vs accuracy.

`Select Classes` Table to tick only the COCO classes you want the block to report (leave all unchecked to allow all classes).

`Draw Boxes` Toggle to enable/disable drawing colored bounding boxes and labels on the output image.

`Threshold` Slider to set the confidence score threshold (0–100) for accepting detections.

## 🎨 Features <a href="#features" id="features"></a>

* Model size selection to prioritize speed or accuracy.
* Class filtering so you only get detections you care about.
* Confidence threshold control to reduce false positives.
* Optional visual output with color-coded bounding boxes and readable labels.
* Returns both visual (image) and structured detection data (boxes, labels, scores) for downstream processing.

## 📝 Usage Instructions <a href="#usage" id="usage"></a>

1. Connect an image-producing block to the `Image` input.
2. Choose a `Model` size based on whether you need faster results or higher accuracy.
3. Use `Select Classes` to limit detection to only the object types you need (or leave empty to accept all).
4. Adjust the `Threshold` slider to tune detection sensitivity.
5. Enable `Draw Boxes` if you want a visual result returned on the `Result` output.
6. Use the `Boxes`, `Labels`, and `Scores` outputs in subsequent processing or logging blocks.

## 📊 Evaluation <a href="#evaluation" id="evaluation"></a>

When run, this block processes the incoming image according to the chosen `Model` and `Threshold` and outputs detections. If `Draw Boxes` is enabled, an annotated image will be available on `Result`; detection metadata is always available on the other outputs.

## 💡 Tips and Tricks <a href="#tips-and-tricks" id="tips-and-tricks"></a>

* If small objects are missed, try feeding a higher-detail input using `Super Resolution` or avoid downscaling the input with `Image Resize`.
* To reduce processing time, pick a smaller `Model` (Nano/Small) at the cost of some accuracy.
* Crop the area of interest before detection with `Image ROI Select` or `Image ROI` to improve speed and reduce false positives.
* For visual debugging, connect the `Result` output to `Show Image` so you can inspect detections interactively.
* If you need to keep detections across frames (tracking), combine outputs with `Object_Detection_Tracker`.
* Save frames with detections using `Image Logger`, `Image Write`, or `Record Video` for later review.
* Export detection metadata (boxes / labels / scores) with `CSV Export` or `Data to JSON` for analytics and reporting.
* When experimenting, monitor system usage with `GPU Statistics` to choose an appropriate `Model` size for your hardware.
* If you want different detection behavior or to try other models, compare outputs with `Object Detection - Custom` or other object detection alternatives.

## 🛠️ Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

* If you see no detections, lower the `Threshold` or make sure the desired class is checked in `Select Classes`.
* If detections are noisy, raise the `Threshold` or limit classes in `Select Classes`.
* If processing is too slow, choose a smaller `Model` or crop the input image using `Image ROI Select`.
* If the output image is empty while other outputs contain data, ensure `Draw Boxes` is enabled to get a visual result.
