Intel® Distribution of OpenVINO™ Toolkit
Community support and discussions about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all things computer vision-related on Intel® platforms.
5769 Discussions

Help required in using a retrained model for custom object detection on a Raspberry Pi 3 + Movidius

Community Manager



Firstly, let me start by saying that I'm not educated in this field at all. I have tried learning a lot, mostly for fun, but considering I have difficulties with reading, it's quite hard to find resources on how this kind of things works, I've found. I am a software developer, full time, so figured a bit of python or whatever would serve me well and away we would go. How wrong I was.


A couple of weeks ago I gave up on trying to use my custom trained model (UK registration plate detection). It worked really quite well on PC using a python script by following this tutorial (Faster-RCNN-Inception-V2-COCO). I have also followed this tutorial (ssd_mobilenet_v1_coco), which is aimed at training in the cloud. Using both tutorials, I was able to successfully use about 600 images to create my model. I've tried registering to the Intel seminar things, but I never get a response to those, so I am unable to get any value from those.


The last time I looked at it (about the beginning of this month) I had hit a brick wall (after spending many hours every day for about 10 days) and ended up spitting my dummy out. Along with that, I decided the best thing for it was to get some fresh eyes on it and give it about a week as it actually started to consume me a little bit…


Anyway, my question is, if it is possible at all, how would I go about taking my retrained models and using them on the Movidius?


My 'requirements'/details are as follows:


1) My use case does not have to use Tensorflow – it would be a bonus if it did as I already have 2x working models, but if another format such as Tiny Yolo needs to be trained, I'm quite happy to do that again.


2) Ideally, I will be able to just send it an image of some kind, rather than a camera feed


3) To have a response time that is pretty reasonable – I'm wanting to make myself a small API that uses this, so a decent response time would be amazing.


Whether it be a link to a valuable literature (aforementioned poor reading skills make long articles a real chore to filter through to makes sure they're of value) or a good video, or better yet - the answer, that would be fantastic and massively appreciated as it's actually getting me really down that I've not been able to crack this.


Many many thanks,


0 Kudos
10 Replies
Community Manager

Have you gone through the basic examples in the NCAppZoo first?


As far as using your own graph, you let me know when you figure that out.


I used to reuse the inception v3 graph, created a pb file and could not compile it.


Trying again to figure this out. I had to go back to using OpenCV for a quick fall back.
Community Manager

@chicagobob123 Thanks. I will either look at those or refresh if I have this weekend. I will let you know how it goes.

Community Manager

The NCAppZoo shows how to load a Tensorflow graph that has been COMPILED.


Once you have working compiled graph the rest is pretty straight forward.


You load the graph send it images and get the inference back. I suggest you look at the Security Cam example.


It breaks it down the into the basic steps.


Check for the Movidius device,


Open the device,


Load the graph,


Init your camera or get a still image to compare etc..


Get an image,


do an inference


and decide what to do with the results.


There is code to all of that but its actually pretty simple and easy to do.
Community Manager

Dear all,


Im having issues running the already existing graph generated in ncappzoo/caffe/SSD_MobileNet Im using the py which is part of the NCAPPZOO without changes.


Error message is:


pi@raspberrypi:~/ncsdk/ncappzoo/apps/live-object-detector $ make run




python3 --video 0


Traceback (most recent call last):


File "", line 211, in


open( ARGS.labels ) if line != 'classes\n']


FileNotFoundError: [Errno 2] No such file or directory: '../../caffe/SSD_MobileNet/labels.txt'


Makefile:16: recipe for target 'run' failed


make: *** [run] Error 1


This labels file was not generated when I compiled the graph, I`ve checked the github documentation for SSD_mobilenet but there is nothing about this file there,, so does anybody have any idea where to get this file?


Thanks in advance!
Community Manager

Did you do a makeall when you installed AppZoo? it typically fixes those issues.


As far as whats in the labels.txt file just some labels.


do a makeall here. I think that should generate what you need.



Community Manager

Thanks for the support @chicagobob123 , unfortunatelly everything is already there, please see the result of make all below:


pi@raspberrypi:~/ncsdk/ncappzoo/caffe/SSD_MobileNet $ make all


making prereqs


making prototxt


Prototxt file already exists, skipping download.


making caffemodel


caffemodel already exists, skipping download.


making compile


NCS graph file already exists, skipping compile.


It seems this file labels.txt is generated by oder process or has to be downloaded.


Any comment is welcome!


Community Manager

I have found the content of the labels.txt in github:


0: background


1: aeroplane


2: bicycle


3: bird


4: boat


5: bottle


6: bus


7: car


8: cat


9: chair


10: cow


11: diningtable


12: dog


13: horse


14: motorbike


15: person


16: pottedplant


17: sheep


18: sofa


19: train


20: tvmonitor
Community Manager

how did you not have it if it was on github? Glad you have it now

Community Manager

Good question, it seems it was lost in one previous version.


Please find the link where I got it below:
Community Manager

Dear Intel colleagues, do you have a guideline how to retrain the MobileNet SSD for a custom object detection as requested in the first post?


Thanks in advance!