Selection of multiple images (Workflow)

Hi, I created a workflow with an “Inputs” block where I can upload an image. Is it possible to select multiple images? Currently, I can only upload one .jpg image!

Hi @Silvia_Ivanova ,

Many thanks for posting this question!

When you mention uploading .jpg image I assume you mean our workflows builder, which you can use to build and test workflows and currently we do not support testing with multiple .jpg images.

In order to test multiple images input you can write a script and run it, please have a look at below very simple example:

import cv2 as cv

from inference.core.workflows.execution_engine.core import ExecutionEngine


WORKFLOW_DEFINITION = {
  "version": "1.0",
  "inputs": [
    {
      "type": "InferenceImage",
      "name": "image"
    }
  ],
  "steps": [
  ],
  "outputs": [
    {
      "type": "JsonField",
      "name": "my_example_output",
      "coordinates_system": "own",
      "selector": "$inputs.image"
    }
  ]
}

img_path = "/path/to/image.jpg"

execution_engine = ExecutionEngine.init(
    workflow_definition=WORKFLOW_DEFINITION,
)

result = execution_engine.run(
    runtime_parameters={
        "image": [
          {"type": "file", "value": img_path},
          {"type": "file", "value": img_path},
          {"type": "file", "value": img_path},
        ],
    }
)

cv.imshow("0", result[0]["my_example_output"].numpy_image)
cv.imshow("1", result[1]["my_example_output"].numpy_image)
cv.imshow("2", result[2]["my_example_output"].numpy_image)
cv.waitKey(0)