Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

Inference with multi inputs

FaithfulNg
Beginner
937 Views

I had one model with multi inputs (4 inputs and 3 outputs ) like this

model.infer(

      {

          tensor0:data0,

          tensor1:data1,

           tensor2:data2,

           tensor3:data3

       })

I try to find the sample code (C/C++) for this case but I can't, does anyone have any samples for this case?
appreciate any help.

 

0 Kudos
4 Replies
Hairul_Intel
Moderator
911 Views

Hi FaithfulNg,

Thank you for reaching out to us.

 

Could you please share more info regarding the use case of your model so that we can share a suitable sample that fits your use case?

 

 

Regards,

Hairul


0 Kudos
FaithfulNg
Beginner
851 Views

Hi Hairul,

my model can't be public and I try another example

ort_inputs = {
"image_embeddings": image_embedding,
"point_coords": onnx_coord,
"point_labels": onnx_label,
"mask_input": onnx_mask_input,
"has_mask_input": onnx_has_mask_input,
"orig_im_size": np.array(image.shape[:2], dtype=np.float32)
}

https://colab.research.google.com/drive/1wmjHHcrZ_s8iFuVFh9iHo6GbUS_xH5xq#scrollTo=9689b1bf

 

I try to infer to get results but I use ` ProfilingInfo ` to check the status and see all layers had the status NOT_RUN.

I deleted my code and switch to ONNX and I can't post the code I wrote here but this is the way I set inputs

 

ov::preprocess::PrePostProcessor prePostProcessor(pModel);


prePostProcessor.input("image_embeddings").tensor()

prePostProcessor.input("point_coords").tensor()

prePostProcessor.input("point_labels").tensor()

prePostProcessor.input("mask_input").tensor()

prePostProcessor.input("has_mask_input").tensor()

prePostProcessor.input("orig_im_size").tensor()

 

0 Kudos
Hairul_Intel
Moderator
833 Views

Hi FaithfulNg,

Thank you for sharing the information.

 

I've managed to find an OpenVINO Notebook Tutorial which also utilizes Segment Anything model. You can refer to the Object masks from prompts with SAM and OpenVINO as reference on running model with multiple inputs using Python.

 

Unfortunately, there's no C/C++ sample on this from OpenVINO and it is only available in the OpenVINO Jupyter Notebook which is using Python.

 

 

Regards,

Hairul


0 Kudos
Hairul_Intel
Moderator
787 Views

Hi FaithfulNg,

This thread will no longer be monitored since we have provided information. If you need any additional information from Intel, please submit a new question.

 

 

Regards,

Hairul


0 Kudos
Reply