Object Detection - Custom (CPU)

This function block lets you run a custom object detector on an input image using your own weight, config and class files. Use the provided controls to load model files, choose which classes to detect, and set the confidence threshold. The block returns a visual result image as well as structured detection data (counts, locations, sizes and labels) for downstream use.

📥 Inputs

Image Any Image to be processed by the custom detector.

📤 Outputs

Image Any Annotated image with detections (boxes/labels) drawn.

Object Count Number of detected objects in the frame.

Object Locations Center positions of detected objects (multiple).

Object Sizes (w, h) Width and height of each detected object (multiple).

Object Class Detected class names (multiple).

Rectangles Bounding rectangle coordinates for each detection (multiple).

🕹️ Controls

Open Weight File Button to load the detector weight file (e.g., .weights).

Open Config File Button to load the detector configuration file (e.g., .cfg).

Open Class File Button to load the class names file (plain text list). After loading, class names populate the class table.

Class Names A table showing available classes. Toggle rows to select which classes the detector should report.

Confidence Threshold % Slider to set minimum confidence for reported detections. Raise the value to reduce false positives; lower it to capture weaker detections.

🎯 Features

  • Easy loading of custom model resources via UI buttons.

  • Selectable subset of classes to focus detection on relevant objects.

  • Returns both visual and data outputs: annotated image, counts, positions, sizes, class labels and rectangles.

  • CPU-compatible operation for systems without GPU.

📝 Usage Instructions

  1. Click Open Weight File and select your detector weight file.

  2. Click Open Config File and select the corresponding config file.

  3. Click Open Class File and load the text file containing class names. The Class Names table will populate.

  4. Toggle the rows in Class Names to choose which classes you want to detect.

  5. Feed an image into the Image Any input.

  6. Adjust Confidence Threshold % to control how strict detections must be.

  7. Read output values or connect subsequent blocks to react to detections.

📊 What the block does when run

  • Processes the input image with the loaded detector using the selected classes and confidence threshold.

  • Produces an annotated image on Image Any plus detection data on the other outputs for counting, measurement, tracking, logging or decision-making.

💡 Tips and Tricks

  • If you want to visually inspect results in a larger window, connect the Image Any output to the Show Image block.

  • To draw custom overlays or format detection annotations differently, use the Draw Detections block with the Rectangles and count outputs.

  • For higher throughput on large images, insert Image Resizer before this block to reduce image resolution—this often speeds up detection with small effect on accuracy.

  • Limit the search area to speed up and stabilize results by cropping with Image ROI Select or Image ROI before feeding the image.

  • To keep a record of frames with detections, connect the annotated image output to Image Logger or Image Write.

  • For continuous scenarios where you want to maintain identities across frames, pair this block with Object_Detection_Tracker using the detection rectangles and class outputs.

  • If you need a quick alternative detector for experimentation, compare results with the Object Detection or Object Detection (D-FINE) blocks (if available) to find the best trade-off between speed and quality.

🛠️ Troubleshooting

  • No classes listed after loading class file

    • Make sure you selected the correct class file (plain text with one class per line). Use Open Class File again if needed.

  • Detector reports too many false positives

    • Increase Confidence Threshold %. Also try feeding a resized image via Image Resizer or restrict the area via Image ROI Select.

  • Detector misses small or distant objects

    • Lower Confidence Threshold % carefully, or pass a higher-resolution image to the block (avoid extremely large sizes—use Image Resizer to balance speed vs detail).

  • Slow performance on CPU

    • Reduce input resolution with Image Resizer or crop the region of interest with Image ROI Select. Consider running detection less frequently (e.g., batch processing).

  • Need to act on detections in other parts of the flow

    • Use the numeric and structured outputs (Object Count, Object Locations, Rectangles, Object Class) to feed logic blocks, logging blocks or tracking blocks like Object_Detection_Tracker.

Last updated

Was this helpful?