- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page