Home > Net >  Run Tensorflow model with Intel Open Vino Model Zoo
Run Tensorflow model with Intel Open Vino Model Zoo

Time:10-19

I just started learning computer vision(newbie to neutral network)

If I want to make detect whether a human holding an umbrella or not with a pre-trained human model with an intel open vino model,

First, I train umbrella images Second, Convert TensorFlow model to the Intel Open Vino model

Third, I am pretty lost here I am not sure how to run my model with the pre-trained model. For example, what I want at the end is that if a human is holding an umbrella, then (human holding an umbrella with a rectangular box) and if not, it says no human holding umbrella... in a box.

CodePudding user response:

To run your model (Intermediate Representation) with OpenVINO™ toolkit, you must implement OpenVINO™ Runtime inference pipeline in your application with the steps as follows:

Step 1. Create OpenVINO™ Runtime Core

import openvino.runtime as ov

core = ov.Core()

Step 2. Compile the Model

compiled_model = core.compile_model("model.xml", "AUTO")

Step 3. Create an Infer Request

infer_request = compiled_model.create_infer_request()

Step 4. Set Inputs

# Create tensor from external memory
input_tensor = ov.Tensor(array=memory, shared_memory=True)

# Set input tensor for model with one input
infer_request.set_input_tensor(input_tensor)

Step 5. Start Inference

infer_request.start_async()
infer_request.wait()

Step 6. Process the Inference Results

# Get output tensor for model with one output
output = infer_request.get_output_tensor()
output_buffer = output.data

# output_buffer[] - accessing output tensor data

CodePudding user response:

You will structure your problem, first. Think about something like this: to read the image (or decode a frame from a video, capture a frame from a camera), and run an inference using the person-detection-model. If you get at least one output (and checking the confidence-level, e.g. see whether it is 0.8 (80%) or higher), then you could run another inference using your trained umbrella-detection-model. If you again get at least one output, checking confidence-level again - then you (only) know there is at least one person and at least one umbrella in the image. But you cannot be sure if a person (at least one, could be many) is holding it in its hand - there could be many persons being detected and many umbrellas being detected.

  • Related