Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Shinjan
Beginner
223 Views

The recognition problem is on the Raspberry Pi 3B

I want to ask a question. I used the following program for recognition, but the results of the recognition are not satisfactory. Is it because my code has a problem or is it due to other reasons?

Code:

from __future__ import print_function
import cv2
import numpy as np
import time
from openvino.inference_engine import IENetwork, IECore

time_0 = time.clock()

model_xml = "googlenet.xml"
model_bin = "googlenet.bin"


ie = IECore()


net = ie.read_network(model=model_xml, weights=model_bin)


input_blob = next(iter(net.input_info))
out_blob = next(iter(net.outputs))
net.batch_size = 1

time_1 = time.clock()


n, c, h, w = net.input_info[input_blob].input_data.shape 
image = cv2.imread("01.jpg") 
image = cv2.resize(image, (224, 224)) 
image = image.transpose((2, 0, 1))

time_2 = time.clock()


exec_net = ie.load_network(network=net, device_name="MYRIAD") 

time_3 = time.clock()


res = exec_net.infer(inputs={input_blob: image})

time_4 = time.clock()


res = res[out_blob]

print(res)  #Show result

 

0 Kudos
6 Replies
Rizal_Intel
Moderator
213 Views

Hi Shinjan,

 

Could you elaborate on why the recognition is not satisfactory?

Is it due to the time taken for inference or due to detection accuracy issue?

 

If it is due to accuracy issue, can you inspect the googlenet.xml against the original model before conversion?

You can inspect it using Netron.

 

Regards,

Rizal



Shinjan
Beginner
204 Views

Hello, thanks for your reply

The problem we have encountered is that one of our recognition results will be exactly the same as the other. In other words, suppose that there are three types of my recognition, tree, car, and person. It should be judged as a car, but all the results are people.

Rizal_Intel
Moderator
197 Views

Hi Shinjan,

 

So the result is different compared to the original model?

If possible, can you share both the original model and the IR of the converted model?

 

If not, you could visually inspect your models using Netron if it is not too large.

Try checking if there a significant changes to your model (trained model vs IR).

 

There are methods to disable layer fusing which may have significantly altered your model performance.

You could check --disable_fusing command in Model Optimizer parameters.

This model optimization techniques page should help you understand the process more.

 

Regards,

Rizal


Shinjan
Beginner
183 Views

Hello, thanks again for your reply

We made a comparison, but we can't see if they are different. We are willing to provide the trained model and IR files.

In addition, we will continue to try the methods you suggest.

Rizal_Intel
Moderator
178 Views

Hi Shinjan,


The generated IR does not seem to be missing any layers.

Are you getting your expected result using your ONNX model?


If your ONNX model does not produce your expected result, you would need to train your model further.

If the ONNX model is okay but the IR have a degraded performance, you can try using the methods previously mentioned.


Regards,

Rizal


Rizal_Intel
Moderator
151 Views

Hi Shinjan,


Thank you for your question. If you need any additional information from Intel, please submit a new question as Intel is no longer monitoring this thread.


Regards,

Rizal


Reply