Object Detection - Custom

This function block enables custom object detection within images using a pre-trained model. Users can specify which classes of objects they wish to detect and set confidence thresholds for detection.

📥 Inputs

Image Any An input to feed the image data that will be processed for object detection.

📤 Outputs

Image Any The output image with detected objects highlighted.

Object Count The total count of detected objects in the input image.

Object Locations The list of coordinates for the detected objects.

Object Sizes (w, h) The dimensions of the detected objects.

Object Class The list of classes for the detected objects.

Rectangles The bounding rectangles around detected objects.

🕹️ Controls

Open Weight File A button to select the weight file needed for the object detection model.

Open Config File A button to select the configuration file for the model.

Open Class File A button to select the class names file which includes the object categories available for detection.

Confidence Threshold % A slider to set the confidence threshold for the detections, making it easy to fine-tune detection sensitivity.

Class Names Table A display for the class names available for detection, allowing users to select which classes to focus on.

🎨 Features

Customizable Detection Provides the flexibility to load different models and specify which classes to detect, allowing tailored use for various applications.

Real-time Detection The model processes the image and detects objects efficiently, with immediate visual feedback on the result.

Confidence Adjustment Users can adjust the confidence threshold via a slider to include or exclude detections based on confidence levels.

📝 Usage Instructions

  1. Load Model Files:

    • Click on Open Weight File to select the model's weight file.

    • Click on Open Config File to select the model's configuration file.

    • Click on Open Class File to select the file containing class names.

  2. Select Classes:

    • The class names loaded from the class file will appear in the Class Names Table. Select desired classes for detection.

  3. Adjust Confidence:

    • Use the Confidence Threshold % slider to set the desired detection threshold.

  4. Connect and Evaluate:

    • Connect an image to the input. The block will process the image and return the modified image displaying the detected objects.

📊 Evaluation

Once executed, this function block will output an annotated image, along with details about the detected objects, including their count, sizes, classes, and locations.

💡 Tips and Tricks

Using Custom Models

Ensure that the weight, config, and class files correspond to each other and are compatible with YOLOv4 model architecture to prevent loading errors.

Handling Multiple Objects

If detecting multiple objects from different classes, ensure your class file includes all the object classes of interest.

Tuning Detection Sensitivity

Adjust the Confidence Threshold % slider to manage detection sensitivity. Setting this too high might miss detections, while setting it too low may yield false detections.

🛠️ Troubleshooting

Model Not Loaded

If the model fails to load, ensure that the paths for the weight, config, and class files are correctly set and point to existing files.

No Detections Found

If no detections are returned, check if the classes selected correspond with the objects present in the input image. Adjust the confidence threshold as necessary.

Last updated