Expression¶
Creates specific output based on defined input variables and configured rules - which is useful while creating business logic in workflows.
Based on configuration, block takes input data, optionally performs operation on data, save it as variables and evaluate switch-case like statements to get the final result.
Type identifier¶
Use the following identifier in step "type"
field: roboflow_core/expression@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.. | ❌ |
data_operations |
Dict[str, List[Union[ClassificationPropertyExtract, ConvertDictionaryToJSON, ConvertImageToBase64, ConvertImageToJPEG, DetectionsFilter, DetectionsOffset, DetectionsPropertyExtract, DetectionsRename, DetectionsSelection, DetectionsShift, DetectionsToDictionary, Divide, ExtractDetectionProperty, ExtractImageProperty, LookupTable, Multiply, NumberRound, NumericSequenceAggregate, RandomNumber, SequenceAggregate, SequenceApply, SequenceLength, SequenceMap, SortDetections, StringMatches, StringSubSequence, StringToLowerCase, StringToUpperCase, ToBoolean, ToNumber, ToString]]] |
UQL definitions of operations to be performed on defined data before switch-case instruction. | ❌ |
switch |
CasesDefinition |
Definition of switch-case statement. | ❌ |
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 Expression
in version v1
.
- inputs:
Multi-Label Classification Model
,Line Counter
,Reference Path Visualization
,Data Aggregator
,OpenAI
,Single-Label Classification Model
,LMM For Classification
,OCR Model
,Roboflow Dataset Upload
,Stability AI Inpainting
,Absolute Static Crop
,Trace Visualization
,Path Deviation
,Byte Tracker
,Halo Visualization
,Instance Segmentation Model
,SIFT
,SIFT Comparison
,Email Notification
,Anthropic Claude
,Pixelate Visualization
,Path Deviation
,Classification Label Visualization
,Mask Visualization
,Background Color Visualization
,Crop Visualization
,Relative Static Crop
,VLM as Classifier
,Google Gemini
,Image Contours
,JSON Parser
,Detections Filter
,Gaze Detection
,Byte Tracker
,Image Threshold
,Roboflow Custom Metadata
,Cache Set
,Keypoint Detection Model
,Multi-Label Classification Model
,YOLO-World Model
,Template Matching
,Byte Tracker
,Instance Segmentation Model
,Distance Measurement
,Florence-2 Model
,CogVLM
,LMM
,Size Measurement
,Stitch OCR Detections
,Object Detection Model
,Roboflow Dataset Upload
,Camera Focus
,Identify Changes
,Continue If
,Keypoint Visualization
,Label Visualization
,Cache Get
,Polygon Zone Visualization
,Model Monitoring Inference Aggregator
,Pixel Color Count
,Dynamic Zone
,Object Detection Model
,Triangle Visualization
,Local File Sink
,Barcode Detection
,Single-Label Classification Model
,Clip Comparison
,Ellipse Visualization
,Detections Stitch
,Identify Outliers
,First Non Empty Or Default
,Detections Classes Replacement
,Slack Notification
,Clip Comparison
,Image Blur
,Twilio SMS Notification
,Detections Transformation
,Dot Visualization
,Model Comparison Visualization
,VLM as Detector
,SIFT Comparison
,Dynamic Crop
,Rate Limiter
,Cosine Similarity
,Environment Secrets Store
,Property Definition
,VLM as Classifier
,Image Slicer
,Perspective Correction
,Line Counter Visualization
,Grid Visualization
,Detections Consensus
,Time in Zone
,Webhook Sink
,Google Vision OCR
,Buffer
,Image Convert Grayscale
,Time in Zone
,Stitch Images
,Blur Visualization
,Bounding Rectangle
,Florence-2 Model
,CSV Formatter
,Keypoint Detection Model
,Color Visualization
,Delta Filter
,Image Preprocessing
,Dominant Color
,QR Code Detection
,CLIP Embedding Model
,Expression
,Dimension Collapse
,VLM as Detector
,Polygon Visualization
,Detections Stabilizer
,Segment Anything 2 Model
,Detection Offset
,OpenAI
,Circle Visualization
,Line Counter
,Bounding Box Visualization
,Corner Visualization
- outputs:
Multi-Label Classification Model
,Line Counter
,Reference Path Visualization
,Data Aggregator
,OpenAI
,Single-Label Classification Model
,OCR Model
,LMM For Classification
,Roboflow Dataset Upload
,Stability AI Inpainting
,Absolute Static Crop
,Trace Visualization
,Path Deviation
,Byte Tracker
,Halo Visualization
,Instance Segmentation Model
,SIFT Comparison
,SIFT
,Email Notification
,Anthropic Claude
,Pixelate Visualization
,Path Deviation
,Classification Label Visualization
,Mask Visualization
,Background Color Visualization
,Crop Visualization
,Relative Static Crop
,VLM as Classifier
,Google Gemini
,Image Contours
,JSON Parser
,Detections Filter
,Gaze Detection
,Byte Tracker
,Image Threshold
,Roboflow Custom Metadata
,Cache Set
,Keypoint Detection Model
,Multi-Label Classification Model
,YOLO-World Model
,Template Matching
,Byte Tracker
,Instance Segmentation Model
,Florence-2 Model
,Object Detection Model
,CogVLM
,Distance Measurement
,Size Measurement
,Stitch OCR Detections
,LMM
,Roboflow Dataset Upload
,Camera Focus
,Identify Changes
,Continue If
,Keypoint Visualization
,Label Visualization
,Cache Get
,Model Monitoring Inference Aggregator
,Polygon Zone Visualization
,Pixel Color Count
,Dynamic Zone
,Object Detection Model
,Triangle Visualization
,Local File Sink
,Barcode Detection
,Single-Label Classification Model
,Clip Comparison
,Ellipse Visualization
,Detections Stitch
,Identify Outliers
,First Non Empty Or Default
,Detections Classes Replacement
,Slack Notification
,Clip Comparison
,Image Blur
,Twilio SMS Notification
,Detections Transformation
,Dot Visualization
,VLM as Detector
,Model Comparison Visualization
,SIFT Comparison
,Dynamic Crop
,Rate Limiter
,Cosine Similarity
,Property Definition
,Image Slicer
,VLM as Classifier
,Perspective Correction
,Line Counter Visualization
,Grid Visualization
,Detections Consensus
,Time in Zone
,Webhook Sink
,Google Vision OCR
,Time in Zone
,Image Convert Grayscale
,Buffer
,Stitch Images
,Blur Visualization
,Bounding Rectangle
,Florence-2 Model
,CSV Formatter
,Keypoint Detection Model
,Color Visualization
,Delta Filter
,Image Preprocessing
,Dominant Color
,QR Code Detection
,CLIP Embedding Model
,Expression
,Dimension Collapse
,VLM as Detector
,Polygon Visualization
,Detections Stabilizer
,Segment Anything 2 Model
,Detection Offset
,OpenAI
,Circle Visualization
,Line Counter
,Bounding Box Visualization
,Corner Visualization
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Expression
in version v1
has.
Bindings
Example JSON definition of step Expression
in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/expression@v1",
"data": {
"predictions": "$steps.model.predictions",
"reference": "$inputs.reference_class_names"
},
"data_operations": {
"predictions": [
{
"property_name": "class_name",
"type": "DetectionsPropertyExtract"
}
]
},
"switch": {
"cases": [
{
"condition": {
"statements": [
{
"comparator": {
"type": "=="
},
"left_operand": {
"operand_name": "class_name",
"type": "DynamicOperand"
},
"right_operand": {
"operand_name": "reference",
"type": "DynamicOperand"
},
"type": "BinaryStatement"
}
],
"type": "StatementGroup"
},
"result": {
"type": "StaticCaseResult",
"value": "PASS"
},
"type": "CaseDefinition"
}
],
"default": {
"type": "StaticCaseResult",
"value": "FAIL"
},
"type": "CasesDefinition"
}
}