Object Detection - Custom
This function block detects objects in images using custom model files you provide. It lets you load a detector (weights, config, and class list), choose which classes to detect, and control detection sensitivity with a simple slider. The block outputs an annotated image plus structured detection data for further processing.
π₯ Inputs
Image Any The image to be analyzed for object detections.
π€ Outputs
Image Any Annotated image with detection boxes and labels.
Object Count Number of detected objects.
Object Locations List of detected object center positions (multiple outputs allowed).
Object Sizes (w, h) Width and height for each detected object (multiple outputs allowed).
Object Class Class name for each detected object (multiple outputs allowed).
Rectangles Bounding rectangle coordinates for each detection (multiple outputs allowed).
πΉοΈ Controls
Open Weight File Button to choose the model weights file.
Open Config File Button to choose the model configuration file.
Open Class File Button to choose a text file listing class names.
Class Names Table where available classes are listed and you can enable/disable each class.
Confidence Threshold % Slider to set detection confidence sensitivity (higher = stricter).
βοΈ Running mechanism
The block requires three resources to run: a weight file, a config file, and a class list file. Load them using the three file buttons.
After the files are provided, the detector is initialized and remains ready until you change the files.
When an image is provided to the input, the block runs the detector on the image and outputs:
an annotated image with boxes/labels,
count and positions,
sizes, classes, and rectangle coordinates for each detection.
Changing weight or config files triggers reloading of the detector so new models are used for subsequent evaluations.
β¨ Features
Load-your-own model support (weights, config, and class list).
Select which classes to detect via an easy checklist.
Adjustable confidence threshold with immediate effect.
Outputs both visual results and structured data (counts, positions, sizes, rectangles).
Works with multiple detected objects and returns results in list form for downstream blocks.
π Usage instructions
Click
Open Weight Fileand select the model weight file.Click
Open Config Fileand select the model configuration file.Click
Open Class Fileand select the class names file. The class list will populate automatically.Enable only the classes you want to detect in the
Class Namestable.Adjust
Confidence Threshold %to balance sensitivity vs false positives.Provide the image to the
Image Anyinput and run the scenario to get annotated image and detection data.
π‘ Tips and Tricks
To preview results interactively, connect the
Image Anyoutput to theShow Imageblock.If input images are very large and detection is slow, insert
Image Resizerbefore this block to lower resolution and increase processing speed.Limit analysis to a specific area by using
Image ROIorImage ROI Selectupstream so the detector focuses only on regions of interest.For tracking detections across frames, link this blockβs detection outputs to
Object_Detection_Tracker.If you need custom drawing or overlays beyond the built-in annotations, use
Draw Detectionswith the detection rectangles and counts provided by this block.Save interesting frames with detections using
Image LoggerorImage Write/Record Videofor later review.Monitor performance and GPU usage with
GPU Statisticswhen running heavier models.
(hint: enable only required classes and increase the confidence threshold to reduce false positives and speed up post-processing)
π οΈ Troubleshooting
Missing model files: Ensure all three files (weight, config, class list) are selected. The block cannot run without them.
No detections: Try lowering
Confidence Threshold %or enable more classes in the class table. Also verify the class names file matches the model.Too many false detections: Increase
Confidence Threshold %and enable only the relevant classes to reduce noise.Slow performance: Reduce input image size with
Image Resizeror use smaller models; consider offloading to a GPU if available and monitor withGPU Statistics.Incorrect class names or mismatched files: Verify the class file corresponds to the loaded model (class order and names must match the model training).
π Recommended block combinations
Show Imageβ Preview annotation output.Image Resizerβ Speed up detection on large images.Image ROI/Image ROI Selectβ Focus detection on specific areas.Object_Detection_Trackerβ Track detected objects over time.Draw Detectionsβ Custom visualization using detection rectangles and counts.Image Logger/Image Write/Record Videoβ Save annotated results for audit or later analysis.
Last updated
Was this helpful?