Detections Consensus¶
Class: DetectionsConsensusBlockV1
Source: inference.core.workflows.core_steps.fusion.detections_consensus.v1.DetectionsConsensusBlockV1
Combine detections from multiple detection-based models based on a majority vote strategy.
This block is useful if you have multiple specialized models that you want to consult to determine whether a certain object is present in an image.
See the table below to explore the values you can use to configure the consensus block.
Type identifier¶
Use the following identifier in step "type"
field: roboflow_core/detections_consensus@v1
to add the block as
as step in your workflow.
Properties¶
Name | Type | Description | Refs |
---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
required_votes |
int |
Required number of votes for single detection from different models to accept detection as output detection. | ✅ |
class_aware |
bool |
Flag to decide if merging detections is class-aware or only bounding boxes aware. | ✅ |
iou_threshold |
float |
IoU threshold to consider detections from different models as matching (increasing votes for region). | ✅ |
confidence |
float |
Confidence threshold for merged detections. | ✅ |
classes_to_consider |
List[str] |
Optional list of classes to consider in consensus procedure.. | ✅ |
required_objects |
Optional[Dict[str, int], int] |
If given, it holds the number of objects that must be present in merged results, to assume that object presence is reached. Can be selector to InferenceParameter , integer value or dictionary with mapping of class name into minimal number of merged detections of given class to assume consensus.. |
✅ |
presence_confidence_aggregation |
AggregationMode |
Mode dictating aggregation of confidence scores and classes both in case of object presence deduction procedure.. | ❌ |
detections_merge_confidence_aggregation |
AggregationMode |
Mode dictating aggregation of confidence scores and classes both in case of boxes consensus procedure. One of average , max , min . Default: average . While using for merging overlapping boxes, against classes - average equals to majority vote, max - for the class of detection with max confidence, min - for the class of detection with min confidence.. |
❌ |
detections_merge_coordinates_aggregation |
AggregationMode |
Mode dictating aggregation of bounding boxes. One of average , max , min . Default: average . average means taking mean from all boxes coordinates, min - taking smallest box, max - taking largest box. This mode is not used for masks aggregation.. |
❌ |
detections_merge_mask_aggregation |
MaskAggregationMode |
Mode dictating aggregation of masks. One of union , intersection , max , min . Default: union . union means taking union of all masks, intersection - taking intersection of all masks, max - taking largest mask, min - taking smallest mask.. |
❌ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow
runtime. See Bindings for more info.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to Detections Consensus
in version v1
.
- inputs:
Anthropic Claude
,Line Counter
,Line Counter
,PTZ Tracking (ONVIF)
.md),Image Contours
,Google Gemini
,VLM as Classifier
,Object Detection Model
,Dynamic Zone
,Keypoint Detection Model
,Byte Tracker
,Detections Consensus
,Detections Filter
,Roboflow Custom Metadata
,Qwen2.5-VL
,Object Detection Model
,Bounding Rectangle
,JSON Parser
,Detections Transformation
,Clip Comparison
,SmolVLM2
,LMM
,YOLO-World Model
,Size Measurement
,Perspective Correction
,Moondream2
,Buffer
,Florence-2 Model
,Template Matching
,Velocity
,Webhook Sink
,Distance Measurement
,VLM as Detector
,Pixel Color Count
,Segment Anything 2 Model
,Keypoint Detection Model
,Slack Notification
,Detections Stabilizer
,Byte Tracker
,Path Deviation
,SIFT Comparison
,Overlap Filter
,Gaze Detection
,VLM as Detector
,Llama 3.2 Vision
,Time in Zone
,Instance Segmentation Model
,Google Vision OCR
,VLM as Classifier
,Roboflow Dataset Upload
,CogVLM
,Byte Tracker
,Identify Outliers
,Roboflow Dataset Upload
,Detection Offset
,OpenAI
,Time in Zone
,Email Notification
,Local File Sink
,OpenAI
,Detections Classes Replacement
,Detections Merge
,Florence-2 Model
,OpenAI
,Path Deviation
,Model Monitoring Inference Aggregator
,Twilio SMS Notification
,Instance Segmentation Model
,SIFT Comparison
,Dimension Collapse
,Detections Stitch
,Identify Changes
,Clip Comparison
,Dynamic Crop
- outputs:
Crop Visualization
,Stitch OCR Detections
,Line Counter
,Line Counter
,Blur Visualization
,PTZ Tracking (ONVIF)
.md),Line Counter Visualization
,Color Visualization
,Mask Visualization
,Circle Visualization
,Object Detection Model
,Dynamic Zone
,Multi-Label Classification Model
,Keypoint Detection Model
,Byte Tracker
,Detections Consensus
,Stitch Images
,Detections Filter
,Trace Visualization
,Roboflow Custom Metadata
,Object Detection Model
,Bounding Rectangle
,Detections Transformation
,Polygon Zone Visualization
,YOLO-World Model
,Size Measurement
,Halo Visualization
,Perspective Correction
,Florence-2 Model
,Stability AI Inpainting
,Template Matching
,Velocity
,Label Visualization
,Webhook Sink
,Distance Measurement
,Segment Anything 2 Model
,Stability AI Image Generation
,Triangle Visualization
,Keypoint Detection Model
,Background Color Visualization
,Slack Notification
,Detections Stabilizer
,Relative Static Crop
,Corner Visualization
,Byte Tracker
,Path Deviation
,Multi-Label Classification Model
,Icon Visualization
,Overlap Filter
,Pixelate Visualization
,Gaze Detection
,Model Comparison Visualization
,Time in Zone
,Instance Segmentation Model
,Reference Path Visualization
,Image Slicer
,Roboflow Dataset Upload
,Byte Tracker
,Identify Outliers
,Roboflow Dataset Upload
,Detection Offset
,Single-Label Classification Model
,Classification Label Visualization
,Polygon Visualization
,Keypoint Visualization
,Stability AI Outpainting
,Dot Visualization
,Time in Zone
,Email Notification
,Single-Label Classification Model
,Bounding Box Visualization
,Detections Classes Replacement
,Ellipse Visualization
,Detections Merge
,Florence-2 Model
,Path Deviation
,Model Monitoring Inference Aggregator
,Twilio SMS Notification
,Instance Segmentation Model
,SIFT Comparison
,Image Slicer
,Detections Stitch
,Identify Changes
,Dynamic Crop
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Detections Consensus
in version v1
has.
Bindings
-
input
predictions_batches
(Union[object_detection_prediction
,instance_segmentation_prediction
,keypoint_detection_prediction
]): Reference to detection-like model predictions made against single image to agree on model consensus.required_votes
(integer
): Required number of votes for single detection from different models to accept detection as output detection.class_aware
(boolean
): Flag to decide if merging detections is class-aware or only bounding boxes aware.iou_threshold
(float_zero_to_one
): IoU threshold to consider detections from different models as matching (increasing votes for region).confidence
(float_zero_to_one
): Confidence threshold for merged detections.classes_to_consider
(list_of_values
): Optional list of classes to consider in consensus procedure..required_objects
(Union[dictionary
,integer
]): If given, it holds the number of objects that must be present in merged results, to assume that object presence is reached. Can be selector toInferenceParameter
, integer value or dictionary with mapping of class name into minimal number of merged detections of given class to assume consensus..
-
output
predictions
(Union[object_detection_prediction
,instance_segmentation_prediction
]): Prediction with detected bounding boxes in form of sv.Detections(...) object ifobject_detection_prediction
or Prediction with detected bounding boxes and segmentation masks in form of sv.Detections(...) object ifinstance_segmentation_prediction
.object_present
(Union[boolean
,dictionary
]): Boolean flag ifboolean
or Dictionary ifdictionary
.presence_confidence
(Union[float_zero_to_one
,dictionary
]):float
value in range[0.0, 1.0]
iffloat_zero_to_one
or Dictionary ifdictionary
.
Example JSON definition of step Detections Consensus
in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/detections_consensus@v1",
"predictions_batches": [
"$steps.a.predictions",
"$steps.b.predictions"
],
"required_votes": 2,
"class_aware": true,
"iou_threshold": 0.3,
"confidence": 0.1,
"classes_to_consider": [
"a",
"b"
],
"required_objects": 3,
"presence_confidence_aggregation": "max",
"detections_merge_confidence_aggregation": "min",
"detections_merge_coordinates_aggregation": "min",
"detections_merge_mask_aggregation": "union"
}