Skip to content

Detections Stitch

Version v1

This block merges detections that were inferred for multiple sub-parts of the same input image into single detection.

Block may be helpful in the following scenarios: * to apply Slicing Adaptive Inference (SAHI) technique, as a final step of procedure, which involves Image Slicer block and model block at previous stages. * to merge together detections performed by precise, high-resolution model applied as secondary model after coarse detection is performed in the first stage and Dynamic Crop is applied later.

Type identifier

Use the following identifier in step "type" field: roboflow_core/detections_stitch@v1to add the block as as step in your workflow.

Properties

Name Type Description Refs
name str The unique name of this step..
overlap_filtering_strategy str Which strategy to employ when filtering overlapping boxes. None does nothing, NMS discards surplus detections, NMM merges them..
iou_threshold float Parameter of overlap filtering strategy. If box intersection over union is above this ratio, discard or merge the lower confidence box..

The Refs column marks possibility to parametrise the property with dynamic values available in workflow runtime. See Bindings for more info.

Available Connections

Check what blocks you can connect to Detections Stitch in version v1.

The available connections depend on its binding kinds. Check what binding kinds Detections Stitch in version v1 has.

Bindings
  • input

    • reference_image (image): Image that was origin to take crops that yielded predictions..
    • predictions (Union[object_detection_prediction, instance_segmentation_prediction]): The output of a detection model describing the bounding boxes to be merged..
    • overlap_filtering_strategy (string): Which strategy to employ when filtering overlapping boxes. None does nothing, NMS discards surplus detections, NMM merges them..
    • iou_threshold (float_zero_to_one): Parameter of overlap filtering strategy. If box intersection over union is above this ratio, discard or merge the lower confidence box..
  • output

    • predictions (Union[object_detection_prediction, instance_segmentation_prediction]): Prediction with detected bounding boxes in form of sv.Detections(...) object if object_detection_prediction or Prediction with detected bounding boxes and segmentation masks in form of sv.Detections(...) object if instance_segmentation_prediction.
Example JSON definition of step Detections Stitch in version v1
{
    "name": "<your_step_name_here>",
    "type": "roboflow_core/detections_stitch@v1",
    "reference_image": "$inputs.image",
    "predictions": "$steps.my_object_detection_model.predictions",
    "overlap_filtering_strategy": "nms",
    "iou_threshold": 0.4
}