Intel® Movidius™ Neural Compute Stick support

Hello, DeepStack is tested on both Raspbian Strech and Buster. While all tests were done on a PI3, since PI4 is running on rasbian buster, it should work on it. Have you tried restarting the PI and see the response?

OK I had been using a slightly non-standard disk image. Switched to Buster desktop and everything running fine on pi4, with inferences taking around 2 seconds for the vision model and NCS1. Thanks!

1 Like

Btw I oreded a NCS2 (i.e. second gen stick), based on benchmarking we expect inferences to run in about half the time of NCS1, has anyone confirmed this?

1 Like

Also a request, I want to run deepstack in daemon mode on RPI, can you add ability to pass -d to the service call? e.g. sudo deepstack start "VISION-DETECTION=True" -d

However I think you have plans to standardise this across all platforms in which case dont worry

1 Like

@robmarkcole We plan to standardize the experience. DeepStack is untested with the NCS1, i am glad you did run it successfully with it. The NCS2 should provide better performance.

1 Like

Hi @john
I have a practical problem with using deepstack on the pi. Owing to the shape of the movidius stick it is necessary to use a USB hub to be able to connect both the stick and usb keyboard/mouse to the pi. However when using the USB hub the stick is not detected by deepstack and requests timeout. Is it possible:

  1. For deepstack to present an error if the stick is unreachable
  2. To run deepstack on pi over SSH (would require nohup or similar, I believe the implementation is already using nohup?)

Thanks

Yes, deepstack can detect if no stick is present. I admit, this should have been reported in the current version, we shall add it in the upcoming beta. If running over SSH, simply run with sudo nohup deepstack start

1 Like

Will the process not terminate when the SSH session is closed? I guess it is running as a serivce

No, it won’t terminate until the PI is shutdown or the process is killed deliberately.

OK great! I saw the process was already using nohup, and didn’t realise you can wrap nohup around another nohup :slight_smile:

1 Like

lol. Checking through the starting script again, i see there is need for a daemon mode to be clearly added as not all the child processes are using nohup at present.

1 Like

Tried install on pi 3b+ with raspbian buster and ncs2, script fails @ scipy install (both with python 3.5 and 3.7). Installed scipy via apt (python3-scipy) and completed the install process (excluding scipy). Application runs with sudo deepstack start "VISION-DETECTION=True", activation ok, but requests runs forever without response. On server I can see the “GET request” of activation (or if I try /v1/vision/detection url in chrome) but not the “POST request”. For the test i’m using the same script that I’m using for another deepstack server:

import requests
image_data = open("test-image5.jpg","rb").read()
response = requests.post("http://localhost/v1/vision/detection",files={"image":image_data}).json()
print(response)

In nohup.out I have a lot of:
Usage:
kill [options] […]

Options:
 <pid> [...]            send signal to every <pid> listed
 -<signal>, -s, --signal <signal>
                        specify the <signal> to be sent
 -l, --list=[<signal>]  list all signal names, or convert one to a name
 -L, --table            list all signal names in a nice table

 -h, --help     display this help and exit
 -V, --version  output version information and exit

For more details see kill(1).

if I make a wrong request (ex. “text” instead of “image” in the post request)
I get: {'success': False, 'error': 'No valid image file found'}
So the post request happens

maybe there’s some problem with the image upload
what can I try to fix it?

@robmarkcole Hi Rob
Following you here and on hass forums.
Regarding the ncs stick size: the case is in reality a thermal cooler.
Mettalic grey at both edges are thin foils glued.
Whith a tiny screwdriver you can detach them.
Unddrneath you will find a couple of screws per side.
Once you unscrew you can pull out the real hardware which is way tinier .
Beware: you will remove thermal paste in the process: you will have to use the stick in a cool environment after this. And your warranty will be void.
Cheers and tx for your great stuff

I’ve also tried on stretch (Python 3.5.4) - many package are missing in an headless setup, installed via:
sudo apt install libopenjp2-7 libgtk-3-0 libgtk-3-dev libtiff5
The sh installer fails on scipy (building wheel for scipy), but the same package can be installed via apt
‘sudo apt install python3-scipy’
But, the main problem is on the setupvars.sh: had to use the openvino official:
source /opt/intel/openvino/bin/setupvars.sh instead of the deepstack one. (openvino guide at https://docs.openvinotoolkit.org/latest/_docs_install_guides_installing_openvino_raspbian.html )

Now the setup is working on Pi3 with Stretch and NCS2, average prediction in 1,5 - 2 seconds

Hi @fraschizzato,

I have a Raspberry Pi 3B+ with Intel NCS 2. I ran through through the Deepstack installer and everything installed fine with no errors.

I activated Deepstack successfully and can navigate to the Deepstack homepage successfully. However, when I run curl -X -F POST -F image@image3.jpg ‘http://x.x.x.x:80/v1/vision/detection’ nothing happens :frowning:

I tried following your suggested changes by changing the setupvars.sh line to the OpenVino official one in /usr/bin/deepstack with no luck either.

Any other suggestions appreciated!

As I remember I had same issue with curl, I have’t investigated why, so i’ve used a simple python script to make tests:

import requests

image_data = open("<img_path>","rb").read()

response = requests.post("http://x.x.x.x/v1/vision/detection",files={"image":image_data}).json()
#print("Label:",response["label"])
print(response)

Thanks, I managed to sort it out by installing reimaging SD Card with Buster Desktop edition and just running:

wget https://deepquest.sfo2.digitaloceanspaces.com/deepstack/install-deepstack.sh

install-deepstack.sh

Had to run install-deepstack.sh twice as the first time it complained about a hash issue with numpy. The second time I ran it it installed fine.

Once activated, I could run
curl -X POST -F image=@snap.jpg 'http://192.168.20.37:80/v1/vision/detection' | json_pp
which returned prediction results in just over 1 second.

Thanks

hey! i did some testing last week and got a Pi3 with Buster Full up and working with Deepstack.

Now, after couple of days - my requests don’t get posted to deepstack. Other than upgrade, nothing else has changed and was experimenting deepstack to auto-run and log properly which wasn’t succesful either.

How is yours working.

too early… just restarted and trained with 20 images of mine… worked fast…

v1/vision/restore
[GIN] 2020/05/24 - 16:31:15 | 200 | 2m7s | 10.0.0.19 | POST /v1/vision/face
[GIN] 2020/05/24 - 16:33:53 | 200 | 24.91630s | 10.0.0.19 | POST /v1/vision/face/register

How are you dealing with auto-start and logging from deepstack…

Now, after couple of days - my requests don’t get posted to deepstack. Other than upgrade, nothing else has changed and was experimenting deepstack to auto-run and log properly which wasn’t succesful either.

Were you starting Deepstack via SSH? I found that once the SSH session dies, so does DeepStack. To get around this I setup VNC on my raspberry Pi and then used that to login and start Deepstack.

Still haven’t had any luck in getting it to auto-run :frowning: