Skip to content

Example Workflows - Workflows with visualization blocks

Below you can find example workflows you can use as inspiration to build your apps.

Predictions from different models visualised together

This workflow showcases how predictions from different models (even from nested batches created from input images) may be visualised together.

Our scenario covers:

  • Detecting cars using YOLOv8 model

  • Dynamically cropping input images to run secondary model (license plates detector) for each car instance

  • Stitching together all predictions for licence plates into single prediction

  • Fusing cars detections and license plates detections into single prediction

  • Visualizing final predictions

Workflow definition
{
    "version": "1.0.0",
    "inputs": [
        {
            "type": "WorkflowImage",
            "name": "image"
        }
    ],
    "steps": [
        {
            "type": "roboflow_core/roboflow_object_detection_model@v1",
            "name": "car_detection",
            "image": "$inputs.image",
            "model_id": "yolov8n-640",
            "class_filter": [
                "car"
            ]
        },
        {
            "type": "roboflow_core/dynamic_crop@v1",
            "name": "cropping",
            "image": "$inputs.image",
            "predictions": "$steps.car_detection.predictions"
        },
        {
            "type": "roboflow_core/roboflow_object_detection_model@v1",
            "name": "plates_detection",
            "image": "$steps.cropping.crops",
            "model_id": "vehicle-registration-plates-trudk/2"
        },
        {
            "type": "roboflow_core/detections_stitch@v1",
            "name": "stitch",
            "reference_image": "$inputs.image",
            "predictions": "$steps.plates_detection.predictions",
            "overlap_filtering_strategy": "nms"
        },
        {
            "type": "DetectionsConsensus",
            "name": "consensus",
            "predictions_batches": [
                "$steps.car_detection.predictions",
                "$steps.stitch.predictions"
            ],
            "required_votes": 1
        },
        {
            "type": "roboflow_core/bounding_box_visualization@v1",
            "name": "bbox_visualiser",
            "predictions": "$steps.consensus.predictions",
            "image": "$inputs.image"
        }
    ],
    "outputs": [
        {
            "type": "JsonField",
            "name": "predictions",
            "selector": "$steps.consensus.predictions"
        },
        {
            "type": "JsonField",
            "name": "visualisation",
            "selector": "$steps.bbox_visualiser.image"
        }
    ]
}