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.. |
❌ |
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:
Time in Zone
,Detections Stitch
,Path Deviation
,Florence-2 Model
,Keypoint Detection Model
,Gaze Detection
,Line Counter
,Instance Segmentation Model
,Keypoint Detection Model
,SIFT Comparison
,Object Detection Model
,Perspective Correction
,Local File Sink
,Line Counter
,Detections Filter
,YOLO-World Model
,Model Monitoring Inference Aggregator
,VLM as Classifier
,VLM as Detector
,Dimension Collapse
,Google Vision OCR
,Twilio SMS Notification
,Detections Consensus
,Email Notification
,Webhook Sink
,Byte Tracker
,Roboflow Custom Metadata
,Size Measurement
,Detections Classes Replacement
,Instance Segmentation Model
,Template Matching
,OpenAI
,Detection Offset
,Buffer
,Roboflow Dataset Upload
,Roboflow Dataset Upload
,VLM as Classifier
,Slack Notification
,Clip Comparison
,Identify Changes
,SIFT Comparison
,Anthropic Claude
,Dynamic Zone
,CogVLM
,Google Gemini
,Segment Anything 2 Model
,Clip Comparison
,Image Contours
,JSON Parser
,Byte Tracker
,Time in Zone
,Identify Outliers
,Florence-2 Model
,LMM
,Detections Stabilizer
,Path Deviation
,VLM as Detector
,OpenAI
,Byte Tracker
,Pixel Color Count
,Llama 3.2 Vision
,Bounding Rectangle
,Detections Transformation
,Object Detection Model
,Distance Measurement
- outputs:
Path Deviation
,Pixelate Visualization
,Multi-Label Classification Model
,Stitch Images
,Keypoint Detection Model
,Line Counter
,Gaze Detection
,Instance Segmentation Model
,Blur Visualization
,Single-Label Classification Model
,Mask Visualization
,Object Detection Model
,Line Counter
,Detections Filter
,YOLO-World Model
,Model Monitoring Inference Aggregator
,Polygon Visualization
,Halo Visualization
,Model Comparison Visualization
,Email Notification
,Byte Tracker
,Keypoint Visualization
,Detections Classes Replacement
,Template Matching
,Detection Offset
,Roboflow Dataset Upload
,Slack Notification
,Stitch OCR Detections
,Identify Changes
,Relative Static Crop
,Background Color Visualization
,Bounding Box Visualization
,Ellipse Visualization
,Label Visualization
,Classification Label Visualization
,Line Counter Visualization
,Byte Tracker
,Reference Path Visualization
,Dynamic Crop
,Byte Tracker
,Triangle Visualization
,Object Detection Model
,Distance Measurement
,Time in Zone
,Florence-2 Model
,Detections Stitch
,SIFT Comparison
,Keypoint Detection Model
,Corner Visualization
,Perspective Correction
,Polygon Zone Visualization
,Trace Visualization
,Size Measurement
,Detections Consensus
,Twilio SMS Notification
,Webhook Sink
,Roboflow Custom Metadata
,Image Slicer
,Crop Visualization
,Instance Segmentation Model
,Roboflow Dataset Upload
,Dot Visualization
,Circle Visualization
,Segment Anything 2 Model
,Single-Label Classification Model
,Identify Outliers
,Time in Zone
,Florence-2 Model
,Detections Stabilizer
,Path Deviation
,Color Visualization
,Multi-Label Classification Model
,Detections Transformation
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[instance_segmentation_prediction
,keypoint_detection_prediction
,object_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
(object_detection_prediction
): Prediction with detected bounding boxes in form of sv.Detections(...) object.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"
}