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
Click
Open Weight Fileand select your detector weight file.Click
Open Config Fileand select the corresponding config file.Click
Open Class Fileand load the text file containing class names. TheClass Namestable will populate.Toggle the rows in
Class Namesto choose which classes you want to detect.Feed an image into the
Image Anyinput.Adjust
Confidence Threshold %to control how strict detections must be.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 Anyplus 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 Anyoutput to theShow Imageblock.To draw custom overlays or format detection annotations differently, use the
Draw Detectionsblock with theRectanglesand count outputs.For higher throughput on large images, insert
Image Resizerbefore 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 SelectorImage ROIbefore feeding the image.To keep a record of frames with detections, connect the annotated image output to
Image LoggerorImage Write.For continuous scenarios where you want to maintain identities across frames, pair this block with
Object_Detection_Trackerusing the detection rectangles and class outputs.If you need a quick alternative detector for experimentation, compare results with the
Object DetectionorObject 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 Fileagain if needed.
Detector reports too many false positives
Increase
Confidence Threshold %. Also try feeding a resized image viaImage Resizeror restrict the area viaImage 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—useImage Resizerto balance speed vs detail).
Slow performance on CPU
Reduce input resolution with
Image Resizeror crop the region of interest withImage 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 likeObject_Detection_Tracker.
Last updated
Was this helpful?