PINTO0309 / MobileNet-SSD-RealSense

[High Performance / MAX 30 FPS] RaspberryPi3(RaspberryPi/Raspbian Stretch) or Ubuntu + Multi Neural Compute Stick(NCS/NCS2) + RealSense D435(or USB Camera or PiCamera) + MobileNet-SSD(MobileNetSSD) + Background Multi-transparent(Simple multi-class segmentation) + FaceDetection + MultiGraph + MultiProcessing + MultiClustering
https://qiita.com/PINTO
MIT License
365 stars 127 forks source link

NCS2 Slower Than NCS1 #11

Closed Luxonis-Brandon closed 5 years ago

Luxonis-Brandon commented 5 years ago

Hi PINTO0309,

Thanks for all your work here and particularly for documenting it all. I've bene able to successfully follow everything, which I think speaks to your thoroughness. :-)

So I've setup and run, with RealSense D435, the following:

  1. No NCS with TensorFlow (here
  2. NCS1 (this repository, with NCSDK)
  3. NCS2 (this repository, with OpenVINO), using python3 MultiStickSSDwithRealSense_OpenVINO_NCS2.py - but I only have 1x NCS2 device.

So I'm seeing the following framerates:

  1. 1 FPS - No NCS
  2. 6 FPS - 1x NCS1
  3. 5 FPS - 1x NCS2

So I'm curious to see that the NCS2 with OpenVINO actually seems to be slightly slower than the NCS1 with NCSDK.

Now my question is, it feels like I'm running the wrong command for 3... am I?

I'm running python3 MultiStickSSDwithRealSense_OpenVINO_NCS2.py and the only other options I see there are:

So it kind of makes me think that SingleStickSSDwithRealSense_OpenVINO_NCS2.py, or something like that, is missing from github (like forgot to be committed, or similar).

Thoughts?

Oh and to see if SingleStickSSDwithRealSense.py happened to be compatible with both NCS1 (NCSDK) and NCS2 (OpenVINO), I rant it with the NCS2 connected (and no NCS1 connected), and got:

python3 SingleStickSSDwithRealSense.py 
Traceback (most recent call last):
  File "SingleStickSSDwithRealSense.py", line 13, in <module>
    from mvnc import mvncapi as mvnc
ImportError: No module named 'mvnc'

Thanks again! -Brandon

PINTO0309 commented 5 years ago

@Luxonis-Brandon

Thank you for giving feedback.

So I'm curious to see that the NCS2 with OpenVINO actually seems to be slightly slower than the NCS1 with NCSDK.

Quite a while ago I got the same benchmark as you. Engineers from other countries also convey the same results.

So it kind of makes me think that SingleStickSSDwithRealSense_OpenVINO_NCS2.py, or something like that, is missing from github (like forgot to be committed, or similar).

Sorry... I have not created "SingleStickSSDwithRealSense_OpenVINO_NCS2.py". It is the same as using "MultiStickSSDwithRealSense_OpenVINO_NCS2.py" in NCS2 one piece. "SingleStickSSDwith***" is simple logic for program verification process. I will soon create it along with performance improvements so please give me a few days.

Oh and to see if SingleStickSSDwithRealSense.py happened to be compatible with both NCS1 (NCSDK) and NCS2 (OpenVINO), I rant it with the NCS2 connected (and no NCS1 connected), and got:

When you install OpenVINO, environment variables are forcibly updated. In order to make both coexist, I think that tricky environment setting is necessary.

Luxonis-Brandon commented 5 years ago

@PINTO0309

Awesome, thanks for the thorough response! Much appreciated.

I will soon create it along with performance improvements so please give me a few days. Looking forward to it, thanks!

It is the same as using "MultiStickSSDwithRealSense_OpenVINO_NCS2.py" in NCS2 one piece. "SingleStickSSDwith***" is simple logic for program verification process. Got it. I was thinking that could be the case, but wasn't sure.

When you install OpenVINO, environment variables are forcibly updated. In order to make both coexist, I think that tricky environment setting is necessary. Yes, that makes sense, and I was kind of noticing that. Perhaps with Docker it's doable... but I don't know much about it, and I do have another drive with the NCS1 environment setup, which I can just switch back to when I need to, so I'll just do that if/when I need it.

Also, speaking of Docker containers, I'm thinking of trying to setting up something like below, so that I can compile OpenCV, OpenVINO, RealSense, etc. faster for the Pi. Have you done anything like that before?

http://kmdouglass.github.io/posts/how-i-built-a-cross-compilation-workflow-for-the-raspberry-pi.html

That, or see if maybe the ARM servers from Scaleway (here) are usable.

Thanks again! -Brandon

PINTO0309 commented 5 years ago

@Luxonis-Brandon

Thank you for providing useful information. I have skills to use Docker, but I will try to make this repository a docker a little more later. I'm managing multiple repositories alone, at the same time. I'd like to try a variety of things that you suggested, but I do not have enough time... :sob:

That, or see if maybe the ARM servers from Scaleway (here) are usable.

This is a very interesting service. I want to try various things. :smiley:

PINTO0309 commented 5 years ago

@Luxonis-Brandon Only performance tuning is over. MultiStickSSDwithRealSense_OpenVINO_NCS2.py

Luxonis-Brandon commented 5 years ago

Sweet!!! That is very exciting @PINTO0309 ! Will try this today.

Thanks again!

Luxonis-Brandon commented 5 years ago

@Luxonis-Brandon

Thank you for providing useful information. I have skills to use Docker, but I will try to make this repository a docker a little more later. I'm managing multiple repositories alone, at the same time. I'd like to try a variety of things that you suggested, but I do not have enough time... 😭

That, or see if maybe the ARM servers from Scaleway (here) are usable.

This is a very interesting service. I want to try various things. 😃

Heh, thank you! You've saved me a ton of time with these repositories; much appreciated.

I'm happy to help as I can as well. If you want anything offloaded I'm happy to try to do it.

Thanks again, Brandon

Luxonis-Brandon commented 5 years ago

@Luxonis-Brandon Only performance tuning is over. MultiStickSSDwithRealSense_OpenVINO_NCS2.py

Just wanted to note that I did try this, and it is indeed about 4x faster than before, which is awesome.

I did notice a new bug introduced by the change though, which I noted here: https://github.com/PINTO0309/MobileNet-SSD-RealSense/issues/13

PINTO0309 commented 5 years ago

I have given up my registration because I can not enter the phone number. It is very disappointing...

Scaleway https://www.scaleway.com/virtual-cloud-servers/#anchor_arm

Luxonis-Brandon commented 5 years ago

I could probably sign up and then transfer the account if you want? Thoughts?

PINTO0309 commented 5 years ago

Thank you as always, Brandon.

I could probably sign up and then transfer the account if you want?

What should I do? I am a little worried because I do not know how to pay the money.

Luxonis-Brandon commented 5 years ago

Ya, I'll have to figure that out as well. I also have a friend who uses these guys all the time. I'll reach out to him for advise.