GithubHelp home page GithubHelp logo

xxradon / movidius_windows Goto Github PK

View Code? Open in Web Editor NEW

This project forked from donnaware/movidius_windows

0.0 2.0 0.0 4.44 MB

How to use the Movidius Neural Compute Stick on Windows

C++ 2.37% Pascal 96.31% C 1.31%

movidius_windows's Introduction

Movidius Windows

How to use the Movidius Neural Compute Stick on Windows

Yes, it is possible to use the Movidius Neural Compute Stick (https://developer.movidius.com/) on windows. The standard SDK for it is for Ubuntu or Raspian but with a little fiddling you can get it to work, here's how.

This tutorial will get your stick set up on a Windows computer with the right drivers using a simple test program, the alexnet0.exe. To get other aspects working see, the various sub-folders in this git.

Step 1:

The first step is to download one of the standard windows apps I have already compiled. I recommend starting with the Alexnet app. That app will allow you to configure and test your stick and make sure the right drivers are installed.

First plug your stick into a USB port on your computer, it will go through an install, if that worked right you should see this USB Device properties

and when you go to computer->manage->device manager you should see an item in there like this USB Device properties

Right click on the Winusb device and display properties, the hardware ID;s should be these USB Device properties

If all that worked OK, then download the test alexnet0 test app, that app uses a pre-compiled graph file which contains the "smarts" of the app. You can compile graph files yourself if you go to the caffe sub-folder of this git.

Step 2:

Now that you have the Movidius device discovered by Windows, a word about how this little puppy works. It is really two USB devices The first device is the boot device, the sole purpose of which is to upload the firmware (MvNCAPI.mvcmd) up into the Myriad2 (https://www.movidius.com/myriad2) chip inside of it. The Myriad2 is the real brains of the thing. So when you first plug in the device the thing shown above (VID=03E7 PID=2150) that is the booter upper. To get it to become a neural net computer, you have to upload that firmware file. To do that, fire up the alexnet0.exe program and go to the "Output" tab and click Open.

When you click open whilst the Movidius is plugged in, it will upload that firmware (MvNCAPI.mvcmd) file into the Myriad2 chip, when it does that, it stops being the booter upper (VID=03E7 PID=2150) and turns into a new USB device, as if you unplugged the booter upper and plugged in a new thing, you will here that "doo dink" sound that Windows makes when you plug and unplug a USB device. You may wonder, why didn't they just make a compound USB device? Beats the heck out of me, ask the Movidius guys, I am sure there is a good explanation, probably has something to do with Linux or something.

But anyhow, when you run the alexnet0.exe and click on open the first time the Movidius is plugged in you will get this error, but don't panic, we only have to go through this rig-a-ma-roll the first time you plug the Movidius into your computer. alexnet open first time

and you will also notice that now Windows thinks you plugged in a new device, no big deal, we will let Windows do it's thing here for a minute. When it's done gyrating you will get this error message. alexnet open first time

That's OK, we are going to fix it now. Go to good old computer->manage->device manager and you should see this device in there: vsc loopback device

Notice the devices labeled "VSC Loopback Device", that is what Windows thinks it is right now, don't ask me why. now just right click on that thing and pick "Update Device Driver" and you should get this dialog box: browse device

Pick the SECOND Option labeled "Browse my computer for driver software and you will get this: browse device

Again pick the second option that says "Let me pick from a list of device drivers on my computer". Now you will see this: browse device

Pick the Universal Serial Bus devices option. Now you will get this screen: browse device

On my computer there was just the one choice, if you have others, ignore those and pick "WinUSB Device" from the list and click next. You will get a warning message:

warning will robinson

click Yes (but don't blame me if disaster strikes, proceed at your own risk !).

It will re-install the device using this new driver and if all goes well you get this: installed

To double check that all this crap worked right, go back to alexnet0.exe and try open again. If it worked right, you should get this: opened ok

You may need to unplug the Movidius stick and close the alexnet0.exe and plug Movidius back in and start the program again. If that does not work you may need a reboot.

Assuming things worked and you got the "NCS Device opened normally." message in alexnet0.exe program, then you can double check this new device and go to ye ole computer->manage->device manager and look for this, select the WinUsb Device, right click and pick properties and now you can check the Hardware ID's and see that they changed: USB Device properties

You can see now the new ID's are (VID=03E7 PID=F63B) a different device, this is the Myriad2 device. If you click close it will close that one and the booter upper one will come back.

As another check, whilst the Movidius os Open, you can click on "status" button and you should see this: Movidius waiting

which just means it is waiting for the graph file to be uploaded.

WHEWY!, that was hard work, but if all that went well, you now should have a Movidius Stick working on your PC. From now on, you don't have to go through that junk. From now on, you should be able to just plug the Movidius into your PC and open the alexnet0.exe or other Windows apps from this git and it should work straight away without all the fiddling.

Step 3:

Now that we got through all that install hassle, we can actually start having some fun. Assuming everything went OK so far you should see this on your alexnet0.exe program: Movidius waiting

The next step is to load the graph file into the Movidius, if you downloaded the alexnet0/release from this git there should be a file called "graph" is the same folder as alexnet0.exe (it's a big file about 119MB). Now click on the button "load graph" and you show see this: graph loaded

Now we are ready to recognize stuff. Flip over to the tab labeled "Image" and you will see this screen: graph loaded

If you click on the button labeled "run" at the top bar or in the tab area then the result shold be: graph loaded

Yeah, the Movidius got the answer right !!! yippee. For this test program you can load different pictures in by either clicking on the "load new image" button (it only can load BMP's right now) or you can copy any picture into the clipboard and past it in. the picture on the left will show the original picutre shrunk down and then the picture on the right is that picture re-sampled down. For this demo it will only be able to use 227 x 227 pixel resolution so it will re-size everything to that.

You will see another tab labeled "Classification" that is a table of all the categories it can recognize and will show you the probabillity on each. graph loaded

If you click on the heading "Probability" it will sort by probability lowest to highest, if you click it again it will sort highest to lowest. graph loaded

Now just for fun, let's pick a picture off of Google Images just to see how Movidius does. Go to google.com and click on images and then put in "guitar", when I did that I got this graph loaded

go ahead and pick one out and copy the picture to the clipboard and then use the alexnet0.exe "paste from clipbaord" button and click run. You may have to click on run twice sometimes Movidius seems to have another image queued up for some weird reason. Anyhow, when i tried that I got this: graph loaded

Even thought the picutre got sort of stretched it seemed to go OK, wow, so cool.

Wrap up and Next Steps:

Well, if you got this far without any problems, congratulations !

Check out some of the other sub-folders in this git for more examples and how to's on how to install Caffe on windows and how to build things.

movidius_windows's People

Contributors

donnaware avatar

Watchers

James Cloos avatar WangDong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.