How to create a custom cropping module in a workflow

I want to create a cropping module as part of a workflow. For example, an input image includes 5 cars and I want to get the number plate of the car on the far left. Cars can be deteced using an object detection module. The number plate can be detected using a number plate detection module. But, there is no detection module which selects the car on the far left among deteced cars. So, I want to create such a module which selects the car on the far left among detected cars.

I wonder if I can define such a custom module using “webhook sink” which calls a Web application I make with custom logic.
I tried to create a Webhook sink module. But, I can not set my custom Web application URL into its URL property because the property is pre-defined and can not be overwritten. So, I need your help. Thank you.

Hi @shimazu.a60 !

With this week’s inference release you will be able to do this with property definition block

So workflow like below will pick left-most detection:

{
  "version": "1.0",
  "inputs": [
    {
      "type": "InferenceImage",
      "name": "image"
    }
  ],
  "steps": [
    {
      "type": "roboflow_core/roboflow_object_detection_model@v2",
      "name": "model",
      "images": "$inputs.image",
      "model_id": "some_model/1"
    },
    {
      "type": "roboflow_core/property_definition@v1",
      "name": "property_definition",
      "data": "$steps.model.predictions",
      "operations": [
        {
          "type": "DetectionsSelection",
          "mode": "left_most"
        }
      ]
    }
  ],
  "outputs": [
    {
      "type": "JsonField",
      "name": "property_definition",
      "coordinates_system": "own",
      "selector": "$steps.property_definition.output"
    }
  ]
} 

Also, you have custom python block at your disposal If you need to achieve something not covered with existing blocks.

Hope this helps!

Grzegorz

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.