├── .gitignore ├── LICENSE ├── Makefile ├── NCSDK-1.12.00.01 ├── install-ncsdk.sh ├── ncsdk-aarch64 │ ├── LICENSE │ ├── MovidiusLogo.png │ ├── api │ │ ├── c │ │ │ ├── libmvnc.so.0 │ │ │ ├── mvnc.h │ │ │ └── mvnc_deprecated.h │ │ ├── python │ │ │ └── mvnc │ │ │ │ ├── __init__.py │ │ │ │ └── mvncapi.py │ │ └── setup.py │ ├── fw │ │ └── MvNCAPI.mvcmd │ ├── tk │ │ ├── Controllers │ │ │ ├── Args.py │ │ │ ├── CaffeEnumController.py │ │ │ ├── CaffeParser.py │ │ │ ├── DataTransforms.py │ │ │ ├── EnumController.py │ │ │ ├── FileIO.py │ │ │ ├── Metrics.py │ │ │ ├── MiscIO.py │ │ │ ├── TensorFlowParser.py │ │ │ └── TensorFlowPreproc.py │ │ ├── Models │ │ │ ├── Blob.py │ │ │ ├── CaffeEnumDeclarations.py │ │ │ ├── EnumDeclarations.py │ │ │ ├── MyriadParam.py │ │ │ ├── Network.py │ │ │ └── NetworkStage.py │ │ ├── Views │ │ │ ├── Graphs.py │ │ │ ├── Summary.py │ │ │ └── Validate.py │ │ ├── mvNCCheck.py │ │ ├── mvNCCompile.py │ │ └── mvNCProfile.py │ └── udev │ │ └── 97-usbboot.rules ├── ncsdk-armv7l │ ├── LICENSE │ ├── MovidiusLogo.png │ ├── api │ │ ├── c │ │ │ ├── libmvnc.so.0 │ │ │ ├── mvnc.h │ │ │ └── mvnc_deprecated.h │ │ ├── python │ │ │ └── mvnc │ │ │ │ ├── __init__.py │ │ │ │ └── mvncapi.py │ │ └── setup.py │ ├── fw │ │ └── MvNCAPI.mvcmd │ ├── tk │ │ ├── Controllers │ │ │ ├── Args.py │ │ │ ├── CaffeEnumController.py │ │ │ ├── CaffeParser.py │ │ │ ├── DataTransforms.py │ │ │ ├── EnumController.py │ │ │ ├── FileIO.py │ │ │ ├── Metrics.py │ │ │ ├── MiscIO.py │ │ │ ├── TensorFlowParser.py │ │ │ └── TensorFlowPreproc.py │ │ ├── Models │ │ │ ├── Blob.py │ │ │ ├── CaffeEnumDeclarations.py │ │ │ ├── EnumDeclarations.py │ │ │ ├── MyriadParam.py │ │ │ ├── Network.py │ │ │ └── NetworkStage.py │ │ ├── Views │ │ │ ├── Graphs.py │ │ │ ├── Summary.py │ │ │ └── Validate.py │ │ ├── mvNCCheck.py │ │ ├── mvNCCompile.py │ │ └── mvNCProfile.py │ └── udev │ │ └── 97-usbboot.rules ├── ncsdk-x86_64 │ ├── LICENSE │ ├── MovidiusLogo.png │ ├── api │ │ ├── c │ │ │ ├── libmvnc.so.0 │ │ │ ├── mvnc.h │ │ │ └── mvnc_deprecated.h │ │ ├── python │ │ │ └── mvnc │ │ │ │ ├── __init__.py │ │ │ │ └── mvncapi.py │ │ └── setup.py │ ├── fw │ │ └── MvNCAPI.mvcmd │ ├── tk │ │ ├── Controllers │ │ │ ├── Args.py │ │ │ ├── CaffeEnumController.py │ │ │ ├── CaffeParser.py │ │ │ ├── DataTransforms.py │ │ │ ├── EnumController.py │ │ │ ├── FileIO.py │ │ │ ├── Metrics.py │ │ │ ├── MiscIO.py │ │ │ ├── TensorFlowParser.py │ │ │ └── TensorFlowPreproc.py │ │ ├── Models │ │ │ ├── Blob.py │ │ │ ├── CaffeEnumDeclarations.py │ │ │ ├── EnumDeclarations.py │ │ │ ├── MyriadParam.py │ │ │ ├── Network.py │ │ │ └── NetworkStage.py │ │ ├── Views │ │ │ ├── Graphs.py │ │ │ ├── Summary.py │ │ │ └── Validate.py │ │ ├── mvNCCheck.py │ │ ├── mvNCCompile.py │ │ └── mvNCProfile.py │ └── udev │ │ └── 97-usbboot.rules ├── ncsdk.conf ├── requirements.txt ├── requirements_apt.txt ├── tests │ ├── Makefile │ ├── api-check │ │ ├── Makefile │ │ ├── ncs-c-check.c │ │ ├── ncs-python2-check.py │ │ └── ncs-python3-check.py │ └── sdk-check │ │ ├── Makefile │ │ ├── data │ │ ├── alexnet.prototxt │ │ ├── googlenet.prototxt │ │ ├── readme.txt │ │ └── squeezenet.prototxt │ │ ├── img │ │ └── 512_Phone.jpg │ │ └── test_install.py ├── uninstall-ncsdk.sh └── version.txt ├── README.md ├── api ├── LICENSE ├── include │ ├── mvnc.h │ └── mvnc_deprecated.h ├── python │ └── mvnc │ │ ├── __init__.py │ │ └── mvncapi.py └── src │ ├── 97-usbboot.rules │ ├── Makefile │ ├── Makefile.rpi │ ├── USBLinkDefines.h │ ├── common.h │ ├── libmvnc.so │ ├── libmvnc.so.0 │ ├── mvnc │ └── MvNCAPI.mvcmd │ ├── mvnc_api.c │ ├── obj-aarch64 │ ├── libmvnc.so.0 │ ├── mvnc_api.d │ ├── mvnc_api.o │ ├── usb_boot.d │ ├── usb_boot.o │ ├── usb_link_vsc.d │ └── usb_link_vsc.o │ ├── usb_boot.c │ ├── usb_boot.h │ ├── usb_link.h │ └── usb_link_vsc.c ├── docs ├── README.md ├── TOC.html ├── assets │ ├── css │ │ └── style.css │ ├── images │ │ └── checker.png │ └── js │ │ └── scale.fix.js ├── caffe.html ├── compiler_error.html ├── config.rb ├── configure_network.html ├── css │ ├── bootstrap.min.css │ ├── boxshadowproperties.css │ ├── customstyles.css │ ├── font-awesome.min.css │ ├── modern-business.css │ ├── printstyles.css │ ├── syntax.css │ ├── theme-blue.css │ └── theme-green.css ├── docker.html ├── docker_proxy.html ├── examples.html ├── fonts │ ├── IntelClear-Bold-webfont.eot │ ├── IntelClear-Bold-webfont.ttf │ ├── IntelClear-Bold-webfont.woff │ ├── IntelClear-Light-webfont.eot │ ├── IntelClear-Light-webfont.ttf │ ├── IntelClear-Light-webfont.woff │ ├── IntelClear-Regular-webfont.eot │ ├── IntelClear-Regular-webfont.ttf │ ├── IntelClear-Regular-webfont.woff │ ├── Intelicon.eot │ ├── Intelicon.svg │ ├── Intelicon.ttf │ ├── Intelicon.woff │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff ├── images │ ├── GoogLeNet_gv.png │ ├── NCS1_ArchDiagram.jpg │ ├── favicon.ico │ ├── freezegraph_diagram.jpg │ ├── ncs_plugged.jpg │ ├── ncs_workflow.jpg │ └── python_api_class_diagram.jpg ├── index.html ├── install.html ├── jekyll-theme-modernist.gemspec ├── js │ ├── customscripts.js │ ├── jekyll-search.js │ ├── jquery.ba-throttle-debounce.min.js │ ├── jquery.navgoco.min.js │ ├── jquery.shuffle.min.js │ └── toc.js ├── licenses │ ├── LICENSE │ └── LICENSE-BSD-NAVGOCO.txt ├── ncapi │ ├── c_api_migration.html │ ├── ncapi1 │ │ ├── c_api │ │ │ ├── mvncAllocateGraph.html │ │ │ ├── mvncCloseDevice.html │ │ │ ├── mvncDeallocateGraph.html │ │ │ ├── mvncDeviceOptions.html │ │ │ ├── mvncGetDeviceName.html │ │ │ ├── mvncGetDeviceOption.html │ │ │ ├── mvncGetGlobalOption.html │ │ │ ├── mvncGetGraphOption.html │ │ │ ├── mvncGetResult.html │ │ │ ├── mvncGlobalOptions.html │ │ │ ├── mvncGraphOptions.html │ │ │ ├── mvncLoadTensor.html │ │ │ ├── mvncOpenDevice.html │ │ │ ├── mvncSetDeviceOption.html │ │ │ ├── mvncSetGlobalOption.html │ │ │ ├── mvncSetGraphOption.html │ │ │ ├── mvncStatus.html │ │ │ └── readme.html │ │ ├── py_api │ │ │ ├── Device.AllocateGraph.html │ │ │ ├── Device.CloseDevice.html │ │ │ ├── Device.GetDeviceOption.html │ │ │ ├── Device.OpenDevice.html │ │ │ ├── Device.SetDeviceOption.html │ │ │ ├── Device.__init__.html │ │ │ ├── Device.html │ │ │ ├── DeviceOption.html │ │ │ ├── EnumerateDevices.html │ │ │ ├── GetGlobalOption.html │ │ │ ├── GlobalOption.html │ │ │ ├── Graph.DeallocateGraph.html │ │ │ ├── Graph.GetGraphOption.html │ │ │ ├── Graph.GetResult.html │ │ │ ├── Graph.LoadTensor.html │ │ │ ├── Graph.SetGraphOption.html │ │ │ ├── Graph.html │ │ │ ├── GraphOption.html │ │ │ ├── SetGlobalOption.html │ │ │ ├── Status.html │ │ │ └── readme.html │ │ └── readme.html │ ├── ncapi2 │ │ ├── c_api │ │ │ ├── ncDeviceClose.html │ │ │ ├── ncDeviceCreate.html │ │ │ ├── ncDeviceDestroy.html │ │ │ ├── ncDeviceGetOption.html │ │ │ ├── ncDeviceHandle_t.html │ │ │ ├── ncDeviceHwVersion_t.html │ │ │ ├── ncDeviceOpen.html │ │ │ ├── ncDeviceOption_t.html │ │ │ ├── ncDeviceSetOption.html │ │ │ ├── ncDeviceState_t.html │ │ │ ├── ncFifoAllocate.html │ │ │ ├── ncFifoCreate.html │ │ │ ├── ncFifoDataType_t.html │ │ │ ├── ncFifoDestroy.html │ │ │ ├── ncFifoGetOption.html │ │ │ ├── ncFifoHandle_t.html │ │ │ ├── ncFifoOption_t.html │ │ │ ├── ncFifoReadElem.html │ │ │ ├── ncFifoRemoveElem.html │ │ │ ├── ncFifoSetOption.html │ │ │ ├── ncFifoState_t.html │ │ │ ├── ncFifoType_t.html │ │ │ ├── ncFifoWriteElem.html │ │ │ ├── ncGlobalGetOption.html │ │ │ ├── ncGlobalOption_t.html │ │ │ ├── ncGlobalSetOption.html │ │ │ ├── ncGraphAllocate.html │ │ │ ├── ncGraphAllocateWithFifos.html │ │ │ ├── ncGraphAllocateWithFifosEx.html │ │ │ ├── ncGraphCreate.html │ │ │ ├── ncGraphDestroy.html │ │ │ ├── ncGraphGetOption.html │ │ │ ├── ncGraphHandle_t.html │ │ │ ├── ncGraphOption_t.html │ │ │ ├── ncGraphQueueInference.html │ │ │ ├── ncGraphQueueInferenceWithFifoElem.html │ │ │ ├── ncGraphSetOption.html │ │ │ ├── ncGraphState_t.html │ │ │ ├── ncLogLevel_t.html │ │ │ ├── ncStatus_t.html │ │ │ ├── ncTensorDescriptor_t.html │ │ │ └── readme.html │ │ ├── py_api │ │ │ ├── Device.close.html │ │ │ ├── Device.destroy.html │ │ │ ├── Device.get_option.html │ │ │ ├── Device.html │ │ │ ├── Device.open.html │ │ │ ├── Device.set_option.html │ │ │ ├── DeviceHwVersion.html │ │ │ ├── DeviceOption.html │ │ │ ├── DeviceState.html │ │ │ ├── Fifo.allocate.html │ │ │ ├── Fifo.destroy.html │ │ │ ├── Fifo.get_option.html │ │ │ ├── Fifo.html │ │ │ ├── Fifo.read_elem.html │ │ │ ├── Fifo.remove_elem.html │ │ │ ├── Fifo.set_option.html │ │ │ ├── Fifo.write_elem.html │ │ │ ├── FifoDataType.html │ │ │ ├── FifoOption.html │ │ │ ├── FifoState.html │ │ │ ├── FifoType.html │ │ │ ├── GlobalOption.html │ │ │ ├── Graph.allocate.html │ │ │ ├── Graph.allocate_with_fifos.html │ │ │ ├── Graph.destroy.html │ │ │ ├── Graph.get_option.html │ │ │ ├── Graph.html │ │ │ ├── Graph.queue_inference.html │ │ │ ├── Graph.queue_inference_with_fifo_elem.html │ │ │ ├── Graph.set_option.html │ │ │ ├── GraphOption.html │ │ │ ├── GraphState.html │ │ │ ├── LogLevel.html │ │ │ ├── Status.html │ │ │ ├── TensorDescriptor.html │ │ │ ├── enumerate_devices.html │ │ │ ├── global_get_option.html │ │ │ ├── global_set_option.html │ │ │ └── readme.html │ │ └── readme.html │ ├── python_api_migration.html │ └── readme.html ├── ncs.html ├── readme.md ├── release_notes.html ├── search.json ├── sitemap.xml ├── support.html ├── tensorflow.html ├── tf_compile_guidance.html ├── tf_modelzoo.html ├── tf_slim.html ├── thumbnail.png ├── tools │ ├── check.html │ ├── compile.html │ ├── profile.html │ └── tools_overview.html ├── virtualenv.html └── vm_config.html ├── examples ├── Makefile ├── README.md ├── apps │ ├── Makefile │ ├── README.md │ ├── hello_ncs_cpp │ │ ├── Makefile │ │ ├── cpp │ │ │ └── hello_ncs.cpp │ │ └── readme.md │ ├── hello_ncs_py │ │ ├── Makefile │ │ ├── hello_ncs.py │ │ └── readme.md │ └── multistick_cpp │ │ ├── Makefile │ │ ├── cpp │ │ ├── fp16.c │ │ ├── fp16.h │ │ ├── multistick.cpp │ │ ├── stb_image.h │ │ └── stb_image_resize.h │ │ └── readme.md ├── caffe │ ├── AlexNet │ │ ├── Makefile │ │ ├── README.md │ │ ├── cpp │ │ │ ├── build.sh │ │ │ ├── fp16.c │ │ │ ├── fp16.h │ │ │ ├── run.cpp │ │ │ ├── stb_image.h │ │ │ └── stb_image_resize.h │ │ ├── input_shape.prototxt │ │ └── run.py │ ├── GoogLeNet │ │ ├── Makefile │ │ ├── README.md │ │ ├── cpp │ │ │ ├── build.sh │ │ │ ├── fp16.c │ │ │ ├── fp16.h │ │ │ ├── run.cpp │ │ │ ├── stb_image.h │ │ │ └── stb_image_resize.h │ │ ├── input_shape.prototxt │ │ └── run.py │ ├── Makefile │ └── SqueezeNet │ │ ├── Makefile │ │ ├── README.md │ │ ├── cpp │ │ ├── build.sh │ │ ├── fp16.c │ │ ├── fp16.h │ │ ├── run.cpp │ │ ├── stb_image.h │ │ └── stb_image_resize.h │ │ ├── run.py │ │ └── synset_words.txt ├── data │ ├── Makefile │ ├── ilsvrc12 │ │ └── Makefile │ └── images │ │ ├── 512_Amplifier.jpg │ │ ├── 512_Ball.jpg │ │ ├── 512_Cellphone.jpg │ │ ├── 512_ElectricGuitar.jpg │ │ ├── 512_InkjetPrinter.jpg │ │ ├── 512_LaserPrinter.jpg │ │ ├── 512_Monitor.jpg │ │ ├── 512_Phone.jpg │ │ ├── 512_Remote.jpg │ │ ├── 512_Sink.jpg │ │ ├── 512_Slippers.jpg │ │ ├── cat.jpg │ │ ├── nps_acoustic_guitar.png │ │ ├── nps_backpack.png │ │ ├── nps_baseball.png │ │ ├── nps_chair.png │ │ ├── nps_electric_guitar.png │ │ ├── nps_guac.png │ │ ├── nps_keyboard.png │ │ ├── nps_mouse.png │ │ ├── nps_mug.png │ │ └── nps_screwdriver.png └── tensorflow │ ├── Makefile │ ├── inception_v1 │ ├── Makefile │ ├── README.md │ ├── categories.txt │ ├── graph │ ├── inception-v1.py │ ├── inputsize.txt │ └── run.py │ ├── inception_v3 │ ├── Makefile │ ├── README.md │ ├── categories.txt │ ├── graph │ ├── inception-v3.py │ ├── inputsize.txt │ └── run.py │ └── readme.md ├── install-opencv.sh ├── install.sh ├── ncsdk.conf ├── uninstall-opencv.sh └── uninstall.sh /.gitignore: -------------------------------------------------------------------------------- 1 | # ignore build directories and any files in build directories 2 | # build/ 3 | 4 | # ignore any qt-creator user files for cmake projects. these are files 5 | # specific to a user and specific to qt-creator 6 | # CMakeLists.txt.user 7 | 8 | 9 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | ifneq ($(findstring movidius, $(PYTHONPATH)), movidius) 3 | export PYTHONPATH:=/opt/movidius/caffe/python:$(PYTHONPATH) 4 | endif 5 | 6 | 7 | .PHONY: help 8 | help: 9 | @echo "\nmake help starting." 10 | @echo "Make targets are:" 11 | @echo " make help - shows this message" 12 | @echo " make install - Installs the ncsdk." 13 | @echo " make examples - makes the ncsdk examples." 14 | @echo " make api - installs only the api. Ideal for RPi setup." 15 | @echo " make uninstall - uninstalls the ncsdk." 16 | @echo " make clean - removes targets and intermediate files." 17 | 18 | .PHONY: all 19 | all: install examples 20 | 21 | .PHONY: opencv 22 | opencv: 23 | ./install-opencv.sh 24 | 25 | .PHONY: uninstallopencv 26 | uninstallopencv: 27 | ./uninstall-opencv.sh 28 | 29 | .PHONY: prereqs 30 | prereqs: 31 | @sed -i 's/\r//' ncsdk.conf 32 | @if [ -e ncsdk_redirector.txt ] ; \ 33 | then \ 34 | @sed -i 's/\r//' ncsdk_redirector.txt ; \ 35 | fi 36 | 37 | @sed -i 's/\r//' install.sh 38 | @sed -i 's/\r//' uninstall.sh 39 | @sed -i 's/\r//' README.md 40 | @chmod +x install.sh 41 | @chmod +x uninstall.sh 42 | @chmod +x install-opencv.sh 43 | @chmod +x uninstall-opencv.sh 44 | 45 | .PHONY: install 46 | install: prereqs uninstallopencv 47 | @echo "\nmake install starting." 48 | ./install.sh 49 | 50 | .PHONY: uninstall 51 | uninstall: prereqs 52 | @echo "\nmake uninstall starting." 53 | ./uninstall.sh 54 | 55 | .PHONY: examples 56 | examples: prereqs opencv 57 | @echo "\nmake examples starting." 58 | (cd examples; make) 59 | 60 | .PHONY: runexamples 61 | runexamples: prereqs opencv 62 | @echo "\nmake examples starting." 63 | (cd examples; make run) 64 | 65 | .PHONY: api 66 | api: 67 | @echo "\nmake api starting." 68 | (cd api/src; make; make install) 69 | 70 | .PHONY: clean 71 | clean: 72 | @echo "\nmake clean starting." 73 | (cd examples; make clean) 74 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-aarch64/MovidiusLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/NCSDK-1.12.00.01/ncsdk-aarch64/MovidiusLogo.png -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-aarch64/api/c/libmvnc.so.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/NCSDK-1.12.00.01/ncsdk-aarch64/api/c/libmvnc.so.0 -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-aarch64/api/c/mvnc.h: -------------------------------------------------------------------------------- 1 | #ifndef __MVNC_H_INCLUDED__ 2 | #define __MVNC_H_INCLUDED__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | { 7 | #endif 8 | 9 | #define MVNC_MAX_NAME_SIZE 28 10 | 11 | typedef enum { 12 | MVNC_OK = 0, 13 | MVNC_BUSY = -1, // Device is busy, retry later 14 | MVNC_ERROR = -2, // Error communicating with the device 15 | MVNC_OUT_OF_MEMORY = -3, // Out of memory 16 | MVNC_DEVICE_NOT_FOUND = -4, // No device at the given index or name 17 | MVNC_INVALID_PARAMETERS = -5, // At least one of the given parameters is wrong 18 | MVNC_TIMEOUT = -6, // Timeout in the communication with the device 19 | MVNC_MVCMD_NOT_FOUND = -7, // The file to boot Myriad was not found 20 | MVNC_NO_DATA = -8, // No data to return, call LoadTensor first 21 | MVNC_GONE = -9, // The graph or device has been closed during the operation 22 | MVNC_UNSUPPORTED_GRAPH_FILE = -10, // The graph file version is not supported 23 | MVNC_MYRIAD_ERROR = -11, // An error has been reported by the device, use MVNC_DEBUG_INFO 24 | } mvncStatus; 25 | 26 | typedef enum { 27 | MVNC_LOG_LEVEL = 0, // Log level, int, 0 = nothing, 1 = errors, 2 = verbose 28 | } mvncGlobalOptions; 29 | 30 | typedef enum { 31 | MVNC_ITERATIONS = 0, // Number of iterations per inference, int, normally 1, not for general use 32 | MVNC_NETWORK_THROTTLE = 1, // Measure temperature once per inference instead of once per layer, int, not for general use 33 | MVNC_DONT_BLOCK = 2, // LoadTensor will return BUSY instead of blocking, GetResult will return NO_DATA, int 34 | MVNC_TIME_TAKEN = 1000, // Return time taken for inference (float *) 35 | MVNC_DEBUG_INFO = 1001, // Return debug info, string 36 | } mvncGraphOptions; 37 | 38 | typedef enum { 39 | MVNC_TEMP_LIM_LOWER = 1, // Temperature for short sleep, float, not for general use 40 | MVNC_TEMP_LIM_HIGHER = 2, // Temperature for long sleep, float, not for general use 41 | MVNC_BACKOFF_TIME_NORMAL = 3, // Normal sleep in ms, int, not for general use 42 | MVNC_BACKOFF_TIME_HIGH = 4, // Short sleep in ms, int, not for general use 43 | MVNC_BACKOFF_TIME_CRITICAL = 5, // Long sleep in ms, int, not for general use 44 | MVNC_TEMPERATURE_DEBUG = 6, // Stop on critical temperature, int, not for general use 45 | MVNC_THERMAL_STATS = 1000, // Return temperatures, float *, not for general use 46 | MVNC_OPTIMISATION_LIST = 1001, // Return optimisations list, char *, not for general use 47 | MVNC_THERMAL_THROTTLING_LEVEL = 1002, // 1=TEMP_LIM_LOWER reached, 2=TEMP_LIM_HIGHER reached 48 | } mvncDeviceOptions; 49 | 50 | mvncStatus mvncGetDeviceName(int index, char *name, unsigned int nameSize); 51 | mvncStatus mvncOpenDevice(const char *name, void **deviceHandle); 52 | mvncStatus mvncCloseDevice(void *deviceHandle); 53 | mvncStatus mvncAllocateGraph(void *deviceHandle, void **graphHandle, const void *graphFile, unsigned int graphFileLength); 54 | mvncStatus mvncDeallocateGraph(void *graphHandle); 55 | mvncStatus mvncSetGlobalOption(int option, const void *data, unsigned int dataLength); 56 | mvncStatus mvncGetGlobalOption(int option, void *data, unsigned int *dataLength); 57 | mvncStatus mvncSetGraphOption(void *graphHandle, int option, const void *data, unsigned int dataLength); 58 | mvncStatus mvncGetGraphOption(void *graphHandle, int option, void *data, unsigned int *dataLength); 59 | mvncStatus mvncSetDeviceOption(void *deviceHandle, int option, const void *data, unsigned int dataLength); 60 | mvncStatus mvncGetDeviceOption(void *deviceHandle, int option, void *data, unsigned int *dataLength); 61 | mvncStatus mvncLoadTensor(void *graphHandle, const void *inputTensor, unsigned int inputTensorLength, void *userParam); 62 | mvncStatus mvncGetResult(void *graphHandle, void **outputData, unsigned int *outputDataLength, void **userParam); 63 | 64 | #include "mvnc_deprecated.h" 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-aarch64/api/c/mvnc_deprecated.h: -------------------------------------------------------------------------------- 1 | #ifndef __MVNC_DEPRECATED_H_INCLUDED__ 2 | #define __MVNC_DEPRECATED_H_INCLUDED__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | { 7 | #endif 8 | 9 | typedef mvncGraphOptions GraphOptions __attribute__ \ 10 | ((deprecated("GraphOptions is deprecated. Please use mvncGraphOptions"))); 11 | typedef mvncDeviceOptions DeviceOptions __attribute__ \ 12 | ((deprecated("DeviceOptions is deprecated. Please use mvncDeviceOptions"))); 13 | 14 | // Deprecated Define 15 | #define MVNC_MAXNAMESIZE _Pragma("GCC warning \"'MVNC_MAXNAMESIZE' is deprecated. Please use 'MVNC_MAX_NAME_SIZE'\"") MVNC_MAX_NAME_SIZE 16 | 17 | // Deprecated Global Options 18 | #define MVNC_LOGLEVEL _Pragma("GCC warning \"'MVNC_LOGLEVEL' is deprecated. Please use 'MVNC_LOG_LEVEL'\"") MVNC_LOG_LEVEL 19 | 20 | // Deprecated status values 21 | #define MVNC_MVCMDNOTFOUND _Pragma("GCC warning \"'MVNC_MVCMDNOTFOUND' is deprecated. Please use 'MVNC_MVCMD_NOT_FOUND'\"") MVNC_MVCMD_NOT_FOUND 22 | #define MVNC_NODATA _Pragma("GCC warning \"'MVNC_NO_DATA' is deprecated. Please use 'MVNC_NO_DATA'\"") MVNC_NO_DATA 23 | #define MVNC_UNSUPPORTEDGRAPHFILE _Pragma("GCC warning \"'MVNC_UNSUPPORTEDGRAPHFILE' is deprecated. Please use 'MVNC_UNSUPPORTED_GRAPH_FILE'\"") MVNC_UNSUPPORTED_GRAPH_FILE 24 | #define MVNC_MYRIADERROR _Pragma("GCC warning \"'MVNC_MYRIADERROR' is deprecated. Please use 'MVNC_MYRIAD_ERROR'\"") MVNC_MYRIAD_ERROR 25 | 26 | // Deprecated Graph Options values 27 | #define MVNC_DONTBLOCK _Pragma("GCC warning \"'MVNC_DONTBLOCK' is deprecated. Please use 'MVNC_DONT_BLOCK'\"") MVNC_DONT_BLOCK 28 | #define MVNC_TIMETAKEN _Pragma("GCC warning \"'MVNC_TIMETAKEN' is deprecated. Please use 'MVNC_TIME_TAKEN'\"") MVNC_TIME_TAKEN 29 | #define MVNC_DEBUGINFO _Pragma("GCC warning \"'MVNC_DEBUGINFO' is deprecated. Please use 'MVNC_DEBUG_INFO'\"") MVNC_DEBUG_INFO 30 | 31 | // Deprecated Device Options Values 32 | #define MVNC_THERMALSTATS _Pragma("GCC warning \"'MVNC_THERMALSTATS' is deprecated. Please use 'MVNC_THERMAL_STATS'\"") MVNC_THERMAL_STATS 33 | #define MVNC_OPTIMISATIONLIST _Pragma("GCC warning \"'MVNC_OPTIMISATIONLIST' is deprecated. Please use 'MVNC_OPTIMISATION_LIST'\"") MVNC_OPTIMISATION_LIST 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-aarch64/api/python/mvnc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/NCSDK-1.12.00.01/ncsdk-aarch64/api/python/mvnc/__init__.py -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-aarch64/api/setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | import shutil 3 | from setuptools import setup, find_packages 4 | 5 | setup( 6 | name = "mvnc", 7 | version = "1.12.00.01", 8 | author = "Intel Corporation", 9 | description = ("mvnc python api"), 10 | license="None", 11 | keywords = "", 12 | url = "http://developer.movidius.com", 13 | packages=['mvnc'], 14 | package_dir={'mvnc': 'python/mvnc'}, 15 | long_description="-", 16 | classifiers=[ 17 | "Development Status :: 5 - Production/Stable", 18 | "Topic :: Software Development :: Libraries", 19 | "License :: Other/Proprietary License", 20 | ], 21 | ) 22 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-aarch64/fw/MvNCAPI.mvcmd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/NCSDK-1.12.00.01/ncsdk-aarch64/fw/MvNCAPI.mvcmd -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-aarch64/tk/Models/Blob.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Intel Corporation. 2 | # The source code, information and material ("Material") contained herein is 3 | # owned by Intel Corporation or its suppliers or licensors, and title to such 4 | # Material remains with Intel Corporation or its suppliers or licensors. 5 | # The Material contains proprietary information of Intel or its suppliers and 6 | # licensors. The Material is protected by worldwide copyright laws and treaty 7 | # provisions. 8 | # No part of the Material may be used, copied, reproduced, modified, published, 9 | # uploaded, posted, transmitted, distributed or disclosed in any way without 10 | # Intel's prior express written permission. No license under any patent, 11 | # copyright or other intellectual property rights in the Material is granted to 12 | # or conferred upon you, either expressly, by implication, inducement, estoppel 13 | # or otherwise. 14 | # Any license under such intellectual property rights must be express and 15 | # approved by Intel in writing. 16 | 17 | import numpy as np 18 | from ctypes import * 19 | from Controllers.MiscIO import * 20 | from Controllers.FileIO import * 21 | import sys 22 | 23 | 24 | class Blob: 25 | def __init__( 26 | self, 27 | version, 28 | name, 29 | report_dir, 30 | myriad_params, 31 | network, 32 | blob_name): 33 | """ 34 | This object contains all the information required for a blob file + some additional info for processing. 35 | :param version: The version of the toolkit used to generate this blob. Useful for the potential of 36 | having backwards compatibility - although it's easier to regenerate your file. 37 | :param name: Name of the network represented in the blob file 38 | :param report_dir: Where to output our reports (Note: TODO) 39 | :param myriad_params: Myriad configurations (Note: TODO) 40 | :param network: A Network object to attach to the blob. 41 | :return: 42 | """ 43 | self.version = c_uint32(version) 44 | self.filesize = c_uint32(16) 45 | self.name = set_string_range(name, 100).encode('ascii') 46 | self.report_dir = set_string_range(report_dir, 100).encode('ascii') 47 | self.myriad_params = myriad_params 48 | self.network = network 49 | self.stage_count = c_uint32(self.network.count) 50 | self.VCS_Fix = True 51 | self.blob_name = blob_name 52 | 53 | def generate(self): 54 | """ 55 | Generates the actual blob file. 56 | :return: 57 | """ 58 | with open(self.blob_name, 'wb') as f: 59 | if self.VCS_Fix: 60 | f.write(c_uint64(0)) # VCS incorrectly reads first 16 Bytes 61 | f.write(c_uint64(0)) # VCS incorrectly reads first 16 Bytes 62 | f.write(c_uint64(0)) # VCS incorrectly reads first 16 Bytes 63 | f.write(c_uint64(0)) # VCS incorrectly reads first 16 Bytes 64 | f.write(estimate_file_size(self)) 65 | f.write(self.version) 66 | 67 | f.write(self.name) 68 | f.write(self.report_dir) 69 | f.write(self.stage_count) 70 | f.write(get_buffer_start(self)) # Size of a network element. 71 | self.myriad_params.generate(f) 72 | self.network.generate_info(f) 73 | self.network.generate_data(f) 74 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-aarch64/tk/Models/CaffeEnumDeclarations.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Intel Corporation. 2 | # The source code, information and material ("Material") contained herein is 3 | # owned by Intel Corporation or its suppliers or licensors, and title to such 4 | # Material remains with Intel Corporation or its suppliers or licensors. 5 | # The Material contains proprietary information of Intel or its suppliers and 6 | # licensors. The Material is protected by worldwide copyright laws and treaty 7 | # provisions. 8 | # No part of the Material may be used, copied, reproduced, modified, published, 9 | # uploaded, posted, transmitted, distributed or disclosed in any way without 10 | # Intel's prior express written permission. No license under any patent, 11 | # copyright or other intellectual property rights in the Material is granted to 12 | # or conferred upon you, either expressly, by implication, inducement, estoppel 13 | # or otherwise. 14 | # Any license under such intellectual property rights must be express and 15 | # approved by Intel in writing. 16 | 17 | from enum import Enum 18 | 19 | """ 20 | This is so we can support Network Descriptions which use internal Caffe enums 21 | instead of strings 22 | """ 23 | 24 | 25 | class CaffeStage(Enum): 26 | NONE = 0 27 | ABSVAL = 35 28 | ACCURACY = 1 29 | ARGMAX = 30 30 | BNLL = 2 31 | CONCAT = 3 32 | CONTRASTIVE_LOSS = 37 33 | CONVOLUTION = 4 34 | DATA = 5 35 | DECONVOLUTION = 39 36 | DROPOUT = 6 37 | DUMMY_DATA = 32 38 | EUCLIDEAN_LOSS = 7 39 | ELTWISE = 25 40 | EXP = 38 41 | FLATTEN = 8 42 | HDF5_DATA = 9 43 | HDF5_OUTPUT = 10 44 | HINGE_LOSS = 28 45 | IM2COL = 11 46 | IMAGE_DATA = 12 47 | INFOGAIN_LOSS = 13 48 | INNER_PRODUCT = 14 49 | LRN = 15 50 | MEMORY_DATA = 29 51 | MULTINOMIAL_LOGISTIC_LOSS = 16 52 | MVN = 34 53 | POOLING = 17 54 | POWER = 26 55 | RELU = 18 56 | SIGMOID = 19 57 | SIGMOID_CROSS_ENTROPY_LOSS = 27 58 | SILENCE = 36 59 | SOFTMAX = 20 60 | SOFTMAX_LOSS = 21 61 | SPLIT = 22 62 | SLICE = 33 63 | TANH = 23 64 | WINDOW_DATA = 24 65 | THRESHOLD = 31 66 | RESHAPE = 40 67 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-aarch64/tk/Models/MyriadParam.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Intel Corporation. 2 | # The source code, information and material ("Material") contained herein is 3 | # owned by Intel Corporation or its suppliers or licensors, and title to such 4 | # Material remains with Intel Corporation or its suppliers or licensors. 5 | # The Material contains proprietary information of Intel or its suppliers and 6 | # licensors. The Material is protected by worldwide copyright laws and treaty 7 | # provisions. 8 | # No part of the Material may be used, copied, reproduced, modified, published, 9 | # uploaded, posted, transmitted, distributed or disclosed in any way without 10 | # Intel's prior express written permission. No license under any patent, 11 | # copyright or other intellectual property rights in the Material is granted to 12 | # or conferred upon you, either expressly, by implication, inducement, estoppel 13 | # or otherwise. 14 | # Any license under such intellectual property rights must be express and 15 | # approved by Intel in writing. 16 | 17 | import numpy as np 18 | from ctypes import * 19 | from Controllers.MiscIO import * 20 | 21 | 22 | class MyriadParam: 23 | def __init__(self, fs=0, ls=1, optimization_list=None): 24 | """ 25 | Constructor for our myriad definitions 26 | :param fs: first shave to be used 27 | :param ls: last shave in range 28 | :return: 29 | """ 30 | self.firstShave = c_ushort(fs) 31 | self.lastShave = c_ushort(ls) 32 | self.leonMemLocation = c_uint(0) 33 | self.leonMemSize = c_uint(0) 34 | self.dmaAgent = c_uint(0) 35 | self.optimization_list = optimization_list 36 | 37 | def generate(self, f): 38 | """ 39 | Write to file. 40 | 41 | :param f: 42 | :return: 43 | """ 44 | f.write(self.firstShave) 45 | f.write(self.lastShave) 46 | f.write(self.leonMemLocation) 47 | f.write(self.leonMemSize) 48 | f.write(self.dmaAgent) 49 | 50 | def binary_size(self): 51 | """ 52 | get binary size of this element when written to file. 53 | :return: 54 | """ 55 | file_size = byte_size(self.firstShave) 56 | assert file_size == 0x2, "Blob format modified, please change the " +\ 57 | "FathomRun/tests/per_layer_tests/util/generate_test_data.py file" 58 | file_size += byte_size(self.lastShave) 59 | file_size += byte_size(self.leonMemLocation) 60 | file_size += byte_size(self.leonMemSize) 61 | file_size += byte_size(self.dmaAgent) 62 | return file_size 63 | 64 | def display_opts(self): 65 | print("\nAvailable Optimizations:") 66 | [print("* " + str(x)) for x in self.optimization_list] 67 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-aarch64/tk/Views/Summary.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Intel Corporation. 2 | # The source code, information and material ("Material") contained herein is 3 | # owned by Intel Corporation or its suppliers or licensors, and title to such 4 | # Material remains with Intel Corporation or its suppliers or licensors. 5 | # The Material contains proprietary information of Intel or its suppliers and 6 | # licensors. The Material is protected by worldwide copyright laws and treaty 7 | # provisions. 8 | # No part of the Material may be used, copied, reproduced, modified, published, 9 | # uploaded, posted, transmitted, distributed or disclosed in any way without 10 | # Intel's prior express written permission. No license under any patent, 11 | # copyright or other intellectual property rights in the Material is granted to 12 | # or conferred upon you, either expressly, by implication, inducement, estoppel 13 | # or otherwise. 14 | # Any license under such intellectual property rights must be express and 15 | # approved by Intel in writing. 16 | 17 | from Models.EnumDeclarations import * 18 | import math 19 | import shutil 20 | 21 | g_total_time = 0 22 | number = 0 23 | 24 | 25 | def print_summary_of_nodes( 26 | node, 27 | w_stages, 28 | w_terminal, 29 | w_layer, 30 | w_float, 31 | w_name): 32 | """ 33 | Commandline print of nodes and their statistics. 34 | :param number: 35 | :param node: 36 | :return: 37 | """ 38 | global g_total_time 39 | global number 40 | 41 | formatted_name = node.unprocessed_name[slice(-w_name, None)] 42 | if len(node.unprocessed_name) > w_name: 43 | formatted_name = '...' + formatted_name[3:] 44 | print("{}{}{}{}{}".format( 45 | ("{}".format(str(number)).ljust(w_layer)), 46 | ("{}".format(formatted_name).ljust(w_name)), 47 | ("{:6.1f}".format(node.flops).rjust(w_float)), 48 | ("{:6.1f}".format(node.BWs).rjust(w_float)), 49 | ("{:4.3f}".format(node.ms).rjust(w_float)))) 50 | 51 | number += 1 52 | g_total_time += node.ms 53 | 54 | 55 | def print_summary_of_network(blob_file): 56 | """ 57 | Print timings related to the flattened blob file. 58 | :param blob_file: 59 | :return: 60 | """ 61 | global g_total_time 62 | 63 | # Formatting parameters 64 | w_stages = math.ceil(math.log10(len(blob_file.network.stageslist))) 65 | w_terminal = shutil.get_terminal_size()[0] 66 | w_layer = w_stages + 3 67 | w_float = 8 68 | w_name = w_terminal - w_layer - 3 * w_float - 1 69 | w_total = w_layer + w_name + 3 * w_float 70 | 71 | print("Network Summary") 72 | 73 | if False: # == NetworkLimitation.DDR_Speed_Bound: # Compare to something 74 | print("This network is bound by the speed of DDR. Consider using smaller datatypes or reducing your data size.") 75 | 76 | print("\nDetailed Per Layer Profile") 77 | 78 | # Header 79 | print( 80 | "{}{}{}{}{}\n{}{}{}{}{}".format( 81 | ''.ljust(w_layer), 82 | ''.ljust(w_name), 83 | ''.rjust(w_float), 84 | 'Bandwidth'.rjust(w_float), 85 | 'time'.rjust( 86 | w_float - 1), 87 | '#'.ljust(w_layer), 88 | 'Name'.ljust(w_name), 89 | 'MFLOPs'.rjust(w_float), 90 | '(MB/s)'.rjust(w_float), 91 | '(ms)'.rjust(w_float))) 92 | print(''.join(['=' for i in range(w_total)])) 93 | 94 | # Layers 95 | for stage in blob_file.network.stageslist: 96 | print_summary_of_nodes( 97 | stage, 98 | w_stages, 99 | w_terminal, 100 | w_layer, 101 | w_float, 102 | w_name) 103 | 104 | # Footer 105 | print(''.join(['-' for i in range(w_total)])) 106 | print( 107 | '{}{}'.format( 108 | 'Total inference time'.rjust( 109 | w_layer + w_name), 110 | '{:.2f}'.format(g_total_time).rjust( 111 | 3 * w_float))) 112 | print(''.join(['-' for i in range(w_total)])) 113 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-aarch64/udev/97-usbboot.rules: -------------------------------------------------------------------------------- 1 | SUBSYSTEM=="usb", ATTRS{idProduct}=="2150", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1" 2 | SUBSYSTEM=="usb", ATTRS{idProduct}=="f63b", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1" 3 | SUBSYSTEM=="tty", ATTRS{idProduct}=="2150", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1" 4 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-armv7l/MovidiusLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/NCSDK-1.12.00.01/ncsdk-armv7l/MovidiusLogo.png -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-armv7l/api/c/libmvnc.so.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/NCSDK-1.12.00.01/ncsdk-armv7l/api/c/libmvnc.so.0 -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-armv7l/api/c/mvnc.h: -------------------------------------------------------------------------------- 1 | #ifndef __MVNC_H_INCLUDED__ 2 | #define __MVNC_H_INCLUDED__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | { 7 | #endif 8 | 9 | #define MVNC_MAX_NAME_SIZE 28 10 | 11 | typedef enum { 12 | MVNC_OK = 0, 13 | MVNC_BUSY = -1, // Device is busy, retry later 14 | MVNC_ERROR = -2, // Error communicating with the device 15 | MVNC_OUT_OF_MEMORY = -3, // Out of memory 16 | MVNC_DEVICE_NOT_FOUND = -4, // No device at the given index or name 17 | MVNC_INVALID_PARAMETERS = -5, // At least one of the given parameters is wrong 18 | MVNC_TIMEOUT = -6, // Timeout in the communication with the device 19 | MVNC_MVCMD_NOT_FOUND = -7, // The file to boot Myriad was not found 20 | MVNC_NO_DATA = -8, // No data to return, call LoadTensor first 21 | MVNC_GONE = -9, // The graph or device has been closed during the operation 22 | MVNC_UNSUPPORTED_GRAPH_FILE = -10, // The graph file version is not supported 23 | MVNC_MYRIAD_ERROR = -11, // An error has been reported by the device, use MVNC_DEBUG_INFO 24 | } mvncStatus; 25 | 26 | typedef enum { 27 | MVNC_LOG_LEVEL = 0, // Log level, int, 0 = nothing, 1 = errors, 2 = verbose 28 | } mvncGlobalOptions; 29 | 30 | typedef enum { 31 | MVNC_ITERATIONS = 0, // Number of iterations per inference, int, normally 1, not for general use 32 | MVNC_NETWORK_THROTTLE = 1, // Measure temperature once per inference instead of once per layer, int, not for general use 33 | MVNC_DONT_BLOCK = 2, // LoadTensor will return BUSY instead of blocking, GetResult will return NO_DATA, int 34 | MVNC_TIME_TAKEN = 1000, // Return time taken for inference (float *) 35 | MVNC_DEBUG_INFO = 1001, // Return debug info, string 36 | } mvncGraphOptions; 37 | 38 | typedef enum { 39 | MVNC_TEMP_LIM_LOWER = 1, // Temperature for short sleep, float, not for general use 40 | MVNC_TEMP_LIM_HIGHER = 2, // Temperature for long sleep, float, not for general use 41 | MVNC_BACKOFF_TIME_NORMAL = 3, // Normal sleep in ms, int, not for general use 42 | MVNC_BACKOFF_TIME_HIGH = 4, // Short sleep in ms, int, not for general use 43 | MVNC_BACKOFF_TIME_CRITICAL = 5, // Long sleep in ms, int, not for general use 44 | MVNC_TEMPERATURE_DEBUG = 6, // Stop on critical temperature, int, not for general use 45 | MVNC_THERMAL_STATS = 1000, // Return temperatures, float *, not for general use 46 | MVNC_OPTIMISATION_LIST = 1001, // Return optimisations list, char *, not for general use 47 | MVNC_THERMAL_THROTTLING_LEVEL = 1002, // 1=TEMP_LIM_LOWER reached, 2=TEMP_LIM_HIGHER reached 48 | } mvncDeviceOptions; 49 | 50 | mvncStatus mvncGetDeviceName(int index, char *name, unsigned int nameSize); 51 | mvncStatus mvncOpenDevice(const char *name, void **deviceHandle); 52 | mvncStatus mvncCloseDevice(void *deviceHandle); 53 | mvncStatus mvncAllocateGraph(void *deviceHandle, void **graphHandle, const void *graphFile, unsigned int graphFileLength); 54 | mvncStatus mvncDeallocateGraph(void *graphHandle); 55 | mvncStatus mvncSetGlobalOption(int option, const void *data, unsigned int dataLength); 56 | mvncStatus mvncGetGlobalOption(int option, void *data, unsigned int *dataLength); 57 | mvncStatus mvncSetGraphOption(void *graphHandle, int option, const void *data, unsigned int dataLength); 58 | mvncStatus mvncGetGraphOption(void *graphHandle, int option, void *data, unsigned int *dataLength); 59 | mvncStatus mvncSetDeviceOption(void *deviceHandle, int option, const void *data, unsigned int dataLength); 60 | mvncStatus mvncGetDeviceOption(void *deviceHandle, int option, void *data, unsigned int *dataLength); 61 | mvncStatus mvncLoadTensor(void *graphHandle, const void *inputTensor, unsigned int inputTensorLength, void *userParam); 62 | mvncStatus mvncGetResult(void *graphHandle, void **outputData, unsigned int *outputDataLength, void **userParam); 63 | 64 | #include "mvnc_deprecated.h" 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-armv7l/api/c/mvnc_deprecated.h: -------------------------------------------------------------------------------- 1 | #ifndef __MVNC_DEPRECATED_H_INCLUDED__ 2 | #define __MVNC_DEPRECATED_H_INCLUDED__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | { 7 | #endif 8 | 9 | typedef mvncGraphOptions GraphOptions __attribute__ \ 10 | ((deprecated("GraphOptions is deprecated. Please use mvncGraphOptions"))); 11 | typedef mvncDeviceOptions DeviceOptions __attribute__ \ 12 | ((deprecated("DeviceOptions is deprecated. Please use mvncDeviceOptions"))); 13 | 14 | // Deprecated Define 15 | #define MVNC_MAXNAMESIZE _Pragma("GCC warning \"'MVNC_MAXNAMESIZE' is deprecated. Please use 'MVNC_MAX_NAME_SIZE'\"") MVNC_MAX_NAME_SIZE 16 | 17 | // Deprecated Global Options 18 | #define MVNC_LOGLEVEL _Pragma("GCC warning \"'MVNC_LOGLEVEL' is deprecated. Please use 'MVNC_LOG_LEVEL'\"") MVNC_LOG_LEVEL 19 | 20 | // Deprecated status values 21 | #define MVNC_MVCMDNOTFOUND _Pragma("GCC warning \"'MVNC_MVCMDNOTFOUND' is deprecated. Please use 'MVNC_MVCMD_NOT_FOUND'\"") MVNC_MVCMD_NOT_FOUND 22 | #define MVNC_NODATA _Pragma("GCC warning \"'MVNC_NO_DATA' is deprecated. Please use 'MVNC_NO_DATA'\"") MVNC_NO_DATA 23 | #define MVNC_UNSUPPORTEDGRAPHFILE _Pragma("GCC warning \"'MVNC_UNSUPPORTEDGRAPHFILE' is deprecated. Please use 'MVNC_UNSUPPORTED_GRAPH_FILE'\"") MVNC_UNSUPPORTED_GRAPH_FILE 24 | #define MVNC_MYRIADERROR _Pragma("GCC warning \"'MVNC_MYRIADERROR' is deprecated. Please use 'MVNC_MYRIAD_ERROR'\"") MVNC_MYRIAD_ERROR 25 | 26 | // Deprecated Graph Options values 27 | #define MVNC_DONTBLOCK _Pragma("GCC warning \"'MVNC_DONTBLOCK' is deprecated. Please use 'MVNC_DONT_BLOCK'\"") MVNC_DONT_BLOCK 28 | #define MVNC_TIMETAKEN _Pragma("GCC warning \"'MVNC_TIMETAKEN' is deprecated. Please use 'MVNC_TIME_TAKEN'\"") MVNC_TIME_TAKEN 29 | #define MVNC_DEBUGINFO _Pragma("GCC warning \"'MVNC_DEBUGINFO' is deprecated. Please use 'MVNC_DEBUG_INFO'\"") MVNC_DEBUG_INFO 30 | 31 | // Deprecated Device Options Values 32 | #define MVNC_THERMALSTATS _Pragma("GCC warning \"'MVNC_THERMALSTATS' is deprecated. Please use 'MVNC_THERMAL_STATS'\"") MVNC_THERMAL_STATS 33 | #define MVNC_OPTIMISATIONLIST _Pragma("GCC warning \"'MVNC_OPTIMISATIONLIST' is deprecated. Please use 'MVNC_OPTIMISATION_LIST'\"") MVNC_OPTIMISATION_LIST 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-armv7l/api/python/mvnc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/NCSDK-1.12.00.01/ncsdk-armv7l/api/python/mvnc/__init__.py -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-armv7l/api/setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | import shutil 3 | from setuptools import setup, find_packages 4 | 5 | setup( 6 | name = "mvnc", 7 | version = "1.12.00.01", 8 | author = "Intel Corporation", 9 | description = ("mvnc python api"), 10 | license="None", 11 | keywords = "", 12 | url = "http://developer.movidius.com", 13 | packages=['mvnc'], 14 | package_dir={'mvnc': 'python/mvnc'}, 15 | long_description="-", 16 | classifiers=[ 17 | "Development Status :: 5 - Production/Stable", 18 | "Topic :: Software Development :: Libraries", 19 | "License :: Other/Proprietary License", 20 | ], 21 | ) 22 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-armv7l/fw/MvNCAPI.mvcmd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/NCSDK-1.12.00.01/ncsdk-armv7l/fw/MvNCAPI.mvcmd -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-armv7l/tk/Models/Blob.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Intel Corporation. 2 | # The source code, information and material ("Material") contained herein is 3 | # owned by Intel Corporation or its suppliers or licensors, and title to such 4 | # Material remains with Intel Corporation or its suppliers or licensors. 5 | # The Material contains proprietary information of Intel or its suppliers and 6 | # licensors. The Material is protected by worldwide copyright laws and treaty 7 | # provisions. 8 | # No part of the Material may be used, copied, reproduced, modified, published, 9 | # uploaded, posted, transmitted, distributed or disclosed in any way without 10 | # Intel's prior express written permission. No license under any patent, 11 | # copyright or other intellectual property rights in the Material is granted to 12 | # or conferred upon you, either expressly, by implication, inducement, estoppel 13 | # or otherwise. 14 | # Any license under such intellectual property rights must be express and 15 | # approved by Intel in writing. 16 | 17 | import numpy as np 18 | from ctypes import * 19 | from Controllers.MiscIO import * 20 | from Controllers.FileIO import * 21 | import sys 22 | 23 | 24 | class Blob: 25 | def __init__( 26 | self, 27 | version, 28 | name, 29 | report_dir, 30 | myriad_params, 31 | network, 32 | blob_name): 33 | """ 34 | This object contains all the information required for a blob file + some additional info for processing. 35 | :param version: The version of the toolkit used to generate this blob. Useful for the potential of 36 | having backwards compatibility - although it's easier to regenerate your file. 37 | :param name: Name of the network represented in the blob file 38 | :param report_dir: Where to output our reports (Note: TODO) 39 | :param myriad_params: Myriad configurations (Note: TODO) 40 | :param network: A Network object to attach to the blob. 41 | :return: 42 | """ 43 | self.version = c_uint32(version) 44 | self.filesize = c_uint32(16) 45 | self.name = set_string_range(name, 100).encode('ascii') 46 | self.report_dir = set_string_range(report_dir, 100).encode('ascii') 47 | self.myriad_params = myriad_params 48 | self.network = network 49 | self.stage_count = c_uint32(self.network.count) 50 | self.VCS_Fix = True 51 | self.blob_name = blob_name 52 | 53 | def generate(self): 54 | """ 55 | Generates the actual blob file. 56 | :return: 57 | """ 58 | with open(self.blob_name, 'wb') as f: 59 | if self.VCS_Fix: 60 | f.write(c_uint64(0)) # VCS incorrectly reads first 16 Bytes 61 | f.write(c_uint64(0)) # VCS incorrectly reads first 16 Bytes 62 | f.write(c_uint64(0)) # VCS incorrectly reads first 16 Bytes 63 | f.write(c_uint64(0)) # VCS incorrectly reads first 16 Bytes 64 | f.write(estimate_file_size(self)) 65 | f.write(self.version) 66 | 67 | f.write(self.name) 68 | f.write(self.report_dir) 69 | f.write(self.stage_count) 70 | f.write(get_buffer_start(self)) # Size of a network element. 71 | self.myriad_params.generate(f) 72 | self.network.generate_info(f) 73 | self.network.generate_data(f) 74 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-armv7l/tk/Models/CaffeEnumDeclarations.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Intel Corporation. 2 | # The source code, information and material ("Material") contained herein is 3 | # owned by Intel Corporation or its suppliers or licensors, and title to such 4 | # Material remains with Intel Corporation or its suppliers or licensors. 5 | # The Material contains proprietary information of Intel or its suppliers and 6 | # licensors. The Material is protected by worldwide copyright laws and treaty 7 | # provisions. 8 | # No part of the Material may be used, copied, reproduced, modified, published, 9 | # uploaded, posted, transmitted, distributed or disclosed in any way without 10 | # Intel's prior express written permission. No license under any patent, 11 | # copyright or other intellectual property rights in the Material is granted to 12 | # or conferred upon you, either expressly, by implication, inducement, estoppel 13 | # or otherwise. 14 | # Any license under such intellectual property rights must be express and 15 | # approved by Intel in writing. 16 | 17 | from enum import Enum 18 | 19 | """ 20 | This is so we can support Network Descriptions which use internal Caffe enums 21 | instead of strings 22 | """ 23 | 24 | 25 | class CaffeStage(Enum): 26 | NONE = 0 27 | ABSVAL = 35 28 | ACCURACY = 1 29 | ARGMAX = 30 30 | BNLL = 2 31 | CONCAT = 3 32 | CONTRASTIVE_LOSS = 37 33 | CONVOLUTION = 4 34 | DATA = 5 35 | DECONVOLUTION = 39 36 | DROPOUT = 6 37 | DUMMY_DATA = 32 38 | EUCLIDEAN_LOSS = 7 39 | ELTWISE = 25 40 | EXP = 38 41 | FLATTEN = 8 42 | HDF5_DATA = 9 43 | HDF5_OUTPUT = 10 44 | HINGE_LOSS = 28 45 | IM2COL = 11 46 | IMAGE_DATA = 12 47 | INFOGAIN_LOSS = 13 48 | INNER_PRODUCT = 14 49 | LRN = 15 50 | MEMORY_DATA = 29 51 | MULTINOMIAL_LOGISTIC_LOSS = 16 52 | MVN = 34 53 | POOLING = 17 54 | POWER = 26 55 | RELU = 18 56 | SIGMOID = 19 57 | SIGMOID_CROSS_ENTROPY_LOSS = 27 58 | SILENCE = 36 59 | SOFTMAX = 20 60 | SOFTMAX_LOSS = 21 61 | SPLIT = 22 62 | SLICE = 33 63 | TANH = 23 64 | WINDOW_DATA = 24 65 | THRESHOLD = 31 66 | RESHAPE = 40 67 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-armv7l/tk/Models/MyriadParam.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Intel Corporation. 2 | # The source code, information and material ("Material") contained herein is 3 | # owned by Intel Corporation or its suppliers or licensors, and title to such 4 | # Material remains with Intel Corporation or its suppliers or licensors. 5 | # The Material contains proprietary information of Intel or its suppliers and 6 | # licensors. The Material is protected by worldwide copyright laws and treaty 7 | # provisions. 8 | # No part of the Material may be used, copied, reproduced, modified, published, 9 | # uploaded, posted, transmitted, distributed or disclosed in any way without 10 | # Intel's prior express written permission. No license under any patent, 11 | # copyright or other intellectual property rights in the Material is granted to 12 | # or conferred upon you, either expressly, by implication, inducement, estoppel 13 | # or otherwise. 14 | # Any license under such intellectual property rights must be express and 15 | # approved by Intel in writing. 16 | 17 | import numpy as np 18 | from ctypes import * 19 | from Controllers.MiscIO import * 20 | 21 | 22 | class MyriadParam: 23 | def __init__(self, fs=0, ls=1, optimization_list=None): 24 | """ 25 | Constructor for our myriad definitions 26 | :param fs: first shave to be used 27 | :param ls: last shave in range 28 | :return: 29 | """ 30 | self.firstShave = c_ushort(fs) 31 | self.lastShave = c_ushort(ls) 32 | self.leonMemLocation = c_uint(0) 33 | self.leonMemSize = c_uint(0) 34 | self.dmaAgent = c_uint(0) 35 | self.optimization_list = optimization_list 36 | 37 | def generate(self, f): 38 | """ 39 | Write to file. 40 | 41 | :param f: 42 | :return: 43 | """ 44 | f.write(self.firstShave) 45 | f.write(self.lastShave) 46 | f.write(self.leonMemLocation) 47 | f.write(self.leonMemSize) 48 | f.write(self.dmaAgent) 49 | 50 | def binary_size(self): 51 | """ 52 | get binary size of this element when written to file. 53 | :return: 54 | """ 55 | file_size = byte_size(self.firstShave) 56 | assert file_size == 0x2, "Blob format modified, please change the " +\ 57 | "FathomRun/tests/per_layer_tests/util/generate_test_data.py file" 58 | file_size += byte_size(self.lastShave) 59 | file_size += byte_size(self.leonMemLocation) 60 | file_size += byte_size(self.leonMemSize) 61 | file_size += byte_size(self.dmaAgent) 62 | return file_size 63 | 64 | def display_opts(self): 65 | print("\nAvailable Optimizations:") 66 | [print("* " + str(x)) for x in self.optimization_list] 67 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-armv7l/tk/Views/Summary.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Intel Corporation. 2 | # The source code, information and material ("Material") contained herein is 3 | # owned by Intel Corporation or its suppliers or licensors, and title to such 4 | # Material remains with Intel Corporation or its suppliers or licensors. 5 | # The Material contains proprietary information of Intel or its suppliers and 6 | # licensors. The Material is protected by worldwide copyright laws and treaty 7 | # provisions. 8 | # No part of the Material may be used, copied, reproduced, modified, published, 9 | # uploaded, posted, transmitted, distributed or disclosed in any way without 10 | # Intel's prior express written permission. No license under any patent, 11 | # copyright or other intellectual property rights in the Material is granted to 12 | # or conferred upon you, either expressly, by implication, inducement, estoppel 13 | # or otherwise. 14 | # Any license under such intellectual property rights must be express and 15 | # approved by Intel in writing. 16 | 17 | from Models.EnumDeclarations import * 18 | import math 19 | import shutil 20 | 21 | g_total_time = 0 22 | number = 0 23 | 24 | 25 | def print_summary_of_nodes( 26 | node, 27 | w_stages, 28 | w_terminal, 29 | w_layer, 30 | w_float, 31 | w_name): 32 | """ 33 | Commandline print of nodes and their statistics. 34 | :param number: 35 | :param node: 36 | :return: 37 | """ 38 | global g_total_time 39 | global number 40 | 41 | formatted_name = node.unprocessed_name[slice(-w_name, None)] 42 | if len(node.unprocessed_name) > w_name: 43 | formatted_name = '...' + formatted_name[3:] 44 | print("{}{}{}{}{}".format( 45 | ("{}".format(str(number)).ljust(w_layer)), 46 | ("{}".format(formatted_name).ljust(w_name)), 47 | ("{:6.1f}".format(node.flops).rjust(w_float)), 48 | ("{:6.1f}".format(node.BWs).rjust(w_float)), 49 | ("{:4.3f}".format(node.ms).rjust(w_float)))) 50 | 51 | number += 1 52 | g_total_time += node.ms 53 | 54 | 55 | def print_summary_of_network(blob_file): 56 | """ 57 | Print timings related to the flattened blob file. 58 | :param blob_file: 59 | :return: 60 | """ 61 | global g_total_time 62 | 63 | # Formatting parameters 64 | w_stages = math.ceil(math.log10(len(blob_file.network.stageslist))) 65 | w_terminal = shutil.get_terminal_size()[0] 66 | w_layer = w_stages + 3 67 | w_float = 8 68 | w_name = w_terminal - w_layer - 3 * w_float - 1 69 | w_total = w_layer + w_name + 3 * w_float 70 | 71 | print("Network Summary") 72 | 73 | if False: # == NetworkLimitation.DDR_Speed_Bound: # Compare to something 74 | print("This network is bound by the speed of DDR. Consider using smaller datatypes or reducing your data size.") 75 | 76 | print("\nDetailed Per Layer Profile") 77 | 78 | # Header 79 | print( 80 | "{}{}{}{}{}\n{}{}{}{}{}".format( 81 | ''.ljust(w_layer), 82 | ''.ljust(w_name), 83 | ''.rjust(w_float), 84 | 'Bandwidth'.rjust(w_float), 85 | 'time'.rjust( 86 | w_float - 1), 87 | '#'.ljust(w_layer), 88 | 'Name'.ljust(w_name), 89 | 'MFLOPs'.rjust(w_float), 90 | '(MB/s)'.rjust(w_float), 91 | '(ms)'.rjust(w_float))) 92 | print(''.join(['=' for i in range(w_total)])) 93 | 94 | # Layers 95 | for stage in blob_file.network.stageslist: 96 | print_summary_of_nodes( 97 | stage, 98 | w_stages, 99 | w_terminal, 100 | w_layer, 101 | w_float, 102 | w_name) 103 | 104 | # Footer 105 | print(''.join(['-' for i in range(w_total)])) 106 | print( 107 | '{}{}'.format( 108 | 'Total inference time'.rjust( 109 | w_layer + w_name), 110 | '{:.2f}'.format(g_total_time).rjust( 111 | 3 * w_float))) 112 | print(''.join(['-' for i in range(w_total)])) 113 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-armv7l/udev/97-usbboot.rules: -------------------------------------------------------------------------------- 1 | SUBSYSTEM=="usb", ATTRS{idProduct}=="2150", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1" 2 | SUBSYSTEM=="usb", ATTRS{idProduct}=="f63b", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1" 3 | SUBSYSTEM=="tty", ATTRS{idProduct}=="2150", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1" 4 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-x86_64/MovidiusLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/NCSDK-1.12.00.01/ncsdk-x86_64/MovidiusLogo.png -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-x86_64/api/c/libmvnc.so.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/NCSDK-1.12.00.01/ncsdk-x86_64/api/c/libmvnc.so.0 -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-x86_64/api/c/mvnc.h: -------------------------------------------------------------------------------- 1 | #ifndef __MVNC_H_INCLUDED__ 2 | #define __MVNC_H_INCLUDED__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | { 7 | #endif 8 | 9 | #define MVNC_MAX_NAME_SIZE 28 10 | 11 | typedef enum { 12 | MVNC_OK = 0, 13 | MVNC_BUSY = -1, // Device is busy, retry later 14 | MVNC_ERROR = -2, // Error communicating with the device 15 | MVNC_OUT_OF_MEMORY = -3, // Out of memory 16 | MVNC_DEVICE_NOT_FOUND = -4, // No device at the given index or name 17 | MVNC_INVALID_PARAMETERS = -5, // At least one of the given parameters is wrong 18 | MVNC_TIMEOUT = -6, // Timeout in the communication with the device 19 | MVNC_MVCMD_NOT_FOUND = -7, // The file to boot Myriad was not found 20 | MVNC_NO_DATA = -8, // No data to return, call LoadTensor first 21 | MVNC_GONE = -9, // The graph or device has been closed during the operation 22 | MVNC_UNSUPPORTED_GRAPH_FILE = -10, // The graph file version is not supported 23 | MVNC_MYRIAD_ERROR = -11, // An error has been reported by the device, use MVNC_DEBUG_INFO 24 | } mvncStatus; 25 | 26 | typedef enum { 27 | MVNC_LOG_LEVEL = 0, // Log level, int, 0 = nothing, 1 = errors, 2 = verbose 28 | } mvncGlobalOptions; 29 | 30 | typedef enum { 31 | MVNC_ITERATIONS = 0, // Number of iterations per inference, int, normally 1, not for general use 32 | MVNC_NETWORK_THROTTLE = 1, // Measure temperature once per inference instead of once per layer, int, not for general use 33 | MVNC_DONT_BLOCK = 2, // LoadTensor will return BUSY instead of blocking, GetResult will return NO_DATA, int 34 | MVNC_TIME_TAKEN = 1000, // Return time taken for inference (float *) 35 | MVNC_DEBUG_INFO = 1001, // Return debug info, string 36 | } mvncGraphOptions; 37 | 38 | typedef enum { 39 | MVNC_TEMP_LIM_LOWER = 1, // Temperature for short sleep, float, not for general use 40 | MVNC_TEMP_LIM_HIGHER = 2, // Temperature for long sleep, float, not for general use 41 | MVNC_BACKOFF_TIME_NORMAL = 3, // Normal sleep in ms, int, not for general use 42 | MVNC_BACKOFF_TIME_HIGH = 4, // Short sleep in ms, int, not for general use 43 | MVNC_BACKOFF_TIME_CRITICAL = 5, // Long sleep in ms, int, not for general use 44 | MVNC_TEMPERATURE_DEBUG = 6, // Stop on critical temperature, int, not for general use 45 | MVNC_THERMAL_STATS = 1000, // Return temperatures, float *, not for general use 46 | MVNC_OPTIMISATION_LIST = 1001, // Return optimisations list, char *, not for general use 47 | MVNC_THERMAL_THROTTLING_LEVEL = 1002, // 1=TEMP_LIM_LOWER reached, 2=TEMP_LIM_HIGHER reached 48 | } mvncDeviceOptions; 49 | 50 | mvncStatus mvncGetDeviceName(int index, char *name, unsigned int nameSize); 51 | mvncStatus mvncOpenDevice(const char *name, void **deviceHandle); 52 | mvncStatus mvncCloseDevice(void *deviceHandle); 53 | mvncStatus mvncAllocateGraph(void *deviceHandle, void **graphHandle, const void *graphFile, unsigned int graphFileLength); 54 | mvncStatus mvncDeallocateGraph(void *graphHandle); 55 | mvncStatus mvncSetGlobalOption(int option, const void *data, unsigned int dataLength); 56 | mvncStatus mvncGetGlobalOption(int option, void *data, unsigned int *dataLength); 57 | mvncStatus mvncSetGraphOption(void *graphHandle, int option, const void *data, unsigned int dataLength); 58 | mvncStatus mvncGetGraphOption(void *graphHandle, int option, void *data, unsigned int *dataLength); 59 | mvncStatus mvncSetDeviceOption(void *deviceHandle, int option, const void *data, unsigned int dataLength); 60 | mvncStatus mvncGetDeviceOption(void *deviceHandle, int option, void *data, unsigned int *dataLength); 61 | mvncStatus mvncLoadTensor(void *graphHandle, const void *inputTensor, unsigned int inputTensorLength, void *userParam); 62 | mvncStatus mvncGetResult(void *graphHandle, void **outputData, unsigned int *outputDataLength, void **userParam); 63 | 64 | #include "mvnc_deprecated.h" 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-x86_64/api/c/mvnc_deprecated.h: -------------------------------------------------------------------------------- 1 | #ifndef __MVNC_DEPRECATED_H_INCLUDED__ 2 | #define __MVNC_DEPRECATED_H_INCLUDED__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | { 7 | #endif 8 | 9 | typedef mvncGraphOptions GraphOptions __attribute__ \ 10 | ((deprecated("GraphOptions is deprecated. Please use mvncGraphOptions"))); 11 | typedef mvncDeviceOptions DeviceOptions __attribute__ \ 12 | ((deprecated("DeviceOptions is deprecated. Please use mvncDeviceOptions"))); 13 | 14 | // Deprecated Define 15 | #define MVNC_MAXNAMESIZE _Pragma("GCC warning \"'MVNC_MAXNAMESIZE' is deprecated. Please use 'MVNC_MAX_NAME_SIZE'\"") MVNC_MAX_NAME_SIZE 16 | 17 | // Deprecated Global Options 18 | #define MVNC_LOGLEVEL _Pragma("GCC warning \"'MVNC_LOGLEVEL' is deprecated. Please use 'MVNC_LOG_LEVEL'\"") MVNC_LOG_LEVEL 19 | 20 | // Deprecated status values 21 | #define MVNC_MVCMDNOTFOUND _Pragma("GCC warning \"'MVNC_MVCMDNOTFOUND' is deprecated. Please use 'MVNC_MVCMD_NOT_FOUND'\"") MVNC_MVCMD_NOT_FOUND 22 | #define MVNC_NODATA _Pragma("GCC warning \"'MVNC_NO_DATA' is deprecated. Please use 'MVNC_NO_DATA'\"") MVNC_NO_DATA 23 | #define MVNC_UNSUPPORTEDGRAPHFILE _Pragma("GCC warning \"'MVNC_UNSUPPORTEDGRAPHFILE' is deprecated. Please use 'MVNC_UNSUPPORTED_GRAPH_FILE'\"") MVNC_UNSUPPORTED_GRAPH_FILE 24 | #define MVNC_MYRIADERROR _Pragma("GCC warning \"'MVNC_MYRIADERROR' is deprecated. Please use 'MVNC_MYRIAD_ERROR'\"") MVNC_MYRIAD_ERROR 25 | 26 | // Deprecated Graph Options values 27 | #define MVNC_DONTBLOCK _Pragma("GCC warning \"'MVNC_DONTBLOCK' is deprecated. Please use 'MVNC_DONT_BLOCK'\"") MVNC_DONT_BLOCK 28 | #define MVNC_TIMETAKEN _Pragma("GCC warning \"'MVNC_TIMETAKEN' is deprecated. Please use 'MVNC_TIME_TAKEN'\"") MVNC_TIME_TAKEN 29 | #define MVNC_DEBUGINFO _Pragma("GCC warning \"'MVNC_DEBUGINFO' is deprecated. Please use 'MVNC_DEBUG_INFO'\"") MVNC_DEBUG_INFO 30 | 31 | // Deprecated Device Options Values 32 | #define MVNC_THERMALSTATS _Pragma("GCC warning \"'MVNC_THERMALSTATS' is deprecated. Please use 'MVNC_THERMAL_STATS'\"") MVNC_THERMAL_STATS 33 | #define MVNC_OPTIMISATIONLIST _Pragma("GCC warning \"'MVNC_OPTIMISATIONLIST' is deprecated. Please use 'MVNC_OPTIMISATION_LIST'\"") MVNC_OPTIMISATION_LIST 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-x86_64/api/python/mvnc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/NCSDK-1.12.00.01/ncsdk-x86_64/api/python/mvnc/__init__.py -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-x86_64/api/setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | import shutil 3 | from setuptools import setup, find_packages 4 | 5 | setup( 6 | name = "mvnc", 7 | version = "1.12.00.01", 8 | author = "Intel Corporation", 9 | description = ("mvnc python api"), 10 | license="None", 11 | keywords = "", 12 | url = "http://developer.movidius.com", 13 | packages=['mvnc'], 14 | package_dir={'mvnc': 'python/mvnc'}, 15 | long_description="-", 16 | classifiers=[ 17 | "Development Status :: 5 - Production/Stable", 18 | "Topic :: Software Development :: Libraries", 19 | "License :: Other/Proprietary License", 20 | ], 21 | ) 22 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-x86_64/fw/MvNCAPI.mvcmd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/NCSDK-1.12.00.01/ncsdk-x86_64/fw/MvNCAPI.mvcmd -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-x86_64/tk/Models/Blob.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Intel Corporation. 2 | # The source code, information and material ("Material") contained herein is 3 | # owned by Intel Corporation or its suppliers or licensors, and title to such 4 | # Material remains with Intel Corporation or its suppliers or licensors. 5 | # The Material contains proprietary information of Intel or its suppliers and 6 | # licensors. The Material is protected by worldwide copyright laws and treaty 7 | # provisions. 8 | # No part of the Material may be used, copied, reproduced, modified, published, 9 | # uploaded, posted, transmitted, distributed or disclosed in any way without 10 | # Intel's prior express written permission. No license under any patent, 11 | # copyright or other intellectual property rights in the Material is granted to 12 | # or conferred upon you, either expressly, by implication, inducement, estoppel 13 | # or otherwise. 14 | # Any license under such intellectual property rights must be express and 15 | # approved by Intel in writing. 16 | 17 | import numpy as np 18 | from ctypes import * 19 | from Controllers.MiscIO import * 20 | from Controllers.FileIO import * 21 | import sys 22 | 23 | 24 | class Blob: 25 | def __init__( 26 | self, 27 | version, 28 | name, 29 | report_dir, 30 | myriad_params, 31 | network, 32 | blob_name): 33 | """ 34 | This object contains all the information required for a blob file + some additional info for processing. 35 | :param version: The version of the toolkit used to generate this blob. Useful for the potential of 36 | having backwards compatibility - although it's easier to regenerate your file. 37 | :param name: Name of the network represented in the blob file 38 | :param report_dir: Where to output our reports (Note: TODO) 39 | :param myriad_params: Myriad configurations (Note: TODO) 40 | :param network: A Network object to attach to the blob. 41 | :return: 42 | """ 43 | self.version = c_uint32(version) 44 | self.filesize = c_uint32(16) 45 | self.name = set_string_range(name, 100).encode('ascii') 46 | self.report_dir = set_string_range(report_dir, 100).encode('ascii') 47 | self.myriad_params = myriad_params 48 | self.network = network 49 | self.stage_count = c_uint32(self.network.count) 50 | self.VCS_Fix = True 51 | self.blob_name = blob_name 52 | 53 | def generate(self): 54 | """ 55 | Generates the actual blob file. 56 | :return: 57 | """ 58 | with open(self.blob_name, 'wb') as f: 59 | if self.VCS_Fix: 60 | f.write(c_uint64(0)) # VCS incorrectly reads first 16 Bytes 61 | f.write(c_uint64(0)) # VCS incorrectly reads first 16 Bytes 62 | f.write(c_uint64(0)) # VCS incorrectly reads first 16 Bytes 63 | f.write(c_uint64(0)) # VCS incorrectly reads first 16 Bytes 64 | f.write(estimate_file_size(self)) 65 | f.write(self.version) 66 | 67 | f.write(self.name) 68 | f.write(self.report_dir) 69 | f.write(self.stage_count) 70 | f.write(get_buffer_start(self)) # Size of a network element. 71 | self.myriad_params.generate(f) 72 | self.network.generate_info(f) 73 | self.network.generate_data(f) 74 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-x86_64/tk/Models/CaffeEnumDeclarations.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Intel Corporation. 2 | # The source code, information and material ("Material") contained herein is 3 | # owned by Intel Corporation or its suppliers or licensors, and title to such 4 | # Material remains with Intel Corporation or its suppliers or licensors. 5 | # The Material contains proprietary information of Intel or its suppliers and 6 | # licensors. The Material is protected by worldwide copyright laws and treaty 7 | # provisions. 8 | # No part of the Material may be used, copied, reproduced, modified, published, 9 | # uploaded, posted, transmitted, distributed or disclosed in any way without 10 | # Intel's prior express written permission. No license under any patent, 11 | # copyright or other intellectual property rights in the Material is granted to 12 | # or conferred upon you, either expressly, by implication, inducement, estoppel 13 | # or otherwise. 14 | # Any license under such intellectual property rights must be express and 15 | # approved by Intel in writing. 16 | 17 | from enum import Enum 18 | 19 | """ 20 | This is so we can support Network Descriptions which use internal Caffe enums 21 | instead of strings 22 | """ 23 | 24 | 25 | class CaffeStage(Enum): 26 | NONE = 0 27 | ABSVAL = 35 28 | ACCURACY = 1 29 | ARGMAX = 30 30 | BNLL = 2 31 | CONCAT = 3 32 | CONTRASTIVE_LOSS = 37 33 | CONVOLUTION = 4 34 | DATA = 5 35 | DECONVOLUTION = 39 36 | DROPOUT = 6 37 | DUMMY_DATA = 32 38 | EUCLIDEAN_LOSS = 7 39 | ELTWISE = 25 40 | EXP = 38 41 | FLATTEN = 8 42 | HDF5_DATA = 9 43 | HDF5_OUTPUT = 10 44 | HINGE_LOSS = 28 45 | IM2COL = 11 46 | IMAGE_DATA = 12 47 | INFOGAIN_LOSS = 13 48 | INNER_PRODUCT = 14 49 | LRN = 15 50 | MEMORY_DATA = 29 51 | MULTINOMIAL_LOGISTIC_LOSS = 16 52 | MVN = 34 53 | POOLING = 17 54 | POWER = 26 55 | RELU = 18 56 | SIGMOID = 19 57 | SIGMOID_CROSS_ENTROPY_LOSS = 27 58 | SILENCE = 36 59 | SOFTMAX = 20 60 | SOFTMAX_LOSS = 21 61 | SPLIT = 22 62 | SLICE = 33 63 | TANH = 23 64 | WINDOW_DATA = 24 65 | THRESHOLD = 31 66 | RESHAPE = 40 67 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-x86_64/tk/Models/MyriadParam.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Intel Corporation. 2 | # The source code, information and material ("Material") contained herein is 3 | # owned by Intel Corporation or its suppliers or licensors, and title to such 4 | # Material remains with Intel Corporation or its suppliers or licensors. 5 | # The Material contains proprietary information of Intel or its suppliers and 6 | # licensors. The Material is protected by worldwide copyright laws and treaty 7 | # provisions. 8 | # No part of the Material may be used, copied, reproduced, modified, published, 9 | # uploaded, posted, transmitted, distributed or disclosed in any way without 10 | # Intel's prior express written permission. No license under any patent, 11 | # copyright or other intellectual property rights in the Material is granted to 12 | # or conferred upon you, either expressly, by implication, inducement, estoppel 13 | # or otherwise. 14 | # Any license under such intellectual property rights must be express and 15 | # approved by Intel in writing. 16 | 17 | import numpy as np 18 | from ctypes import * 19 | from Controllers.MiscIO import * 20 | 21 | 22 | class MyriadParam: 23 | def __init__(self, fs=0, ls=1, optimization_list=None): 24 | """ 25 | Constructor for our myriad definitions 26 | :param fs: first shave to be used 27 | :param ls: last shave in range 28 | :return: 29 | """ 30 | self.firstShave = c_ushort(fs) 31 | self.lastShave = c_ushort(ls) 32 | self.leonMemLocation = c_uint(0) 33 | self.leonMemSize = c_uint(0) 34 | self.dmaAgent = c_uint(0) 35 | self.optimization_list = optimization_list 36 | 37 | def generate(self, f): 38 | """ 39 | Write to file. 40 | 41 | :param f: 42 | :return: 43 | """ 44 | f.write(self.firstShave) 45 | f.write(self.lastShave) 46 | f.write(self.leonMemLocation) 47 | f.write(self.leonMemSize) 48 | f.write(self.dmaAgent) 49 | 50 | def binary_size(self): 51 | """ 52 | get binary size of this element when written to file. 53 | :return: 54 | """ 55 | file_size = byte_size(self.firstShave) 56 | assert file_size == 0x2, "Blob format modified, please change the " +\ 57 | "FathomRun/tests/per_layer_tests/util/generate_test_data.py file" 58 | file_size += byte_size(self.lastShave) 59 | file_size += byte_size(self.leonMemLocation) 60 | file_size += byte_size(self.leonMemSize) 61 | file_size += byte_size(self.dmaAgent) 62 | return file_size 63 | 64 | def display_opts(self): 65 | print("\nAvailable Optimizations:") 66 | [print("* " + str(x)) for x in self.optimization_list] 67 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-x86_64/tk/Views/Summary.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Intel Corporation. 2 | # The source code, information and material ("Material") contained herein is 3 | # owned by Intel Corporation or its suppliers or licensors, and title to such 4 | # Material remains with Intel Corporation or its suppliers or licensors. 5 | # The Material contains proprietary information of Intel or its suppliers and 6 | # licensors. The Material is protected by worldwide copyright laws and treaty 7 | # provisions. 8 | # No part of the Material may be used, copied, reproduced, modified, published, 9 | # uploaded, posted, transmitted, distributed or disclosed in any way without 10 | # Intel's prior express written permission. No license under any patent, 11 | # copyright or other intellectual property rights in the Material is granted to 12 | # or conferred upon you, either expressly, by implication, inducement, estoppel 13 | # or otherwise. 14 | # Any license under such intellectual property rights must be express and 15 | # approved by Intel in writing. 16 | 17 | from Models.EnumDeclarations import * 18 | import math 19 | import shutil 20 | 21 | g_total_time = 0 22 | number = 0 23 | 24 | 25 | def print_summary_of_nodes( 26 | node, 27 | w_stages, 28 | w_terminal, 29 | w_layer, 30 | w_float, 31 | w_name): 32 | """ 33 | Commandline print of nodes and their statistics. 34 | :param number: 35 | :param node: 36 | :return: 37 | """ 38 | global g_total_time 39 | global number 40 | 41 | formatted_name = node.unprocessed_name[slice(-w_name, None)] 42 | if len(node.unprocessed_name) > w_name: 43 | formatted_name = '...' + formatted_name[3:] 44 | print("{}{}{}{}{}".format( 45 | ("{}".format(str(number)).ljust(w_layer)), 46 | ("{}".format(formatted_name).ljust(w_name)), 47 | ("{:6.1f}".format(node.flops).rjust(w_float)), 48 | ("{:6.1f}".format(node.BWs).rjust(w_float)), 49 | ("{:4.3f}".format(node.ms).rjust(w_float)))) 50 | 51 | number += 1 52 | g_total_time += node.ms 53 | 54 | 55 | def print_summary_of_network(blob_file): 56 | """ 57 | Print timings related to the flattened blob file. 58 | :param blob_file: 59 | :return: 60 | """ 61 | global g_total_time 62 | 63 | # Formatting parameters 64 | w_stages = math.ceil(math.log10(len(blob_file.network.stageslist))) 65 | w_terminal = shutil.get_terminal_size()[0] 66 | w_layer = w_stages + 3 67 | w_float = 8 68 | w_name = w_terminal - w_layer - 3 * w_float - 1 69 | w_total = w_layer + w_name + 3 * w_float 70 | 71 | print("Network Summary") 72 | 73 | if False: # == NetworkLimitation.DDR_Speed_Bound: # Compare to something 74 | print("This network is bound by the speed of DDR. Consider using smaller datatypes or reducing your data size.") 75 | 76 | print("\nDetailed Per Layer Profile") 77 | 78 | # Header 79 | print( 80 | "{}{}{}{}{}\n{}{}{}{}{}".format( 81 | ''.ljust(w_layer), 82 | ''.ljust(w_name), 83 | ''.rjust(w_float), 84 | 'Bandwidth'.rjust(w_float), 85 | 'time'.rjust( 86 | w_float - 1), 87 | '#'.ljust(w_layer), 88 | 'Name'.ljust(w_name), 89 | 'MFLOPs'.rjust(w_float), 90 | '(MB/s)'.rjust(w_float), 91 | '(ms)'.rjust(w_float))) 92 | print(''.join(['=' for i in range(w_total)])) 93 | 94 | # Layers 95 | for stage in blob_file.network.stageslist: 96 | print_summary_of_nodes( 97 | stage, 98 | w_stages, 99 | w_terminal, 100 | w_layer, 101 | w_float, 102 | w_name) 103 | 104 | # Footer 105 | print(''.join(['-' for i in range(w_total)])) 106 | print( 107 | '{}{}'.format( 108 | 'Total inference time'.rjust( 109 | w_layer + w_name), 110 | '{:.2f}'.format(g_total_time).rjust( 111 | 3 * w_float))) 112 | print(''.join(['-' for i in range(w_total)])) 113 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk-x86_64/udev/97-usbboot.rules: -------------------------------------------------------------------------------- 1 | SUBSYSTEM=="usb", ATTRS{idProduct}=="2150", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1" 2 | SUBSYSTEM=="usb", ATTRS{idProduct}=="f63b", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1" 3 | SUBSYSTEM=="tty", ATTRS{idProduct}=="2150", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1" 4 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/ncsdk.conf: -------------------------------------------------------------------------------- 1 | #MAKE_PROCS=1 2 | SETUPDIR=/opt/movidius 3 | VERBOSE=yes 4 | SYSTEM_INSTALL=yes 5 | CAFFE_FLAVOR=ssd 6 | CAFFE_USE_CUDA=no 7 | INSTALL_TENSORFLOW=yes 8 | INSTALL_TOOLKIT=yes 9 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/requirements.txt: -------------------------------------------------------------------------------- 1 | Cython>=0.23.4,<=0.26 2 | Markdown>=2.6.2,<=2.6.8 3 | Pillow>=3.1.0,<=4.2.1 4 | PyYAML>=3.11,<=3.12 5 | graphviz>=0.4.10,<=0.8 6 | h5py>=2.5.0,<=2.7.0 7 | lxml>=3.4.4,<=3.8.0 8 | matplotlib>=1.5.0,<=2.0.2 9 | numpy>=1.13.0,<=1.13.3 10 | protobuf>=3.0.0b2,<=3.4.0 11 | python-dateutil>=2.4.2,<=2.6.1 12 | scikit-image>=0.11.3,<=0.13.0 13 | scipy>=0.14.1,<=0.19.1 14 | six>=1.10.0 15 | networkx>=1.10,<=1.11 16 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/requirements_apt.txt: -------------------------------------------------------------------------------- 1 | libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler libatlas-base-dev git python3-dev python3-pip python3-numpy automake byacc lsb-release cmake python3-scipy libgflags-dev libgoogle-glog-dev liblmdb-dev swig3.0 graphviz libxslt-dev libxml2-dev gfortran python3-yaml python3-nose python-pip python-numpy 2 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/tests/Makefile: -------------------------------------------------------------------------------- 1 | 2 | check: 3 | @(cd sdk-check; make) 4 | @(cd api-check; make) 5 | 6 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/tests/api-check/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS := -O2 -Wall 2 | 3 | all: ncs-check ncs-c-check ncs-python3-check ncs-python2-check 4 | 5 | objs := $(patsubst %.c,%.o,$(wildcard *.c)) 6 | 7 | 8 | ncs-check: $(objs) 9 | $(CC) $(objs) -lusb-1.0 -lmvnc -o $@ 10 | 11 | %.o: %c 12 | $(CC) -c $(CFLAGS) $< 13 | 14 | .PHONY: ncs-c-check 15 | ncs-c-check: 16 | @echo "****************************************************************" 17 | @echo "Checking NCS C API..." 18 | @echo "****************************************************************" 19 | ./ncs-check -1 20 | 21 | .PHONY: ncs-python3-check 22 | ncs-python3-check: 23 | @echo "****************************************************************" 24 | @echo "Checking NCS python3 API..." 25 | @echo "****************************************************************" 26 | python3 ncs-python3-check.py 27 | 28 | .PHONY: ncs-python2-check 29 | ncs-python2-check: 30 | @echo "****************************************************************" 31 | @echo "Checking NCS python2 API..." 32 | @echo "****************************************************************" 33 | python ncs-python2-check.py 34 | 35 | clean: 36 | rm -f *.o ncs-check 37 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/tests/api-check/ncs-python2-check.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # Python script to open and close a single NCS device 3 | 4 | import mvnc.mvncapi as fx 5 | 6 | # main entry point for the program 7 | if __name__=="__main__": 8 | 9 | # set the logging level for the NC API 10 | fx.SetGlobalOption(fx.GlobalOption.LOG_LEVEL, 0) 11 | 12 | # get a list of names for all the devices plugged into the system 13 | ncs_names = fx.EnumerateDevices() 14 | if (len(ncs_names) < 1): 15 | print("Error - no NCS devices detected, verify an NCS device is connected.") 16 | quit() 17 | 18 | 19 | # get the first NCS device by its name. For this program we will always open the first NCS device. 20 | dev = fx.Device(ncs_names[0]) 21 | 22 | 23 | # try to open the device. this will throw an exception if someone else has it open already 24 | try: 25 | dev.OpenDevice() 26 | except: 27 | print("Error - Could not open NCS device.") 28 | quit() 29 | 30 | 31 | print("Hello NCS! Device opened normally.") 32 | 33 | 34 | try: 35 | dev.CloseDevice() 36 | except: 37 | print("Error - could not close NCS device.") 38 | quit() 39 | 40 | print("Goodbye NCS! Device closed normally.") 41 | print("NCS device working.") 42 | 43 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/tests/api-check/ncs-python3-check.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # Python script to open and close a single NCS device 3 | 4 | import mvnc.mvncapi as fx 5 | 6 | # main entry point for the program 7 | if __name__=="__main__": 8 | 9 | # set the logging level for the NC API 10 | fx.SetGlobalOption(fx.GlobalOption.LOG_LEVEL, 0) 11 | 12 | # get a list of names for all the devices plugged into the system 13 | ncs_names = fx.EnumerateDevices() 14 | if (len(ncs_names) < 1): 15 | print("Error - no NCS devices detected, verify an NCS device is connected.") 16 | quit() 17 | 18 | 19 | # get the first NCS device by its name. For this program we will always open the first NCS device. 20 | dev = fx.Device(ncs_names[0]) 21 | 22 | 23 | # try to open the device. this will throw an exception if someone else has it open already 24 | try: 25 | dev.OpenDevice() 26 | except: 27 | print("Error - Could not open NCS device.") 28 | quit() 29 | 30 | 31 | print("Hello NCS! Device opened normally.") 32 | 33 | 34 | try: 35 | dev.CloseDevice() 36 | except: 37 | print("Error - could not close NCS device.") 38 | quit() 39 | 40 | print("Goodbye NCS! Device closed normally.") 41 | print("NCS device working.") 42 | 43 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/tests/sdk-check/Makefile: -------------------------------------------------------------------------------- 1 | python_version_full := $(wordlist 2,4,$(subst ., ,$(shell python3 --version 2>&1))) 2 | python_version_minor := $(word 2,${python_version_full}) 3 | 4 | all: check-dependencies check-compiler check-profiler check-checker 5 | 6 | .PHONY: py 7 | py: 8 | @echo ${python_version_minor} 9 | 10 | 11 | .PHONY: check-dependencies 12 | check-dependencies: 13 | @echo "****************************************************************" 14 | @echo "Checking NCS python dependencies..." 15 | @echo "****************************************************************" 16 | @python3 test_install.py 17 | 18 | .PHONY: help 19 | help: 20 | @cat Readme.txt 21 | @grep "echo" Makefile | egrep -v "grep|ERR" | sed 's/.*echo/ make/g' | sed 's/\"//g' 22 | 23 | .PHONY: check-compiler 24 | check-compiler: 25 | @echo "****************************************************************" 26 | @echo "Checking NCS compiler..." 27 | @echo "****************************************************************" 28 | mvNCCompile data/googlenet.prototxt -s 12 29 | 30 | .PHONY: check-profiler 31 | check-profiler: 32 | @echo "" 33 | @echo "****************************************************************" 34 | @echo "Checking NCS profiler..." 35 | @echo "****************************************************************" 36 | mvNCProfile data/googlenet.prototxt -s 12 37 | 38 | .PHONY: check-checker 39 | check-checker: 40 | @echo "" 41 | @echo "****************************************************************" 42 | @echo "Checking the NCS graph checker..." 43 | @echo "****************************************************************" 44 | mvNCCheck data/googlenet.prototxt -i img/512_Phone.jpg -s 12 45 | 46 | .PHONY: clean 47 | clean: 48 | rm output* graph zero_weights* 49 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/tests/sdk-check/data/readme.txt: -------------------------------------------------------------------------------- 1 | The provided networks have been found here: 2 | 3 | AlexNet: https://github.com/BVLC/caffe/tree/master/models/bvlc_alexnet 4 | GoogLeNet: https://github.com/BVLC/caffe/tree/master/models/bvlc_googlenet 5 | SqueezeNet: https://github.com/DeepScale/SqueezeNet/tree/master/SqueezeNet_v1.0 6 | 7 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/tests/sdk-check/img/512_Phone.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/NCSDK-1.12.00.01/tests/sdk-check/img/512_Phone.jpg -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/tests/sdk-check/test_install.py: -------------------------------------------------------------------------------- 1 | import sys 2 | if sys.version_info[0] != 3: 3 | print("Incompatible Version of Python. Please use Python 3.") 4 | quit() 5 | 6 | 7 | import platform 8 | if platform.system() != "Linux" or platform.dist()[0] != "Ubuntu" or platform.dist()[1] != "16.04": 9 | if platform.dist()[0] != "debian" or platform.dist()[1] != "9.1": 10 | print("Warning: Potentially unsupported OS") 11 | 12 | def custom_import_function(module, error_msg): 13 | try: 14 | __import__(module) 15 | except Exception: 16 | print(error_msg) 17 | 18 | print("Performing NCSDK python3 dependencies check...") 19 | 20 | custom_import_function('os', "Python STD Lib problem") 21 | custom_import_function('sys', "Python STD Lib problem") 22 | custom_import_function('argparse', "Python STD Lib problem") 23 | custom_import_function('argparse', "Python STD Lib problem") 24 | custom_import_function('ctypes', "Python STD Lib problem") 25 | custom_import_function('math', "Python STD Lib problem") 26 | custom_import_function('re', "Python STD Lib problem") 27 | custom_import_function('warnings', "Python STD Lib problem") 28 | custom_import_function('struct', "Python STD Lib problem") 29 | 30 | custom_import_function('datetime', "DateTime Python Libary not found.") 31 | custom_import_function('numpy', "Numpy Python Libary not found.") 32 | custom_import_function('yaml', "YAML Python Libary not found.") 33 | custom_import_function('google.protobuf', "Protobuf Python Libary not found.") 34 | custom_import_function('caffe', "Caffe Python Libary: import error #1. Import not successful") 35 | 36 | 37 | try: 38 | import numpy 39 | version = numpy.version.version.split(".") 40 | assert(int(version[0]) >= 1) 41 | if version[0] == 1: 42 | assert(int(version[1]) >= 11) 43 | 44 | except Exception: 45 | print ("Warning: Numpy must be at least 1.11.0") 46 | 47 | try: 48 | from enum import Enum 49 | except Exception: 50 | print ("Python problem. Std libraries not found.") 51 | 52 | try: 53 | from csv import writer 54 | except Exception: 55 | print ("Python problem. CSV library not found.") 56 | 57 | 58 | try: 59 | from caffe.proto import caffe_pb2 60 | except ImportError: 61 | print("Caffe Python Libary Import Error #2: import caffe_pb2") 62 | 63 | try: 64 | from graphviz import Digraph 65 | except Exception: 66 | print("graphviz Python Libary not found") 67 | 68 | print("NCSDK python3 dependencies check passed!") 69 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/uninstall-ncsdk.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | INSTALL_INFO_FILENAME=.ncsdk_install.info 4 | 5 | ################################## Set up error reporting ################################## 6 | err_report() { 7 | echo -e "${RED}Installation failed. Error on line $1${NC}" 8 | } 9 | 10 | trap 'err_report $LINENO' ERR 11 | 12 | ############################### Ask for SUDO permissions ################################## 13 | # If the executing user is not root, ask for sudo priviledges 14 | SUDO_PREFIX="" 15 | if [ $EUID != 0 ]; then 16 | SUDO_PREFIX="sudo" 17 | sudo -v 18 | 19 | # Keep-alive: update existing sudo time stamp if set, otherwise do nothing. 20 | #while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & 21 | fi 22 | 23 | PREV_INSTALL_INFO=`$SUDO_PREFIX find /opt /home -name $INSTALL_INFO_FILENAME -print 2> /dev/null` 24 | if [[ ! -z $PREV_INSTALL_INFO ]]; then 25 | PREV_OWNER=$(ls -l $PREV_INSTALL_INFO | awk '{print $3}') 26 | if [ $PREV_OWNER != $USER ]; then 27 | echo "Previous installation not owned by current user, continue at your own risk" 28 | fi 29 | PREV_INSTALL_DIR=${PREV_INSTALL_INFO%/*} 30 | PREV_NCSDK_VER=`cat $PREV_INSTALL_DIR/version.txt` 31 | echo "NCSDK version $PREV_NCSDK_VER previously installed at $PREV_INSTALL_DIR" 32 | else 33 | echo "No valid install of NCSDK found, exiting" 34 | exit 0 35 | fi 36 | 37 | NCSDK_PATH=`grep 'ncsdk_path' $PREV_INSTALL_INFO | cut -d '=' -f 2` 38 | NCS_BIN_PATH=`grep 'ncs_bin_path' $PREV_INSTALL_INFO | cut -d '=' -f 2` 39 | NCS_LIB_PATH=`grep 'ncs_lib_path' $PREV_INSTALL_INFO | cut -d '=' -f 2` 40 | NCS_INC_PATH=`grep 'ncs_inc_path' $PREV_INSTALL_INFO | cut -d '=' -f 2` 41 | echo "NCSDK files are at: $NCSDK_PATH" 42 | if [ ! -z $NCS_BIN_PATH ]; then 43 | echo "NCSDK binaries are at: $NCS_BIN_PATH" 44 | fi 45 | echo "NCSDK libraries are at: $NCS_LIB_PATH" 46 | echo "NCSDK include files are at: $NCS_INC_PATH" 47 | 48 | function check_and_remove_file 49 | { 50 | if [ -e "$NCS_BIN_PATH/$1" ]; then 51 | RECURSIVE="" 52 | if [ -d "$NCS_BIN_PATH/$1" ]; then 53 | RECURSIVE="-r" 54 | fi 55 | printf "Removing NCSDK toolkit file..." 56 | echo "$NCS_BIN_PATH/$1" 57 | $SUDO_PREFIX rm $RECURSIVE "$NCS_BIN_PATH/$1" 58 | fi 59 | } 60 | 61 | # If installed, remove toolkit binaries 62 | check_and_remove_file mvNCCheck 63 | check_and_remove_file mvNCProfile 64 | check_and_remove_file mvNCCompile 65 | check_and_remove_file ncsdk 66 | 67 | # Remove libraries 68 | printf "Removing NCSDK libraries..." 69 | $SUDO_PREFIX rm $NCS_LIB_PATH/libmvnc.so.0 70 | $SUDO_PREFIX rm $NCS_LIB_PATH/libmvnc.so 71 | $SUDO_PREFIX rm -r $NCS_LIB_PATH/mvnc 72 | printf "done\n" 73 | 74 | # Remove API, don't prompt user for a response 75 | printf "Removing NCS python API\n" 76 | $SUDO_PREFIX -H pip3 uninstall -y mvnc 77 | $SUDO_PREFIX -H pip uninstall -y mvnc 78 | 79 | # Remove include files 80 | printf "Removing NCSDK include files..." 81 | $SUDO_PREFIX rm $NCS_INC_PATH/mvnc.h 82 | $SUDO_PREFIX rm $NCS_INC_PATH/mvnc_deprecated.h 83 | printf "done\n" 84 | 85 | # Remove udev rules files 86 | printf "Removing udev rules..." 87 | $SUDO_PREFIX rm /etc/udev/rules.d/97-usbboot.rules 88 | printf "done\n" 89 | 90 | # Remove NCSDK files 91 | printf "Removing NCSDK files..." 92 | $SUDO_PREFIX rm -r $NCSDK_PATH 93 | printf "done\n" 94 | 95 | printf "Running ldconfig..." 96 | $SUDO_PREFIX ldconfig 97 | printf "done\n" 98 | 99 | printf "Updating udev rules..." 100 | $SUDO_PREFIX udevadm control --reload-rules 101 | $SUDO_PREFIX udevadm trigger 102 | printf "done\n" 103 | 104 | printf "Remove NCSDK references from PYTHONPATH..." 105 | #sed -i "\#export PYTHONPATH=\"\${PYTHONPATH}:"${NCSDK_PATH}"/mvnc/python\"#d" $HOME/.bashrc 106 | sed -i "\#export PYTHONPATH=\"\${PYTHONPATH}:"${NCSDK_PATH}"/caffe/python\"#d" $HOME/.bashrc 107 | # Remove some of the older versions of this as well 108 | sed -i "\#export PYTHONPATH=\$env:\""${NCSDK_PATH}"/mvnc/python\":\$PYTHONPATH#d" $HOME/.bashrc 109 | sed -i "\#export PYTHONPATH=\$env:\""${NCSDK_PATH}"/caffe/python\":\$PYTHONPATH#d" $HOME/.bashrc 110 | printf "done\n" 111 | 112 | echo "Successfully uninstalled NCSDK from the system" 113 | 114 | -------------------------------------------------------------------------------- /NCSDK-1.12.00.01/version.txt: -------------------------------------------------------------------------------- 1 | 1.12.00.01 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Intel® Movidius™ Neural Compute SDK 2 | ## Modified to install on rock64 (aarch64 with ubuntu 18.04) 3 | 4 | ### This README is a modified version of the original NCSDK repo 5 | 6 | This Intel® Movidius™ Neural Compute software developer kit (NCSDK) is provided for users of the [Intel® Movidius™ Neural Compute Stick](https://developer.movidius.com/) (Intel® Movidius™ NCS). It includes software tools, an API, and examples, so developers can create software that takes advantage of the accelerated neural network capability provided by the Intel Movidius NCS hardware. 7 | 8 | ------- 9 | 10 | # Installation 11 | The provided Makefile helps with installation. Clone this repository and then run the following command to install the NCSDK: 12 | 13 | ```bash 14 | git clone https://github.com/markjay4k/ncsdk-aarch64.git 15 | cd ncsdk-aarch64 16 | sudo make install 17 | source ~/.bashrc 18 | sudo make api 19 | ``` 20 | ## Install Tensorflow (optional) 21 | ```bash 22 | git clone https://github.com/markjay4k/Tensorflow-1.9rc0-py36-aarch64.git 23 | pip3 install Tensorflow-1.9rc0-py36-aarch64/tensorflow-1.9.0rc0-cp36-cp36m-linux_aarch64.whl 24 | ``` 25 | 26 | # Examples 27 | The Neural Compute SDK also includes examples. Plug the NCS in and run the following command to install the examples: 28 | ``` 29 | sudo make examples 30 | ``` 31 | 32 | ## NCAPPZOO Examples 33 | For additional examples, please see the Neural Compute App Zoo available at [http://www.github.com/movidius/ncappzoo](http://www.github.com/movidius/ncappzoo). The ncappzoo is a valuable resource for NCS users and includes community developed applications and neural networks for the NCS. 34 | 35 | # Documentation 36 | The complete Intel Movidius Neural Compute SDK documentation can be viewed at [https://movidius.github.io/ncsdk/](https://movidius.github.io/ncsdk/) 37 | 38 | # Getting Started Video 39 | For installation and general instructions to get started with the NCSDK, take a look at this [video](https://www.youtube.com/watch?v=fESFVNcQVVA) 40 | 41 | # Troubleshooting and Tech Support 42 | Be sure to check the [NCS Troubleshooting Guide](https://ncsforum.movidius.com/discussion/370/intel-ncs-troubleshooting-help-and-guidelines#latest) if you run into any issues with the NCS or NCSDK. 43 | 44 | Also for general tech support issues the [NCS User Forum](https://developer.movidius.com/forums) is recommended and contains community discussions on many issues and resolutions. 45 | -------------------------------------------------------------------------------- /api/include/mvnc.h: -------------------------------------------------------------------------------- 1 | #ifndef __MVNC_H_INCLUDED__ 2 | #define __MVNC_H_INCLUDED__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | { 7 | #endif 8 | 9 | #define MVNC_MAX_NAME_SIZE 28 10 | 11 | typedef enum { 12 | MVNC_OK = 0, 13 | MVNC_BUSY = -1, // Device is busy, retry later 14 | MVNC_ERROR = -2, // Error communicating with the device 15 | MVNC_OUT_OF_MEMORY = -3, // Out of memory 16 | MVNC_DEVICE_NOT_FOUND = -4, // No device at the given index or name 17 | MVNC_INVALID_PARAMETERS = -5, // At least one of the given parameters is wrong 18 | MVNC_TIMEOUT = -6, // Timeout in the communication with the device 19 | MVNC_MVCMD_NOT_FOUND = -7, // The file to boot Myriad was not found 20 | MVNC_NO_DATA = -8, // No data to return, call LoadTensor first 21 | MVNC_GONE = -9, // The graph or device has been closed during the operation 22 | MVNC_UNSUPPORTED_GRAPH_FILE = -10, // The graph file version is not supported 23 | MVNC_MYRIAD_ERROR = -11, // An error has been reported by the device, use MVNC_DEBUG_INFO 24 | } mvncStatus; 25 | 26 | typedef enum { 27 | MVNC_LOG_LEVEL = 0, // Log level, int, 0 = nothing, 1 = errors, 2 = verbose 28 | } mvncGlobalOptions; 29 | 30 | typedef enum { 31 | MVNC_ITERATIONS = 0, // Number of iterations per inference, int, normally 1, not for general use 32 | MVNC_NETWORK_THROTTLE = 1, // Measure temperature once per inference instead of once per layer, int, not for general use 33 | MVNC_DONT_BLOCK = 2, // LoadTensor will return BUSY instead of blocking, GetResult will return NO_DATA, int 34 | MVNC_TIME_TAKEN = 1000, // Return time taken for inference (float *) 35 | MVNC_DEBUG_INFO = 1001, // Return debug info, string 36 | } mvncGraphOptions; 37 | 38 | typedef enum { 39 | MVNC_TEMP_LIM_LOWER = 1, // Temperature for short sleep, float, not for general use 40 | MVNC_TEMP_LIM_HIGHER = 2, // Temperature for long sleep, float, not for general use 41 | MVNC_BACKOFF_TIME_NORMAL = 3, // Normal sleep in ms, int, not for general use 42 | MVNC_BACKOFF_TIME_HIGH = 4, // Short sleep in ms, int, not for general use 43 | MVNC_BACKOFF_TIME_CRITICAL = 5, // Long sleep in ms, int, not for general use 44 | MVNC_TEMPERATURE_DEBUG = 6, // Stop on critical temperature, int, not for general use 45 | MVNC_THERMAL_STATS = 1000, // Return temperatures, float *, not for general use 46 | MVNC_OPTIMISATION_LIST = 1001, // Return optimisations list, char *, not for general use 47 | MVNC_THERMAL_THROTTLING_LEVEL = 1002, // 1=TEMP_LIM_LOWER reached, 2=TEMP_LIM_HIGHER reached 48 | } mvncDeviceOptions; 49 | 50 | mvncStatus mvncGetDeviceName(int index, char *name, unsigned int nameSize); 51 | mvncStatus mvncOpenDevice(const char *name, void **deviceHandle); 52 | mvncStatus mvncCloseDevice(void *deviceHandle); 53 | mvncStatus mvncAllocateGraph(void *deviceHandle, void **graphHandle, const void *graphFile, unsigned int graphFileLength); 54 | mvncStatus mvncDeallocateGraph(void *graphHandle); 55 | mvncStatus mvncSetGlobalOption(int option, const void *data, unsigned int dataLength); 56 | mvncStatus mvncGetGlobalOption(int option, void *data, unsigned int *dataLength); 57 | mvncStatus mvncSetGraphOption(void *graphHandle, int option, const void *data, unsigned int dataLength); 58 | mvncStatus mvncGetGraphOption(void *graphHandle, int option, void *data, unsigned int *dataLength); 59 | mvncStatus mvncSetDeviceOption(void *deviceHandle, int option, const void *data, unsigned int dataLength); 60 | mvncStatus mvncGetDeviceOption(void *deviceHandle, int option, void *data, unsigned int *dataLength); 61 | mvncStatus mvncLoadTensor(void *graphHandle, const void *inputTensor, unsigned int inputTensorLength, void *userParam); 62 | mvncStatus mvncGetResult(void *graphHandle, void **outputData, unsigned int *outputDataLength, void **userParam); 63 | 64 | #include "mvnc_deprecated.h" 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /api/include/mvnc_deprecated.h: -------------------------------------------------------------------------------- 1 | #ifndef __MVNC_DEPRECATED_H_INCLUDED__ 2 | #define __MVNC_DEPRECATED_H_INCLUDED__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | { 7 | #endif 8 | 9 | typedef mvncGraphOptions GraphOptions __attribute__ \ 10 | ((deprecated("GraphOptions is deprecated. Please use mvncGraphOptions"))); 11 | typedef mvncDeviceOptions DeviceOptions __attribute__ \ 12 | ((deprecated("DeviceOptions is deprecated. Please use mvncDeviceOptions"))); 13 | 14 | // Deprecated Define 15 | #define MVNC_MAXNAMESIZE _Pragma("GCC warning \"'MVNC_MAXNAMESIZE' is deprecated. Please use 'MVNC_MAX_NAME_SIZE'\"") MVNC_MAX_NAME_SIZE 16 | 17 | // Deprecated Global Options 18 | #define MVNC_LOGLEVEL _Pragma("GCC warning \"'MVNC_LOGLEVEL' is deprecated. Please use 'MVNC_LOG_LEVEL'\"") MVNC_LOG_LEVEL 19 | 20 | // Deprecated status values 21 | #define MVNC_MVCMDNOTFOUND _Pragma("GCC warning \"'MVNC_MVCMDNOTFOUND' is deprecated. Please use 'MVNC_MVCMD_NOT_FOUND'\"") MVNC_MVCMD_NOT_FOUND 22 | #define MVNC_NODATA _Pragma("GCC warning \"'MVNC_NO_DATA' is deprecated. Please use 'MVNC_NO_DATA'\"") MVNC_NO_DATA 23 | #define MVNC_UNSUPPORTEDGRAPHFILE _Pragma("GCC warning \"'MVNC_UNSUPPORTEDGRAPHFILE' is deprecated. Please use 'MVNC_UNSUPPORTED_GRAPH_FILE'\"") MVNC_UNSUPPORTED_GRAPH_FILE 24 | #define MVNC_MYRIADERROR _Pragma("GCC warning \"'MVNC_MYRIADERROR' is deprecated. Please use 'MVNC_MYRIAD_ERROR'\"") MVNC_MYRIAD_ERROR 25 | 26 | // Deprecated Graph Options values 27 | #define MVNC_DONTBLOCK _Pragma("GCC warning \"'MVNC_DONTBLOCK' is deprecated. Please use 'MVNC_DONT_BLOCK'\"") MVNC_DONT_BLOCK 28 | #define MVNC_TIMETAKEN _Pragma("GCC warning \"'MVNC_TIMETAKEN' is deprecated. Please use 'MVNC_TIME_TAKEN'\"") MVNC_TIME_TAKEN 29 | #define MVNC_DEBUGINFO _Pragma("GCC warning \"'MVNC_DEBUGINFO' is deprecated. Please use 'MVNC_DEBUG_INFO'\"") MVNC_DEBUG_INFO 30 | 31 | // Deprecated Device Options Values 32 | #define MVNC_THERMALSTATS _Pragma("GCC warning \"'MVNC_THERMALSTATS' is deprecated. Please use 'MVNC_THERMAL_STATS'\"") MVNC_THERMAL_STATS 33 | #define MVNC_OPTIMISATIONLIST _Pragma("GCC warning \"'MVNC_OPTIMISATIONLIST' is deprecated. Please use 'MVNC_OPTIMISATION_LIST'\"") MVNC_OPTIMISATION_LIST 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /api/python/mvnc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/api/python/mvnc/__init__.py -------------------------------------------------------------------------------- /api/src/97-usbboot.rules: -------------------------------------------------------------------------------- 1 | SUBSYSTEM=="usb", ATTRS{idProduct}=="2150", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1" 2 | SUBSYSTEM=="usb", ATTRS{idProduct}=="f63b", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1" 3 | SUBSYSTEM=="tty", ATTRS{idProduct}=="2150", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1" 4 | -------------------------------------------------------------------------------- /api/src/Makefile: -------------------------------------------------------------------------------- 1 | ARCH := $(shell uname -m) 2 | 3 | LIBS += -lpthread -lusb-1.0 -ldl 4 | 5 | OUT := libmvnc.so.0 6 | OBJDIR := obj-$(ARCH) 7 | INSTALLDIR := ${DESTDIR}/usr/local 8 | PYTHON3DIST := $(shell python3 -c "import site; print(site.getsitepackages()[0])") 9 | PYTHON2DIST := $(shell python -c "import site; print(site.getsitepackages()[0])") 10 | 11 | SRCS := \ 12 | usb_boot.c \ 13 | usb_link_vsc.c \ 14 | mvnc_api.c 15 | 16 | INCLUDES := \ 17 | -I. \ 18 | -I../include \ 19 | -I$(SYSROOT)/usr/include/libusb-1.0 \ 20 | 21 | CFLAGS += -O2 -Wall -pthread -fPIC -MMD -MP 22 | LDFLAGS += -shared 23 | 24 | OBJS := $(SRCS:%.c=$(OBJDIR)/%.o) 25 | DEPS := $(OBJS:.o=.d) 26 | 27 | all: obj-$(ARCH)/libmvnc.so.0 28 | 29 | $(OBJDIR)/$(OUT): $(OBJS) 30 | $(CC) $(LDFLAGS) $(OBJS) -o $@ $(LIBS) 31 | ln -fs $(OBJDIR)/$(OUT) libmvnc.so 32 | ln -fs $(OBJDIR)/$(OUT) $(OUT) 33 | 34 | $(OBJDIR)/%.o: %.c | $(OBJDIR) 35 | $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ 36 | 37 | $(OBJDIR): 38 | @mkdir $@ 39 | 40 | -include $(DEPS) 41 | 42 | basicinstall: $(OBJDIR)/$(OUT) 43 | mkdir -p $(INSTALLDIR)/include/ 44 | mkdir -p $(INSTALLDIR)/lib/ 45 | cp $(OBJDIR)/$(OUT) $(INSTALLDIR)/lib/ 46 | ln -fs libmvnc.so.0 $(INSTALLDIR)/lib/libmvnc.so 47 | cp ../include/*.h $(INSTALLDIR)/include/ 48 | mkdir -p $(INSTALLDIR)/lib/mvnc 49 | cp mvnc/MvNCAPI.mvcmd $(INSTALLDIR)/lib/mvnc/ 50 | mkdir -p ${DESTDIR}/etc/udev/rules.d/ 51 | cp 97-usbboot.rules ${DESTDIR}/etc/udev/rules.d/ 52 | 53 | pythoninstall: 54 | mkdir -p ${DESTDIR}$(PYTHON3DIST) 55 | mkdir -p ${DESTDIR}$(PYTHON2DIST) 56 | cp -r ../python/mvnc ${DESTDIR}$(PYTHON3DIST)/ 57 | cp -r ../python/mvnc ${DESTDIR}$(PYTHON2DIST)/ 58 | 59 | postinstall: 60 | udevadm control --reload-rules 61 | udevadm trigger 62 | ldconfig 63 | 64 | install: basicinstall pythoninstall postinstall 65 | 66 | uninstall: 67 | rm -f $(INSTALLDIR)/lib/libmvnc.so.0 68 | rm -f $(INSTALLDIR)/lib/libmvnc.so 69 | rm -f $(INSTALLDIR)/include/mvnc.h 70 | rm -f $(INSTALLDIR)/include/mvnc_deprecated.h 71 | rm -f $(INSTALLDIR)/lib/mvnc/MvNCAPI.mvcmd 72 | rm -rf $(INSTALLDIR)/lib/mvnc 73 | rm -rf ${DESTDIR}$(PYTHON3DIST)/mvnc 74 | rm -rf ${DESTDIR}$(PYTHON2DIST)/mvnc 75 | rm -f ${DESTDIR}/etc/udev/rules.d/97-usbboot.rules 76 | 77 | clean: 78 | rm -f $(OUT) 79 | rm -f $(OBJS) 80 | rm -rf $(OBJDIR) 81 | rm -f libmvnc.so 82 | -------------------------------------------------------------------------------- /api/src/Makefile.rpi: -------------------------------------------------------------------------------- 1 | ARCH := armv7l 2 | 3 | PIROOT := $(shell echo $(HOME))/piroot 4 | CC := arm-linux-gnueabihf-gcc --sysroot=$(PIROOT) 5 | LIBS += -ludev -lpthread -lusb-1.0 -ldl 6 | 7 | OUT := libmvnc.so.0 8 | OBJDIR := obj-$(ARCH) 9 | INSTALLDIR := ${DESTDIR}/usr/local 10 | PYTHON3DIST := $(shell python3 -c "import site; print(site.getsitepackages()[0])") 11 | PYTHON2DIST := $(shell python -c "import site; print(site.getsitepackages()[0])") 12 | 13 | SRCS := \ 14 | usb_boot.c \ 15 | usb_link_vsc.c \ 16 | mvnc_api.c 17 | 18 | INCLUDES := \ 19 | -I. \ 20 | -I../include \ 21 | -I$(SYSROOT)/usr/include/libusb-1.0 \ 22 | 23 | CFLAGS += -O2 -Wall -pthread -fPIC -MMD -MP 24 | LDFLAGS += -shared 25 | 26 | OBJS := $(SRCS:%.c=$(OBJDIR)/%.o) 27 | DEPS := $(OBJS:.o=.d) 28 | 29 | $(OBJDIR)/$(OUT): $(OBJS) 30 | $(CC) $(LDFLAGS) $(OBJS) -o $@ $(LIBS) 31 | 32 | $(OBJDIR)/%.o: %.c | $(OBJDIR) 33 | $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ 34 | 35 | $(OBJDIR): 36 | @mkdir $@ 37 | 38 | -include $(DEPS) 39 | 40 | clean: 41 | rm -f $(OUT) 42 | rm -f $(OBJS) 43 | rm -rf $(OBJDIR) 44 | -------------------------------------------------------------------------------- /api/src/USBLinkDefines.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Intel Corporation. 3 | * The source code, information and material ("Material") contained herein is 4 | * owned by Intel Corporation or its suppliers or licensors, and title to such 5 | * Material remains with Intel Corporation or its suppliers or licensors. 6 | * The Material contains proprietary information of Intel or its suppliers and 7 | * licensors. The Material is protected by worldwide copyright laws and treaty 8 | * provisions. 9 | * No part of the Material may be used, copied, reproduced, modified, published, 10 | * uploaded, posted, transmitted, distributed or disclosed in any way without 11 | * Intel's prior express written permission. No license under any patent, 12 | * copyright or other intellectual property rights in the Material is granted to 13 | * or conferred upon you, either expressly, by implication, inducement, estoppel 14 | * or otherwise. 15 | * Any license under such intellectual property rights must be express and 16 | * approved by Intel in writing. 17 | */ 18 | 19 | #ifndef _USBLINKCOMMONDEFINES_H 20 | #define _USBLINKCOMMONDEFINES_H 21 | #include 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | #define MAX_NAME_LENGTH 52 27 | // Packet length will define the maximum message length between pc and myriad. All bigger messages than this number will be split in multiple messages 28 | #define PACKET_LENGTH (64*1024) 29 | 30 | typedef struct bufferEntryDesc_t { 31 | char name[MAX_NAME_LENGTH]; 32 | uint8_t *data; 33 | uint32_t length; 34 | } bufferEntryDesc_t; 35 | 36 | typedef enum { 37 | USB_LINK_GET_MYRIAD_STATUS = 0, 38 | USB_LINK_RESET_REQUEST, 39 | USB_LINK_HOST_SET_DATA, 40 | USB_LINK_HOST_GET_DATA 41 | } hostcommands_t; 42 | 43 | typedef enum { 44 | MYRIAD_NOT_INIT = 0, 45 | MYRIAD_INITIALIZED = 0x11, 46 | MYRIAD_WAITING = 0x22, 47 | MYRIAD_RUNNING = 0x33, 48 | MYRIAD_FINISHED = 0x44, 49 | MYRIAD_PENDING = 0x55, 50 | } myriadStatus_t; 51 | 52 | typedef struct usbHeader_t { 53 | uint8_t cmd; 54 | uint8_t hostready; 55 | uint16_t reserved; 56 | uint32_t dataLength; 57 | uint32_t offset; 58 | char name[MAX_NAME_LENGTH]; 59 | } usbHeader_t; 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | #endif 65 | /* end of include file */ 66 | -------------------------------------------------------------------------------- /api/src/common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Intel Corporation. 3 | * The source code, information and material ("Material") contained herein is 4 | * owned by Intel Corporation or its suppliers or licensors, and title to such 5 | * Material remains with Intel Corporation or its suppliers or licensors. 6 | * The Material contains proprietary information of Intel or its suppliers and 7 | * licensors. The Material is protected by worldwide copyright laws and treaty 8 | * provisions. 9 | * No part of the Material may be used, copied, reproduced, modified, published, 10 | * uploaded, posted, transmitted, distributed or disclosed in any way without 11 | * Intel's prior express written permission. No license under any patent, 12 | * copyright or other intellectual property rights in the Material is granted to 13 | * or conferred upon you, either expressly, by implication, inducement, estoppel 14 | * or otherwise. 15 | * Any license under such intellectual property rights must be express and 16 | * approved by Intel in writing. 17 | */ 18 | 19 | // Common logging macros 20 | #define PRINT_DEBUG(...) {if (mvnc_loglevel > 1) fprintf(__VA_ARGS__);} 21 | #define PRINT_DEBUG_F(...) {if (mvnc_loglevel > 1) \ 22 | { fprintf(__VA_ARGS__); fflush(stderr); } }\ 23 | 24 | #define PRINT_INFO(...) {if (mvnc_loglevel > 0) fprintf(__VA_ARGS__);} 25 | #define PRINT_INFO_F(...) {if (mvnc_loglevel > 0) \ 26 | { fprintf(__VA_ARGS__); fflush(stderr); } }\ 27 | 28 | #define PRINT(...) fprintf(stderr,__VA_ARGS__) 29 | 30 | // Common defines 31 | #define DEFAULT_VID 0x03E7 32 | #define DEFAULT_PID 0x2150 // Myriad2v2 ROM 33 | #define DEFAULT_OPEN_VID DEFAULT_VID 34 | #define DEFAULT_OPEN_PID 0xf63b // Once opened in VSC mode, VID/PID change 35 | -------------------------------------------------------------------------------- /api/src/libmvnc.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/api/src/libmvnc.so -------------------------------------------------------------------------------- /api/src/libmvnc.so.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/api/src/libmvnc.so.0 -------------------------------------------------------------------------------- /api/src/mvnc/MvNCAPI.mvcmd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/api/src/mvnc/MvNCAPI.mvcmd -------------------------------------------------------------------------------- /api/src/obj-aarch64/libmvnc.so.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/api/src/obj-aarch64/libmvnc.so.0 -------------------------------------------------------------------------------- /api/src/obj-aarch64/mvnc_api.d: -------------------------------------------------------------------------------- 1 | obj-aarch64/mvnc_api.o: mvnc_api.c ../include/mvnc.h \ 2 | ../include/mvnc_deprecated.h usb_link.h USBLinkDefines.h usb_boot.h \ 3 | common.h 4 | 5 | ../include/mvnc.h: 6 | 7 | ../include/mvnc_deprecated.h: 8 | 9 | usb_link.h: 10 | 11 | USBLinkDefines.h: 12 | 13 | usb_boot.h: 14 | 15 | common.h: 16 | -------------------------------------------------------------------------------- /api/src/obj-aarch64/mvnc_api.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/api/src/obj-aarch64/mvnc_api.o -------------------------------------------------------------------------------- /api/src/obj-aarch64/usb_boot.d: -------------------------------------------------------------------------------- 1 | obj-aarch64/usb_boot.o: usb_boot.c /usr/include/libusb-1.0/libusb.h \ 2 | usb_boot.h ../include/mvnc.h ../include/mvnc_deprecated.h common.h 3 | 4 | /usr/include/libusb-1.0/libusb.h: 5 | 6 | usb_boot.h: 7 | 8 | ../include/mvnc.h: 9 | 10 | ../include/mvnc_deprecated.h: 11 | 12 | common.h: 13 | -------------------------------------------------------------------------------- /api/src/obj-aarch64/usb_boot.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/api/src/obj-aarch64/usb_boot.o -------------------------------------------------------------------------------- /api/src/obj-aarch64/usb_link_vsc.d: -------------------------------------------------------------------------------- 1 | obj-aarch64/usb_link_vsc.o: usb_link_vsc.c \ 2 | /usr/include/libusb-1.0/libusb.h usb_link.h USBLinkDefines.h usb_boot.h \ 3 | common.h 4 | 5 | /usr/include/libusb-1.0/libusb.h: 6 | 7 | usb_link.h: 8 | 9 | USBLinkDefines.h: 10 | 11 | usb_boot.h: 12 | 13 | common.h: 14 | -------------------------------------------------------------------------------- /api/src/obj-aarch64/usb_link_vsc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/api/src/obj-aarch64/usb_link_vsc.o -------------------------------------------------------------------------------- /api/src/usb_boot.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Intel Corporation. 3 | * The source code, information and material ("Material") contained herein is 4 | * owned by Intel Corporation or its suppliers or licensors, and title to such 5 | * Material remains with Intel Corporation or its suppliers or licensors. 6 | * The Material contains proprietary information of Intel or its suppliers and 7 | * licensors. The Material is protected by worldwide copyright laws and treaty 8 | * provisions. 9 | * No part of the Material may be used, copied, reproduced, modified, published, 10 | * uploaded, posted, transmitted, distributed or disclosed in any way without 11 | * Intel's prior express written permission. No license under any patent, 12 | * copyright or other intellectual property rights in the Material is granted to 13 | * or conferred upon you, either expressly, by implication, inducement, estoppel 14 | * or otherwise. 15 | * Any license under such intellectual property rights must be express and 16 | * approved by Intel in writing. 17 | */ 18 | 19 | extern int mvnc_loglevel; 20 | int usb_find_device(unsigned idx, char *addr, unsigned addrsize, void **device, int vid, int pid); 21 | int usb_boot(const char *addr, const void *mvcmd, unsigned size); 22 | -------------------------------------------------------------------------------- /api/src/usb_link.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Intel Corporation. 3 | * The source code, information and material ("Material") contained herein is 4 | * owned by Intel Corporation or its suppliers or licensors, and title to such 5 | * Material remains with Intel Corporation or its suppliers or licensors. 6 | * The Material contains proprietary information of Intel or its suppliers and 7 | * licensors. The Material is protected by worldwide copyright laws and treaty 8 | * provisions. 9 | * No part of the Material may be used, copied, reproduced, modified, published, 10 | * uploaded, posted, transmitted, distributed or disclosed in any way without 11 | * Intel's prior express written permission. No license under any patent, 12 | * copyright or other intellectual property rights in the Material is granted to 13 | * or conferred upon you, either expressly, by implication, inducement, estoppel 14 | * or otherwise. 15 | * Any license under such intellectual property rights must be express and 16 | * approved by Intel in writing. 17 | */ 18 | 19 | #include "USBLinkDefines.h" 20 | 21 | int usblink_sendcommand(void *f, hostcommands_t command); 22 | int usblink_resetmyriad(void *f); 23 | int usblink_getmyriadstatus(void *f, myriadStatus_t *myriadState); 24 | void *usblink_open(const char *path); 25 | void usblink_close(void *f); 26 | int usblink_setdata(void *f, const char *name, const void *data, unsigned int length, int hostready); 27 | int usblink_getdata(void *f, const char *name, void *data, unsigned int length, unsigned int offset, int hostready); 28 | void usblink_resetall(); 29 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | ------- 2 | Documentation for the NCSDK is best viewed by pointing your browser here: https://movidius.github.io/ncsdk/ 3 | ------- 4 | ------- 5 | -------------------------------------------------------------------------------- /docs/assets/images/checker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/assets/images/checker.png -------------------------------------------------------------------------------- /docs/assets/js/scale.fix.js: -------------------------------------------------------------------------------- 1 | fixScale = function(doc) { 2 | 3 | var addEvent = 'addEventListener', 4 | type = 'gesturestart', 5 | qsa = 'querySelectorAll', 6 | scales = [1, 1], 7 | meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : []; 8 | 9 | function fix() { 10 | meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1]; 11 | doc.removeEventListener(type, fix, true); 12 | } 13 | 14 | if ((meta = meta[meta.length - 1]) && addEvent in doc) { 15 | fix(); 16 | scales = [.25, 1.6]; 17 | doc[addEvent](type, fix, true); 18 | } 19 | 20 | }; -------------------------------------------------------------------------------- /docs/config.rb: -------------------------------------------------------------------------------- 1 | # Require any additional compass plugins here. 2 | 3 | # Set this to the root of your project when deployed: 4 | http_path = "SITE_ROOT" 5 | css_dir = "stylesheets" 6 | sass_dir = "sass" 7 | images_dir = "images" 8 | javascripts_dir = "javascripts" 9 | 10 | # You can select your preferred output style here (can be overridden via the command line): 11 | # output_style = :expanded or :nested or :compact or :compressed 12 | 13 | # To enable relative paths to assets via compass helper functions. Uncomment: 14 | # relative_assets = true 15 | 16 | # To disable debugging comments that display the original location of your selectors. Uncomment: 17 | # line_comments = false 18 | 19 | # If you prefer the indented syntax, you might want to regenerate this 20 | # project again passing --syntax sass, or you can uncomment this: 21 | # preferred_syntax = :sass 22 | # and then run: 23 | # sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass 24 | preferred_syntax = :scss 25 | 26 | line_comments = false # by Compass.app 27 | -------------------------------------------------------------------------------- /docs/css/boxshadowproperties.css: -------------------------------------------------------------------------------- 1 | /* box-shadow fonts return errors with prince, so extracting here to put in web output only */ 2 | 3 | #search-demo-container ul#results-container { 4 | box-shadow: 2px 3px 2px #dedede; 5 | } 6 | 7 | 8 | hr.shaded { 9 | box-shadow: inset 0 6px 6px -6px rgba(0,0,0,0.5); 10 | } 11 | 12 | .videoThumbs img { 13 | box-shadow: 2px 2px 1px #f0f0f0; 14 | } 15 | 16 | .box { 17 | box-shadow: 2px 2px 4px #dedede; 18 | } 19 | 20 | @media (max-width: 1200px) { 21 | .navbar-collapse { 22 | box-shadow: inset 0 1px 0 rgba(255,255,255,0.1); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /docs/css/modern-business.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Start Bootstrap - Modern Business HTML Template (http://startbootstrap.com) 3 | * Code licensed under the Apache License v2.0. 4 | * For details, see http://www.apache.org/licenses/LICENSE-2.0. 5 | */ 6 | 7 | /* Global Styles */ 8 | 9 | html, 10 | body { 11 | height: 100%; 12 | } 13 | 14 | .img-portfolio { 15 | margin-bottom: 30px; 16 | } 17 | 18 | .img-hover:hover { 19 | opacity: 0.8; 20 | } 21 | 22 | /* Home Page Carousel */ 23 | 24 | header.carousel { 25 | height: 50%; 26 | } 27 | 28 | header.carousel .item, 29 | header.carousel .item.active, 30 | header.carousel .carousel-inner { 31 | height: 100%; 32 | } 33 | 34 | header.carousel .fill { 35 | width: 100%; 36 | height: 100%; 37 | background-position: center; 38 | background-size: cover; 39 | } 40 | 41 | /* 404 Page Styles */ 42 | 43 | .error-404 { 44 | font-size: 100px; 45 | } 46 | 47 | /* Pricing Page Styles */ 48 | 49 | .price { 50 | display: block; 51 | font-size: 50px; 52 | line-height: 50px; 53 | } 54 | 55 | .price sup { 56 | top: -20px; 57 | left: 2px; 58 | font-size: 20px; 59 | } 60 | 61 | .period { 62 | display: block; 63 | font-style: italic; 64 | } 65 | 66 | /* Footer Styles */ 67 | 68 | footer { 69 | margin: 50px 0; 70 | } 71 | 72 | /* Responsive Styles */ 73 | 74 | @media(max-width:991px) { 75 | .client-img, 76 | .img-related { 77 | margin-bottom: 30px; 78 | } 79 | } 80 | 81 | @media(max-width:767px) { 82 | .img-portfolio { 83 | margin-bottom: 15px; 84 | } 85 | 86 | header.carousel .carousel { 87 | height: 70%; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /docs/css/printstyles.css: -------------------------------------------------------------------------------- 1 | 2 | /*body.print .container {max-width: 650px;}*/ 3 | 4 | body { 5 | font-size:14px; 6 | } 7 | .nav ul li a {border-top:0px; background-color:transparent; color: #808080; } 8 | #navig a[href] {color: #595959 !important;} 9 | table .table {max-width:650px;} 10 | 11 | #navig li.sectionHead {font-weight: bold; font-size: 18px; color: #595959 !important; } 12 | #navig li {font-weight: normal; } 13 | 14 | #navig a[href]::after { content: leader(".") target-counter(attr(href), page); } 15 | 16 | a[href]::after { 17 | content: " (page " target-counter(attr(href), page) ")" 18 | } 19 | 20 | a[href^="http:"]::after, a[href^="https:"]::after { 21 | content: ""; 22 | } 23 | 24 | a[href] { 25 | color: blue !important; 26 | } 27 | a[href*="mailto"]::after, a[data-toggle="tooltip"]::after, a[href].noCrossRef::after { 28 | content: ""; 29 | } 30 | 31 | 32 | @page { 33 | margin: 60pt 90pt 60pt 90pt; 34 | font-family: sans-serif; 35 | font-style:none; 36 | color: gray; 37 | 38 | } 39 | 40 | .printTitle { 41 | line-height:30pt; 42 | font-size:27pt; 43 | font-weight: bold; 44 | letter-spacing: -.5px; 45 | margin-bottom:25px; 46 | } 47 | 48 | .printSubtitle { 49 | font-size: 19pt; 50 | color: #cccccc !important; 51 | font-family: "Grotesque MT Light"; 52 | line-height: 22pt; 53 | letter-spacing: -.5px; 54 | margin-bottom:20px; 55 | } 56 | .printTitleArea hr { 57 | color: #999999 !important; 58 | height: 2px; 59 | width: 100%; 60 | } 61 | 62 | .printTitleImage { 63 | max-width:300px; 64 | margin-bottom:200px; 65 | } 66 | 67 | 68 | .printTitleImage { 69 | max-width: 250px; 70 | } 71 | 72 | #navig { 73 | /*page-break-before: always;*/ 74 | } 75 | 76 | .copyrightBoilerplate { 77 | page-break-before:always; 78 | font-size:14px; 79 | } 80 | 81 | .lastGeneratedDate { 82 | font-style: italic; 83 | font-size:14px; 84 | color: gray; 85 | } 86 | 87 | .alert a { 88 | text-decoration: none !important; 89 | } 90 | 91 | 92 | body.title { page: title } 93 | 94 | @page title { 95 | @top-left { 96 | content: " "; 97 | } 98 | @top-right { 99 | content: " " 100 | } 101 | @bottom-right { 102 | content: " "; 103 | } 104 | @bottom-left { 105 | content: " "; 106 | } 107 | } 108 | 109 | body.frontmatter { page: frontmatter } 110 | body.frontmatter {counter-reset: page 1} 111 | 112 | 113 | @page frontmatter { 114 | @top-left { 115 | content: prince-script(guideName); 116 | } 117 | @top-right { 118 | content: prince-script(datestamp); 119 | } 120 | @bottom-right { 121 | content: counter(page, lower-roman); 122 | } 123 | @bottom-left { 124 | content: "youremail@domain.com"; } 125 | } 126 | 127 | body.first_page {counter-reset: page 1} 128 | 129 | h1 { string-set: doctitle content() } 130 | 131 | @page { 132 | @top-left { 133 | content: string(doctitle); 134 | font-size: 11px; 135 | font-style: italic; 136 | } 137 | @top-right { 138 | content: prince-script(datestamp); 139 | font-size: 11px; 140 | } 141 | 142 | @bottom-right { 143 | content: "Page " counter(page); 144 | font-size: 11px; 145 | } 146 | @bottom-left { 147 | content: prince-script(guideName); 148 | font-size: 11px; 149 | } 150 | } 151 | .alert { 152 | background-color: #fafafa !important; 153 | border-color: #dedede !important; 154 | color: black; 155 | } 156 | 157 | pre { 158 | background-color: #fafafa; 159 | } 160 | -------------------------------------------------------------------------------- /docs/css/syntax.css: -------------------------------------------------------------------------------- 1 | .highlight { background: #ffffff; } 2 | .highlight .c { color: #999988; font-style: italic } /* Comment */ 3 | .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ 4 | .highlight .k { font-weight: bold } /* Keyword */ 5 | .highlight .o { font-weight: bold } /* Operator */ 6 | .highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */ 7 | .highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */ 8 | .highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */ 9 | .highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ 10 | .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ 11 | .highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */ 12 | .highlight .ge { font-style: italic } /* Generic.Emph */ 13 | .highlight .gr { color: #aa0000 } /* Generic.Error */ 14 | .highlight .gh { color: #999999 } /* Generic.Heading */ 15 | .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ 16 | .highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */ 17 | .highlight .go { color: #888888 } /* Generic.Output */ 18 | .highlight .gp { color: #555555 } /* Generic.Prompt */ 19 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 20 | .highlight .gu { color: #aaaaaa } /* Generic.Subheading */ 21 | .highlight .gt { color: #aa0000 } /* Generic.Traceback */ 22 | .highlight .kc { font-weight: bold } /* Keyword.Constant */ 23 | .highlight .kd { font-weight: bold } /* Keyword.Declaration */ 24 | .highlight .kp { font-weight: bold } /* Keyword.Pseudo */ 25 | .highlight .kr { font-weight: bold } /* Keyword.Reserved */ 26 | .highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */ 27 | .highlight .m { color: #009999 } /* Literal.Number */ 28 | .highlight .s { color: #d14 } /* Literal.String */ 29 | .highlight .na { color: #008080 } /* Name.Attribute */ 30 | .highlight .nb { color: #0086B3 } /* Name.Builtin */ 31 | .highlight .nc { color: #445588; font-weight: bold } /* Name.Class */ 32 | .highlight .no { color: #008080 } /* Name.Constant */ 33 | .highlight .ni { color: #800080 } /* Name.Entity */ 34 | .highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */ 35 | .highlight .nf { color: #990000; font-weight: bold } /* Name.Function */ 36 | .highlight .nn { color: #555555 } /* Name.Namespace */ 37 | .highlight .nt { color: #000080 } /* Name.Tag */ 38 | .highlight .nv { color: #008080 } /* Name.Variable */ 39 | .highlight .ow { font-weight: bold } /* Operator.Word */ 40 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 41 | .highlight .mf { color: #009999 } /* Literal.Number.Float */ 42 | .highlight .mh { color: #009999 } /* Literal.Number.Hex */ 43 | .highlight .mi { color: #009999 } /* Literal.Number.Integer */ 44 | .highlight .mo { color: #009999 } /* Literal.Number.Oct */ 45 | .highlight .sb { color: #d14 } /* Literal.String.Backtick */ 46 | .highlight .sc { color: #d14 } /* Literal.String.Char */ 47 | .highlight .sd { color: #d14 } /* Literal.String.Doc */ 48 | .highlight .s2 { color: #d14 } /* Literal.String.Double */ 49 | .highlight .se { color: #d14 } /* Literal.String.Escape */ 50 | .highlight .sh { color: #d14 } /* Literal.String.Heredoc */ 51 | .highlight .si { color: #d14 } /* Literal.String.Interpol */ 52 | .highlight .sx { color: #d14 } /* Literal.String.Other */ 53 | .highlight .sr { color: #009926 } /* Literal.String.Regex */ 54 | .highlight .s1 { color: #d14 } /* Literal.String.Single */ 55 | .highlight .ss { color: #990073 } /* Literal.String.Symbol */ 56 | .highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */ 57 | .highlight .vc { color: #008080 } /* Name.Variable.Class */ 58 | .highlight .vg { color: #008080 } /* Name.Variable.Global */ 59 | .highlight .vi { color: #008080 } /* Name.Variable.Instance */ 60 | .highlight .il { color: #009999 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /docs/css/theme-blue.css: -------------------------------------------------------------------------------- 1 | .summary { 2 | color: #808080; 3 | border-left: 5px solid #ED1951; 4 | font-size:16px; 5 | } 6 | 7 | .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { 8 | background-color: #0071C5; 9 | color: white; 10 | } 11 | 12 | .nav > li.active > a { 13 | background-color: #0071C5; 14 | } 15 | 16 | .nav > li > a:hover { 17 | background-color: #0071C5; 18 | } 19 | 20 | div.navbar-collapse .dropdown-menu > li > a:hover { 21 | background-color: #0071C5; 22 | } 23 | 24 | .nav li.thirdlevel > a { 25 | background-color: #FAFAFA !important; 26 | color: #0071C5; 27 | font-weight: bold; 28 | } 29 | 30 | a[data-toggle="tooltip"] { 31 | color: #649345; 32 | font-style: italic; 33 | cursor: default; 34 | } 35 | 36 | .navbar-inverse { 37 | background-color: #0071C5; 38 | border-color: #015CAE; 39 | } 40 | .navbar-inverse .navbar-nav>li>a, .navbar-inverse .navbar-brand { 41 | color: white; 42 | } 43 | 44 | .navbar-inverse .navbar-nav>li>a:hover, a.fa.fa-home.fa-lg.navbar-brand:hover { 45 | color: #f0f0f0; 46 | } 47 | 48 | a.navbar-brand:hover { 49 | color: #f0f0f0; 50 | } 51 | 52 | .navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .open > a:hover, .navbar-inverse .navbar-nav > .open > a:focus { 53 | color: #015CAE; 54 | } 55 | 56 | .navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .open > a:hover, .navbar-inverse .navbar-nav > .open > a:focus { 57 | background-color: #015CAE; 58 | color: #ffffff; 59 | } 60 | 61 | .navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form { 62 | border-color: #0071C5 !important; 63 | } 64 | 65 | .btn-primary { 66 | color: #ffffff; 67 | background-color: #0071C5; 68 | border-color: #0071C5; 69 | } 70 | 71 | .navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus { 72 | background-color: #0071C5; 73 | } 74 | 75 | .btn-primary:hover, 76 | .btn-primary:focus, 77 | .btn-primary:active, 78 | .btn-primary.active, 79 | .open .dropdown-toggle.btn-primary { 80 | background-color: #0071C5; 81 | border-color: #0071C5; 82 | } 83 | 84 | .printTitle { 85 | color: #015CAE !important; 86 | } 87 | 88 | body.print h1 {color: #015CAE !important; font-size:28px !important;} 89 | body.print h2 {color: #595959 !important; font-size:20px !important;} 90 | body.print h3 {color: #E50E51 !important; font-size:14px !important;} 91 | body.print h4 {color: #679DCE !important; font-size:14px; font-style: italic !important;} 92 | 93 | .anchorjs-link:hover { 94 | color: #216f9b; 95 | } 96 | 97 | div.sidebarTitle { 98 | color: #015CAE; 99 | } 100 | 101 | li.sidebarTitle { 102 | margin-top:20px; 103 | font-weight:normal; 104 | font-size:130%; 105 | color: #0071C5; 106 | margin-bottom:10px; 107 | margin-left: 5px; 108 | 109 | } 110 | 111 | .navbar-inverse .navbar-toggle:focus, .navbar-inverse .navbar-toggle:hover { 112 | background-color: #015CAE; 113 | } 114 | 115 | .navbar-inverse .navbar-toggle { 116 | border-color: #015CAE; 117 | } 118 | -------------------------------------------------------------------------------- /docs/css/theme-green.css: -------------------------------------------------------------------------------- 1 | .summary { 2 | color: #808080; 3 | border-left: 5px solid #E50E51; 4 | font-size:16px; 5 | } 6 | 7 | 8 | h3 {color: #E50E51; } 9 | h4 {color: #808080; } 10 | 11 | .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { 12 | background-color: #248ec2; 13 | color: white; 14 | } 15 | 16 | .nav > li.active > a { 17 | background-color: #72ac4a; 18 | } 19 | 20 | .nav > li > a:hover { 21 | background-color: #72ac4a; 22 | } 23 | 24 | div.navbar-collapse .dropdown-menu > li > a:hover { 25 | background-color: #72ac4a; 26 | } 27 | 28 | .navbar-inverse .navbar-nav>li>a, .navbar-inverse .navbar-brand { 29 | color: white; 30 | } 31 | 32 | .navbar-inverse .navbar-nav>li>a:hover, a.fa.fa-home.fa-lg.navbar-brand:hover { 33 | color: #f0f0f0; 34 | } 35 | 36 | .nav li.thirdlevel > a { 37 | background-color: #FAFAFA !important; 38 | color: #72ac4a; 39 | font-weight: bold; 40 | } 41 | 42 | a[data-toggle="tooltip"] { 43 | color: #649345; 44 | font-style: italic; 45 | cursor: default; 46 | } 47 | 48 | .navbar-inverse { 49 | background-color: #72ac4a; 50 | border-color: #5b893c; 51 | } 52 | 53 | .navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .open > a:hover, .navbar-inverse .navbar-nav > .open > a:focus { 54 | color: #5b893c; 55 | } 56 | 57 | .navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .open > a:hover, .navbar-inverse .navbar-nav > .open > a:focus { 58 | background-color: #5b893c; 59 | color: #ffffff; 60 | } 61 | 62 | /* not sure if using this ...*/ 63 | .navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form { 64 | border-color: #72ac4a !important; 65 | } 66 | 67 | .btn-primary { 68 | color: #ffffff; 69 | background-color: #5b893c; 70 | border-color: #5b893c; 71 | } 72 | 73 | .btn-primary:hover, 74 | .btn-primary:focus, 75 | .btn-primary:active, 76 | .btn-primary.active, 77 | .open .dropdown-toggle.btn-primary { 78 | background-color: #72ac4a; 79 | border-color: #5b893c; 80 | } 81 | 82 | .printTitle { 83 | color: #5b893c !important; 84 | } 85 | 86 | body.print h1 {color: #5b893c !important; font-size:28px;} 87 | body.print h2 {color: #595959 !important; font-size:24px;} 88 | body.print h3 {color: #E50E51 !important; font-size:14px;} 89 | body.print h4 {color: #679DCE !important; font-size:14px; font-style: italic;} 90 | 91 | .anchorjs-link:hover { 92 | color: #4f7233; 93 | } 94 | 95 | div.sidebarTitle { 96 | color: #E50E51; 97 | } 98 | 99 | li.sidebarTitle { 100 | margin-top:20px; 101 | font-weight:normal; 102 | font-size:130%; 103 | color: #ED1951; 104 | margin-bottom:10px; 105 | margin-left: 5px; 106 | } 107 | 108 | .navbar-inverse .navbar-toggle:focus, .navbar-inverse .navbar-toggle:hover { 109 | background-color: #E50E51; 110 | } 111 | -------------------------------------------------------------------------------- /docs/fonts/IntelClear-Bold-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/fonts/IntelClear-Bold-webfont.eot -------------------------------------------------------------------------------- /docs/fonts/IntelClear-Bold-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/fonts/IntelClear-Bold-webfont.ttf -------------------------------------------------------------------------------- /docs/fonts/IntelClear-Bold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/fonts/IntelClear-Bold-webfont.woff -------------------------------------------------------------------------------- /docs/fonts/IntelClear-Light-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/fonts/IntelClear-Light-webfont.eot -------------------------------------------------------------------------------- /docs/fonts/IntelClear-Light-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/fonts/IntelClear-Light-webfont.ttf -------------------------------------------------------------------------------- /docs/fonts/IntelClear-Light-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/fonts/IntelClear-Light-webfont.woff -------------------------------------------------------------------------------- /docs/fonts/IntelClear-Regular-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/fonts/IntelClear-Regular-webfont.eot -------------------------------------------------------------------------------- /docs/fonts/IntelClear-Regular-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/fonts/IntelClear-Regular-webfont.ttf -------------------------------------------------------------------------------- /docs/fonts/IntelClear-Regular-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/fonts/IntelClear-Regular-webfont.woff -------------------------------------------------------------------------------- /docs/fonts/Intelicon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/fonts/Intelicon.eot -------------------------------------------------------------------------------- /docs/fonts/Intelicon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/fonts/Intelicon.ttf -------------------------------------------------------------------------------- /docs/fonts/Intelicon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/fonts/Intelicon.woff -------------------------------------------------------------------------------- /docs/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /docs/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /docs/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /docs/images/GoogLeNet_gv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/images/GoogLeNet_gv.png -------------------------------------------------------------------------------- /docs/images/NCS1_ArchDiagram.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/images/NCS1_ArchDiagram.jpg -------------------------------------------------------------------------------- /docs/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/images/favicon.ico -------------------------------------------------------------------------------- /docs/images/freezegraph_diagram.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/images/freezegraph_diagram.jpg -------------------------------------------------------------------------------- /docs/images/ncs_plugged.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/images/ncs_plugged.jpg -------------------------------------------------------------------------------- /docs/images/ncs_workflow.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/images/ncs_workflow.jpg -------------------------------------------------------------------------------- /docs/images/python_api_class_diagram.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/images/python_api_class_diagram.jpg -------------------------------------------------------------------------------- /docs/jekyll-theme-modernist.gemspec: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | Gem::Specification.new do |s| 4 | s.name = "jekyll-theme-modernist" 5 | s.version = "0.1.0" 6 | s.license = "CC0-1.0" 7 | s.authors = ["Steve Smith", "GitHub, Inc."] 8 | s.email = ["opensource+jekyll-theme-modernist@github.com"] 9 | s.homepage = "https://github.com/pages-themes/modernist" 10 | s.summary = "Modernist is a Jekyll theme for GitHub Pages" 11 | 12 | s.files = `git ls-files -z`.split("\x0").select do |f| 13 | f.match(%r{^((_includes|_layouts|_sass|assets)/|(LICENSE|README)((\.(txt|md|markdown)|$)))}i) 14 | end 15 | 16 | s.platform = Gem::Platform::RUBY 17 | s.add_runtime_dependency "jekyll", "~> 3.5" 18 | s.add_runtime_dependency "jekyll-seo-tag", "~> 2.0" 19 | end 20 | -------------------------------------------------------------------------------- /docs/js/customscripts.js: -------------------------------------------------------------------------------- 1 | $('#mysidebar').height($(".nav").height()); 2 | 3 | 4 | $( document ).ready(function() { 5 | 6 | //this script says, if the height of the viewport is greater than 800px, then insert affix class, which makes the nav bar float in a fixed 7 | // position as your scroll. if you have a lot of nav items, this height may not work for you. 8 | var h = $(window).height(); 9 | //console.log (h); 10 | if (h > 600) { 11 | $( "#mysidebar" ).attr("class", "nav affix"); 12 | } 13 | // activate tooltips. although this is a bootstrap js function, it must be activated this way in your theme. 14 | $('[data-toggle="tooltip"]').tooltip({ 15 | placement : 'top' 16 | }); 17 | 18 | /** 19 | * AnchorJS 20 | */ 21 | anchors.add('h2,h3,h4,h5'); 22 | 23 | }); 24 | 25 | // needed for nav tabs on pages. See Formatting > Nav tabs for more details. 26 | // script from http://stackoverflow.com/questions/10523433/how-do-i-keep-the-current-tab-active-with-twitter-bootstrap-after-a-page-reload 27 | $(function() { 28 | var json, tabsState; 29 | $('a[data-toggle="pill"], a[data-toggle="tab"]').on('shown.bs.tab', function(e) { 30 | var href, json, parentId, tabsState; 31 | 32 | tabsState = localStorage.getItem("tabs-state"); 33 | json = JSON.parse(tabsState || "{}"); 34 | parentId = $(e.target).parents("ul.nav.nav-pills, ul.nav.nav-tabs").attr("id"); 35 | href = $(e.target).attr('href'); 36 | json[parentId] = href; 37 | 38 | return localStorage.setItem("tabs-state", JSON.stringify(json)); 39 | }); 40 | 41 | tabsState = localStorage.getItem("tabs-state"); 42 | json = JSON.parse(tabsState || "{}"); 43 | 44 | $.each(json, function(containerId, href) { 45 | return $("#" + containerId + " a[href=" + href + "]").tab('show'); 46 | }); 47 | 48 | $("ul.nav.nav-pills, ul.nav.nav-tabs").each(function() { 49 | var $this = $(this); 50 | if (!json[$this.attr("id")]) { 51 | return $this.find("a[data-toggle=tab]:first, a[data-toggle=pill]:first").tab("show"); 52 | } 53 | }); 54 | }); 55 | -------------------------------------------------------------------------------- /docs/js/jquery.ba-throttle-debounce.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery throttle / debounce - v1.1 - 3/7/2010 3 | * http://benalman.com/projects/jquery-throttle-debounce-plugin/ 4 | * 5 | * Copyright (c) 2010 "Cowboy" Ben Alman 6 | * Dual licensed under the MIT and GPL licenses. 7 | * http://benalman.com/about/license/ 8 | */ 9 | (function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this); -------------------------------------------------------------------------------- /docs/js/jquery.navgoco.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery Navgoco Menus Plugin v0.2.1 (2014-04-11) 3 | * https://github.com/tefra/navgoco 4 | * 5 | * Copyright (c) 2014 Chris T (@tefra) 6 | * BSD - https://github.com/tefra/navgoco/blob/master/LICENSE-BSD 7 | */ 8 | !function(a){"use strict";var b=function(b,c,d){return this.el=b,this.$el=a(b),this.options=c,this.uuid=this.$el.attr("id")?this.$el.attr("id"):d,this.state={},this.init(),this};b.prototype={init:function(){var b=this;b._load(),b.$el.find("ul").each(function(c){var d=a(this);d.attr("data-index",c),b.options.save&&b.state.hasOwnProperty(c)?(d.parent().addClass(b.options.openClass),d.show()):d.parent().hasClass(b.options.openClass)?(d.show(),b.state[c]=1):d.hide()});var c=a("").prepend(b.options.caretHtml),d=b.$el.find("li > a");b._trigger(c,!1),b._trigger(d,!0),b.$el.find("li:has(ul) > a").prepend(c)},_trigger:function(b,c){var d=this;b.on("click",function(b){b.stopPropagation();var e=c?a(this).next():a(this).parent().next(),f=!1;if(c){var g=a(this).attr("href");f=void 0===g||""===g||"#"===g}if(e=e.length>0?e:!1,d.options.onClickBefore.call(this,b,e),!c||e&&f)b.preventDefault(),d._toggle(e,e.is(":hidden")),d._save();else if(d.options.accordion){var h=d.state=d._parents(a(this));d.$el.find("ul").filter(":visible").each(function(){var b=a(this),c=b.attr("data-index");h.hasOwnProperty(c)||d._toggle(b,!1)}),d._save()}d.options.onClickAfter.call(this,b,e)})},_toggle:function(b,c){var d=this,e=b.attr("data-index"),f=b.parent();if(d.options.onToggleBefore.call(this,b,c),c){if(f.addClass(d.options.openClass),b.slideDown(d.options.slide),d.state[e]=1,d.options.accordion){var g=d.state=d._parents(b);g[e]=d.state[e]=1,d.$el.find("ul").filter(":visible").each(function(){var b=a(this),c=b.attr("data-index");g.hasOwnProperty(c)||d._toggle(b,!1)})}}else f.removeClass(d.options.openClass),b.slideUp(d.options.slide),d.state[e]=0;d.options.onToggleAfter.call(this,b,c)},_parents:function(b,c){var d={},e=b.parent(),f=e.parents("ul");return f.each(function(){var b=a(this),e=b.attr("data-index");return e?void(d[e]=c?b:1):!1}),d},_save:function(){if(this.options.save){var b={};for(var d in this.state)1===this.state[d]&&(b[d]=1);c[this.uuid]=this.state=b,a.cookie(this.options.cookie.name,JSON.stringify(c),this.options.cookie)}},_load:function(){if(this.options.save){if(null===c){var b=a.cookie(this.options.cookie.name);c=b?JSON.parse(b):{}}this.state=c.hasOwnProperty(this.uuid)?c[this.uuid]:{}}},toggle:function(b){var c=this,d=arguments.length;if(1>=d)c.$el.find("ul").each(function(){var d=a(this);c._toggle(d,b)});else{var e,f={},g=Array.prototype.slice.call(arguments,1);d--;for(var h=0;d>h;h++){e=g[h];var i=c.$el.find('ul[data-index="'+e+'"]').first();if(i&&(f[e]=i,b)){var j=c._parents(i,!0);for(var k in j)f.hasOwnProperty(k)||(f[k]=j[k])}}for(e in f)c._toggle(f[e],b)}c._save()},destroy:function(){a.removeData(this.$el),this.$el.find("li:has(ul) > a").unbind("click"),this.$el.find("li:has(ul) > a > span").unbind("click")}},a.fn.navgoco=function(c){if("string"==typeof c&&"_"!==c.charAt(0)&&"init"!==c)var d=!0,e=Array.prototype.slice.call(arguments,1);else c=a.extend({},a.fn.navgoco.defaults,c||{}),a.cookie||(c.save=!1);return this.each(function(f){var g=a(this),h=g.data("navgoco");h||(h=new b(this,d?a.fn.navgoco.defaults:c,f),g.data("navgoco",h)),d&&h[c].apply(h,e)})};var c=null;a.fn.navgoco.defaults={caretHtml:"",accordion:!1,openClass:"open",save:!0,cookie:{name:"navgoco",expires:!1,path:"/"},slide:{duration:400,easing:"swing"},onClickBefore:a.noop,onClickAfter:a.noop,onToggleBefore:a.noop,onToggleAfter:a.noop}}(jQuery); -------------------------------------------------------------------------------- /docs/js/toc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/ghiculescu/jekyll-table-of-contents 2 | (function($){ 3 | $.fn.toc = function(options) { 4 | var defaults = { 5 | noBackToTopLinks: false, 6 | title: '', 7 | minimumHeaders: 3, 8 | headers: 'h1, h2, h3, h4', 9 | listType: 'ol', // values: [ol|ul] 10 | showEffect: 'show', // values: [show|slideDown|fadeIn|none] 11 | showSpeed: 'slow' // set to 0 to deactivate effect 12 | }, 13 | settings = $.extend(defaults, options); 14 | 15 | var headers = $(settings.headers).filter(function() { 16 | // get all headers with an ID 17 | var previousSiblingName = $(this).prev().attr( "name" ); 18 | if (!this.id && previousSiblingName) { 19 | this.id = $(this).attr( "id", previousSiblingName.replace(/\./g, "-") ); 20 | } 21 | return this.id; 22 | }), output = $(this); 23 | if (!headers.length || headers.length < settings.minimumHeaders || !output.length) { 24 | return; 25 | } 26 | 27 | if (0 === settings.showSpeed) { 28 | settings.showEffect = 'none'; 29 | } 30 | 31 | var render = { 32 | show: function() { output.hide().html(html).show(settings.showSpeed); }, 33 | slideDown: function() { output.hide().html(html).slideDown(settings.showSpeed); }, 34 | fadeIn: function() { output.hide().html(html).fadeIn(settings.showSpeed); }, 35 | none: function() { output.html(html); } 36 | }; 37 | 38 | var get_level = function(ele) { return parseInt(ele.nodeName.replace("H", ""), 10); } 39 | var highest_level = headers.map(function(_, ele) { return get_level(ele); }).get().sort()[0]; 40 | var return_to_top = ' '; 41 | 42 | var level = get_level(headers[0]), 43 | this_level, 44 | html = settings.title + " <"+settings.listType+">"; 45 | headers.on('click', function() { 46 | if (!settings.noBackToTopLinks) { 47 | window.location.hash = this.id; 48 | } 49 | }) 50 | .addClass('clickable-header') 51 | .each(function(_, header) { 52 | this_level = get_level(header); 53 | if (!settings.noBackToTopLinks && this_level === highest_level) { 54 | $(header).addClass('top-level-header').after(return_to_top); 55 | } 56 | if (this_level === level) // same level as before; same indenting 57 | html += "
  • " + header.innerHTML + ""; 58 | else if (this_level <= level){ // higher level than before; end parent ol 59 | for(i = this_level; i < level; i++) { 60 | html += "
  • " 61 | } 62 | html += "
  • " + header.innerHTML + ""; 63 | } 64 | else if (this_level > level) { // lower level than before; expand the previous to contain a ol 65 | for(i = this_level; i > level; i--) { 66 | html += "<"+settings.listType+">
  • " 67 | } 68 | html += "" + header.innerHTML + ""; 69 | } 70 | level = this_level; // update for the next one 71 | }); 72 | html += ""; 73 | if (!settings.noBackToTopLinks) { 74 | $(document).on('click', '.back-to-top', function() { 75 | $(window).scrollTop(0); 76 | window.location.hash = ''; 77 | }); 78 | } 79 | 80 | render[settings.showEffect](); 81 | }; 82 | })(jQuery); -------------------------------------------------------------------------------- /docs/licenses/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Tom Johnson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/licenses/LICENSE-BSD-NAVGOCO.txt: -------------------------------------------------------------------------------- 1 | /* This license pertains to the Navgoco jQuery component used for the sidebar. */ 2 | 3 | Copyright (c) 2013, Christodoulos Tsoulloftas, http://www.komposta.net 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without modification, 7 | are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | * Neither the name of the nor the names of its 15 | contributors may be used to endorse or promote products derived from this 16 | software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 23 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 27 | OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /docs/readme.md: -------------------------------------------------------------------------------- 1 | ------- 2 | Documentation for the NCSDK is best viewed by pointing your browser here: https://movidius.github.io/ncsdk/ 3 | ------- 4 | ------- 5 | -------------------------------------------------------------------------------- /docs/thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/docs/thumbnail.png -------------------------------------------------------------------------------- /examples/Makefile: -------------------------------------------------------------------------------- 1 | 2 | ifneq ($(findstring movidius, $(PYTHONPATH)), movidius) 3 | export PYTHONPATH:=/opt/movidius/caffe/python:$(PYTHONPATH) 4 | endif 5 | 6 | TOPTARGETS := all clean check profile compile run 7 | 8 | SUBDIRS := $(wildcard */.) 9 | 10 | $(TOPTARGETS): $(SUBDIRS) 11 | $(SUBDIRS): 12 | $(MAKE) -C $@ $(MAKECMDGOALS) 13 | 14 | .PHONY: $(TOPTARGETS) $(SUBDIRS) 15 | 16 | .PHONY: help 17 | help: 18 | @echo "Possible Make targets" 19 | @echo " make help - shows this message" 20 | @echo " make all - Makes all targets" 21 | @echo " make clean - Removes all temp files from all directories" 22 | @echo " make check - Runs check on all caffe/tensorflow models" 23 | @echo " make profile - Runs profile on all caffe/tensorflow models" 24 | @echo " make compile - Runs compile on all caffe/tensorflow models" 25 | @echo " make run - Runs all caffe/tensorflow/apps" 26 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | A Makefile is provided to compile profile and check all the caffe and tensorflow networks on the Neural Compute Stick using the Neural Compute SDK. The Makefile also builds some example applications that demonstrate the usage of the compiled networks. Each network includes python and/or C++ example code right along with the network and the apps directory contains some other example programs as well. 3 | 4 | ## make all 5 | Executing 'make all' builds all the following networks and applications 6 | 7 | * Caffe 8 | * GoogLeNet 9 | * AlexNet 10 | * SqueezeNet 11 | 12 | * TensorFlow 13 | * Inception V1 14 | * Inception V3 15 | 16 | * Applications 17 | * hello_ncs_py 18 | * hello_ncs_cpp 19 | * multistick_cpp 20 | 21 | ## make compile 22 | Compiles all the networks 23 | ## make profile 24 | Runs profile on all the networks 25 | ## make check 26 | Runs 'make check' on all the networks 27 | ## make run 28 | Runs the python example in all the networks 29 | -------------------------------------------------------------------------------- /examples/apps/Makefile: -------------------------------------------------------------------------------- 1 | 2 | ifneq ($(findstring movidius, $(PYTHONPATH)), movidius) 3 | export PYTHONPATH:=/opt/movidius/caffe/python:$(PYTHONPATH) 4 | endif 5 | 6 | TOPTARGETS := all clean 7 | 8 | SUBDIRS := $(wildcard */.) 9 | 10 | $(TOPTARGETS): $(SUBDIRS) 11 | $(SUBDIRS): 12 | $(MAKE) -C $@ $(MAKECMDGOALS) 13 | 14 | .PHONY: $(TOPTARGETS) $(SUBDIRS) 15 | 16 | .PHONY: help 17 | help: 18 | @echo "Possible make targets: "; 19 | @echo " make help - shows this message"; 20 | @echo " make all - does make all in each sub directory"; 21 | @echo " make clean - does make clean in each subdirectory"; 22 | 23 | check profile compile run: 24 | -------------------------------------------------------------------------------- /examples/apps/README.md: -------------------------------------------------------------------------------- 1 | #Application examples 2 | -------------------------------------------------------------------------------- /examples/apps/hello_ncs_cpp/Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | .PHONY: all 5 | all: hello_ncs_cpp 6 | 7 | 8 | .PHONY: hello_ncs_cpp 9 | hello_ncs_cpp: 10 | @echo "\nmaking hello_ncs_cpp" 11 | g++ cpp/hello_ncs.cpp -o cpp/hello_ncs_cpp -lmvnc 12 | @echo "Created cpp/hello_ncs_cpp executable" 13 | 14 | .PHONY: run 15 | run: hello_ncs_cpp 16 | @echo "\nmaking run" 17 | cd cpp; ./hello_ncs_cpp; cd .. 18 | 19 | .PHONY: help 20 | help: 21 | @echo "possible make targets: "; 22 | @echo " make help - shows this message"; 23 | @echo " make all - makes the following: cpp, run_cpp"; 24 | @echo " make hello_ncs_cpp - builds the hello_ncs_cpp executable example"; 25 | @echo " make run - runs the hello_ncs_cpp executable example program"; 26 | @echo " make clean - removes all created content and temporary files"; 27 | 28 | clean: clean 29 | @echo "\nmaking clean"; 30 | rm -f cpp/hello_ncs_cpp; 31 | -------------------------------------------------------------------------------- /examples/apps/hello_ncs_cpp/cpp/hello_ncs.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Intel Corporation. 2 | // The source code, information and material ("Material") contained herein is 3 | // owned by Intel Corporation or its suppliers or licensors, and title to such 4 | // Material remains with Intel Corporation or its suppliers or licensors. 5 | // The Material contains proprietary information of Intel or its suppliers and 6 | // licensors. The Material is protected by worldwide copyright laws and treaty 7 | // provisions. 8 | // No part of the Material may be used, copied, reproduced, modified, published, 9 | // uploaded, posted, transmitted, distributed or disclosed in any way without 10 | // Intel's prior express written permission. No license under any patent, 11 | // copyright or other intellectual property rights in the Material is granted to 12 | // or conferred upon you, either expressly, by implication, inducement, estoppel 13 | // or otherwise. 14 | // Any license under such intellectual property rights must be express and 15 | // approved by Intel in writing. 16 | 17 | 18 | 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | // somewhat arbitrary buffer size for the device name 25 | #define NAME_SIZE 100 26 | 27 | 28 | int main(int argc, char** argv) 29 | { 30 | mvncStatus retCode; 31 | void *deviceHandle; 32 | char devName[NAME_SIZE]; 33 | retCode = mvncGetDeviceName(0, devName, NAME_SIZE); 34 | if (retCode != MVNC_OK) 35 | { // failed to get device name, maybe none plugged in. 36 | printf("Error - No NCS devices found.\n"); 37 | printf(" mvncStatus value: %d\n", retCode); 38 | exit(-1); 39 | } 40 | 41 | // Try to open the NCS device via the device name 42 | retCode = mvncOpenDevice(devName, &deviceHandle); 43 | if (retCode != MVNC_OK) 44 | { // failed to open the device. 45 | printf("Error - Could not open NCS device.\n"); 46 | printf(" mvncStatus value: %d\n", retCode); 47 | exit(-1); 48 | } 49 | 50 | // deviceHandle is ready to use now. 51 | // Pass it to other NC API calls as needed and close it when finished. 52 | printf("Hello NCS! Device opened normally.\n"); 53 | 54 | retCode = mvncCloseDevice(deviceHandle); 55 | deviceHandle = NULL; 56 | if (retCode != MVNC_OK) 57 | { 58 | printf("Error - Could not close NCS device.\n"); 59 | printf(" mvncStatus value: %d\n", retCode); 60 | exit(-1); 61 | } 62 | 63 | printf("Goodbye NCS! Device Closed normally.\n"); 64 | printf("NCS device working.\n"); 65 | } 66 | -------------------------------------------------------------------------------- /examples/apps/hello_ncs_cpp/readme.md: -------------------------------------------------------------------------------- 1 | # hello_ncs_cpp: A Movidius Neural Compute Stick Hello World example for C++ 2 | 3 | This directory contains a C++ example that shows the Movidius NC SDK software is installed and is correctly configured on your system such that an application can access the stick via the NC SDK's API. 4 | 5 | ## Prerequisites 6 | 7 | This code example requires that the following components are available: 8 | 1. Movidius Neural Compute Stick 9 | 2. Movidius Neural Compute SDK 10 | 11 | 12 | ## Building the example 13 | To run the example code do the following : 14 | 1. Open a terminal and change directory to the hello_ncs_cpp base directory 15 | 2. Type the following command in the terminal: make hello_ncs_cpp 16 | 17 | 18 | ## Running the Example 19 | To run the example code do the following : 20 | 1. Open a terminal and change directory to the hello_ncs_cpp base directory 21 | 2. Type the following command in the terminal: make run 22 | 23 | When the application runs normally and is able to connect to the NCS device the output will be similar to this: 24 | 25 | ~~~ 26 | Hello NCS! Device opened normally. 27 | Goodbye NCS! Device closed normally. 28 | NCS device working. 29 | ~~~ 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /examples/apps/hello_ncs_py/Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | .PHONY: all 5 | all: 6 | @echo "nothing to make, use 'make run' to run." 7 | 8 | .PHONY: run 9 | run: 10 | @echo "\nmaking run"; 11 | python3 hello_ncs.py; 12 | 13 | .PHONY: help 14 | help: 15 | @echo "possible make targets: "; 16 | @echo " make help - shows this message"; 17 | @echo " make all - makes the following: run"; 18 | @echo " make run - runs the hello_ncs_cpp executable example program"; 19 | @echo " make clean - removes all created content and temporary files"; 20 | 21 | .PHONY: clean 22 | clean: 23 | @echo "clean done."; 24 | -------------------------------------------------------------------------------- /examples/apps/hello_ncs_py/hello_ncs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # 3 | # Copyright 2017 Intel Corporation. 4 | # The source code, information and material ("Material") contained herein is 5 | # owned by Intel Corporation or its suppliers or licensors, and title to such 6 | # Material remains with Intel Corporation or its suppliers or licensors. 7 | # The Material contains proprietary information of Intel or its suppliers and 8 | # licensors. The Material is protected by worldwide copyright laws and treaty 9 | # provisions. 10 | # No part of the Material may be used, copied, reproduced, modified, published, 11 | # uploaded, posted, transmitted, distributed or disclosed in any way without 12 | # Intel's prior express written permission. No license under any patent, 13 | # copyright or other intellectual property rights in the Material is granted to 14 | # or conferred upon you, either expressly, by implication, inducement, estoppel 15 | # or otherwise. 16 | # Any license under such intellectual property rights must be express and 17 | # approved by Intel in writing. 18 | 19 | # Python script to open and close a single NCS device 20 | 21 | import mvnc.mvncapi as fx 22 | 23 | # main entry point for the program 24 | if __name__=="__main__": 25 | 26 | # set the logging level for the NC API 27 | fx.SetGlobalOption(fx.GlobalOption.LOG_LEVEL, 0) 28 | 29 | # get a list of names for all the devices plugged into the system 30 | ncs_names = fx.EnumerateDevices() 31 | if (len(ncs_names) < 1): 32 | print("Error - no NCS devices detected, verify an NCS device is connected.") 33 | quit() 34 | 35 | 36 | # get the first NCS device by its name. For this program we will always open the first NCS device. 37 | dev = fx.Device(ncs_names[0]) 38 | 39 | 40 | # try to open the device. this will throw an exception if someone else has it open already 41 | try: 42 | dev.OpenDevice() 43 | except: 44 | print("Error - Could not open NCS device.") 45 | quit() 46 | 47 | 48 | print("Hello NCS! Device opened normally.") 49 | 50 | 51 | try: 52 | dev.CloseDevice() 53 | except: 54 | print("Error - could not close NCS device.") 55 | quit() 56 | 57 | print("Goodbye NCS! Device closed normally.") 58 | print("NCS device working.") 59 | 60 | -------------------------------------------------------------------------------- /examples/apps/hello_ncs_py/readme.md: -------------------------------------------------------------------------------- 1 | # hello_ncs_cpp: A Movidius Neural Compute Stick Hello World example for Python 2 | 3 | This directory contains a python3 example that shows the Movidius NC SDK software is installed and is correctly configured on your system such that an application can access the stick via the NC SDK's API. 4 | 5 | ## Prerequisites 6 | 7 | This code example requires that the following components are available: 8 | 1. Movidius Neural Compute Stick 9 | 2. Movidius Neural Compute SDK 10 | 3. Python3 11 | 12 | 13 | ## Running the Example 14 | To run the example code do the following : 15 | 1. Open a terminal and change directory to the hello_ncs_cpp base directory 16 | 2. Type the following command in the terminal: make run 17 | 18 | When the application runs normally and is able to connect to the NCS device the output will be similar to this: 19 | 20 | ~~~ 21 | Hello NCS! Device opened normally. 22 | Goodbye NCS! Device closed normally. 23 | NCS device working. 24 | ~~~ 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /examples/apps/multistick_cpp/Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | .PHONY: all 5 | all: multistick_cpp 6 | 7 | .PHONY: googlenet 8 | googlenet: 9 | @echo "\nmaking googlenet" 10 | (cd ../../caffe/GoogLeNet; make compile; cd ../../apps/multistick_cpp; cp ../../caffe/GoogLeNet/graph ./googlenet.graph;) 11 | 12 | .PHONY: squeezenet 13 | squeezenet: 14 | @echo "\nmaking squeezenet" 15 | (cd ../../caffe/SqueezeNet; make compile; cd ../../apps/multistick_cpp; cp ../../caffe/SqueezeNet/graph ./squeezenet.graph;) 16 | 17 | .PHONY: multistick_cpp 18 | multistick_cpp: googlenet squeezenet 19 | @echo "\nmaking multistick_cpp" 20 | cp googlenet.graph cpp/googlenet.graph; 21 | cp squeezenet.graph cpp/squeezenet.graph; 22 | g++ cpp/multistick.cpp cpp/fp16.c -o cpp/multistick_cpp -lmvnc 23 | @echo "Created cpp/multistick_cpp executable" 24 | 25 | .PHONY: run 26 | run: multistick_cpp 27 | @echo "\nmaking run"; 28 | cd cpp; ./multistick_cpp; cd ..; 29 | 30 | .PHONY: help 31 | help: 32 | @echo "possible make targets: "; 33 | @echo " make help - shows this message"; 34 | @echo " make all - makes the following: multistick_cpp, run"; 35 | @echo " make multistick_cpp - builds the multistick_cpp executable example"; 36 | @echo " make run - runs the multistick_cpp executable example program"; 37 | @echo " make clean - removes all created content and temporary files"; 38 | 39 | clean: clean 40 | @echo "\nmaking clean"; 41 | rm -f cpp/multistick_cpp; 42 | rm -f cpp/googlenet.graph; 43 | rm -f cpp/squeezenet.graph; 44 | rm -f squeezenet.graph; 45 | rm -f googlenet.graph; 46 | 47 | -------------------------------------------------------------------------------- /examples/apps/multistick_cpp/cpp/fp16.h: -------------------------------------------------------------------------------- 1 | // Copied from Numpy 2 | 3 | 4 | static unsigned half2float(unsigned short h); 5 | unsigned short float2half(unsigned f); 6 | void floattofp16(unsigned char *dst, float *src, unsigned nelem); 7 | void fp16tofloat(float *dst, unsigned char *src, unsigned nelem); 8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/apps/multistick_cpp/readme.md: -------------------------------------------------------------------------------- 1 | # multistick_cpp: A Movidius Neural Compute Stick example for multiple devices in C++ 2 | 3 | This directory contains a C++ example that shows how to program for mulitiple NCS devices. The program opens two NCS devices and uses one device to run GoogLeNet inferences and the other device to run SqueezeNet inferences. 4 | 5 | ## Prerequisites 6 | 7 | This code example requires that the following components are available: 8 | 1. Movidius Neural Compute Stick 9 | 2. Movidius Neural Compute SDK 10 | 11 | 12 | ## Building the example 13 | To run the example code do the following : 14 | 1. Open a terminal and change directory to the multistick_cpp example base directory 15 | 2. Type the following command in the terminal: make 16 | 17 | 18 | ## Running the Example 19 | After building the example you can run the example code by doing the following : 20 | 1. Open a terminal and change directory to the multistick_cpp base directory 21 | 2. Type the following command in the terminal: make run 22 | 23 | When the application runs normally and is able to connect to the NCS device the output will be similar to this: 24 | 25 | ~~~ 26 | TBD 27 | ~~~ 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /examples/caffe/AlexNet/Makefile: -------------------------------------------------------------------------------- 1 | 2 | ifneq ($(findstring movidius, $(PYTHONPATH)), movidius) 3 | export PYTHONPATH:=/opt/movidius/caffe/python:$(PYTHONPATH) 4 | endif 5 | 6 | NCCOMPILE = mvNCCompile 7 | NCPROFILE = mvNCProfile 8 | NCCHECK = mvNCCheck 9 | 10 | PROTOTXT_FILENAME= deploy.prototxt 11 | GET_PROTOTXT = wget -P . https://raw.githubusercontent.com/BVLC/caffe/master/models/bvlc_alexnet/${PROTOTXT_FILENAME} 12 | 13 | CAFFEMODEL_FILENAME = bvlc_alexnet.caffemodel 14 | GET_CAFFEMODEL = wget -P . -N http://dl.caffe.berkeleyvision.org/${CAFFEMODEL_FILENAME} 15 | 16 | 17 | .PHONY: all 18 | all: profile check compile cpp 19 | 20 | .PHONY: prereqs 21 | prereqs: 22 | @echo "\nmaking prereqs" 23 | (cd ../../data/ilsvrc12; make) 24 | @sed -i 's/\r//' run.py 25 | chmod +x run.py 26 | 27 | .PHONY: prototxt 28 | prototxt: prereqs 29 | @echo "\nmaking prototxt" 30 | @if [ -e ${PROTOTXT_FILENAME} ] ; \ 31 | then \ 32 | echo "Prototxt file already exists"; \ 33 | else \ 34 | echo "Downloading Prototxt file"; \ 35 | ${GET_PROTOTXT}; \ 36 | if [ -e ${PROTOTXT_FILENAME} ] ; \ 37 | then \ 38 | echo "Adding input shape to prototxt file."; \ 39 | awk 'NR <2 {print}' < ${PROTOTXT_FILENAME} > temp; cat input_shape.prototxt >> temp; awk 'NR > 7 {print}' < ${PROTOTXT_FILENAME} >> temp; mv temp ${PROTOTXT_FILENAME}; \ 40 | else \ 41 | echo "***\nError - Could not download prototxt file. Check network and proxy settings \n***\n"; \ 42 | exit 1; \ 43 | fi ; \ 44 | fi 45 | 46 | .PHONY: caffemodel 47 | caffemodel: 48 | @echo "\nmaking caffemodel" 49 | @if [ -e ${CAFFEMODEL_FILENAME} ] ; \ 50 | then \ 51 | echo "caffemodel file already exists"; \ 52 | else \ 53 | echo "Downloading caffemodel file"; \ 54 | ${GET_CAFFEMODEL}; \ 55 | if ! [ -e ${CAFFEMODEL_FILENAME} ] ; \ 56 | then \ 57 | echo "***\nError - Could not download caffemodel file. Check network and proxy settings \n***\n"; \ 58 | exit 1; \ 59 | fi ; \ 60 | fi 61 | 62 | .PHONY: profile 63 | profile: prototxt 64 | @echo "\nmaking profile" 65 | ${NCPROFILE} ${PROTOTXT_FILENAME} -s 12 66 | 67 | .PHONY: browse_profile 68 | browse_profile: profile 69 | @echo "\nmaking browse_profile" 70 | @if [ -e output_report.html ] ; \ 71 | then \ 72 | firefox output_report.html & \ 73 | else \ 74 | @echo "***\nError - output_report.html not found" ; \ 75 | fi ; 76 | 77 | .PHONY: compile 78 | compile: prototxt caffemodel 79 | @echo "\nmaking compile" 80 | ${NCCOMPILE} -w ${CAFFEMODEL_FILENAME} -s 12 ${PROTOTXT_FILENAME} 81 | 82 | .PHONY: check 83 | check: prototxt caffemodel 84 | @echo "\nmaking check" 85 | #-${NCCHECK} -w ${CAFFEMODEL_FILENAME} -i ../../data/images/cat.jpg -s 12 -id 281 ${PROTOTXT_FILENAME} -S 255 -M ../../data/ilsvrc12/ilsvrc_2012_mean.npy 86 | -${NCCHECK} -w ${CAFFEMODEL_FILENAME} -i ../../data/images/cat.jpg -s 12 -id 281 ${PROTOTXT_FILENAME} -M 110 -S 255 -metric top1 87 | 88 | .PHONY: run 89 | run: compile 90 | @echo "\nmaking run" 91 | ./run.py 92 | 93 | .PHONY: run_py 94 | run_py: compile 95 | @echo "\nmaking run_py" 96 | ./run.py 97 | 98 | .PHONY: cpp 99 | cpp: cpp/run.cpp cpp/fp16.c 100 | @echo "\nmaking cpp" 101 | g++ cpp/run.cpp cpp/fp16.c -o cpp/run_cpp -lmvnc 102 | 103 | .PHONY: run_cpp 104 | run_cpp: compile cpp 105 | @echo "\nmaking run_cpp" 106 | cd cpp; ./run_cpp; cd .. 107 | 108 | .PHONY: help 109 | help: 110 | @echo "possible make targets: "; 111 | @echo " make help - shows this message"; 112 | @echo " make all - makes the following: prototxt, profile, compile, check, cpp, run_py, run_cpp"; 113 | @echo " make prototxt - downloads and adds input shape to Caffe prototxt file"; 114 | @echo " make caffemodel - downloads the caffemodel for the network" 115 | @echo " make compile - runs SDK compiler tool to compile the NCS graph file for the network"; 116 | @echo " make check - runs SDK checker tool to verify an NCS graph file"; 117 | @echo " make profile - runs the SDK profiler tool to profile the network creating output_report.html"; 118 | @echo " make browse_profile - runs the SDK profiler tool and brings up report in browser."; 119 | @echo " make cpp - builds the run_cpp executable example"; 120 | @echo " make run_cpp - runs the run_cpp executable example program"; 121 | @echo " make run_py - runs the run.py python example program:"; 122 | @echo " make clean - removes all created content" 123 | 124 | clean_caffe_model: 125 | @echo "\nmaking clean_caffe_model" 126 | rm -f ${PROTOTXT_FILENAME} 127 | rm -f ${CAFFEMODEL_FILENAME} 128 | 129 | clean: clean_caffe_model 130 | @echo "\nmaking clean" 131 | rm -f graph 132 | rm -f output.gv 133 | rm -f output.gv.svg 134 | rm -f output_report.html 135 | rm -f output_expected.npy 136 | rm -f zero_weights.caffemodel 137 | rm -f output_result.npy 138 | rm -f output_val.csv 139 | rm -f cpp/run_cpp 140 | -------------------------------------------------------------------------------- /examples/caffe/AlexNet/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | The [AlexNet](https://github.com/BVLC/caffe/tree/master/models/bvlc_alexnet) network can be used for image classification. The provided Makefile does the following 3 | 1. Downloads the Caffe prototxt file and makes any changes necessary to work with the Movidius Neural Compute SDK 4 | 2. Downloads and generates the required ilsvrc12 data 5 | 3. Downloads the .caffemodel file which was trained and provided by BVLC. 6 | 3. Profiles, Compiles and Checks the network using the Neural Compute SDK. 7 | 4. There is a python example (run.py) and a C++ example (cpp/run.cpp) which both do a single inference on an image as an example of how to use this network with the Neural Compute API thats provided in the Neural Compute SDK. 8 | 9 | # Makefile 10 | Provided Makefile describes various targets that help with the above mentioned tasks. 11 | 12 | ## make help 13 | Shows makefile possible targets and brief descriptions. 14 | 15 | ## make all 16 | Makes the following: prototxt, caffemodel, profile, compile, check, cpp, run, run_cpp. 17 | 18 | ## make prototxt 19 | Downloads the Caffe prototxt file and makes a few changes necessary to work with the Movidius Neural Compute SDK. 20 | 21 | ## make caffemodel 22 | Downloads the Caffe model file 23 | 24 | ## make profile 25 | Runs the provided network on the NCS and generates per layer statistics that are helpful for understanding the performance of the network on the Neural Compute Stick. Output diplayed on terminal and the output_report.html file is also created. Demonstrates NCSDK tool: cnprofile 26 | 27 | ## make browse_profile 28 | profiles the network similar to make profile and then brings up output_report.html in a browser. Demonstrates NCSDK tool: mvNCProfile 29 | 30 | ## make compile 31 | Uses the network description and the trained weights files to generate a Movidius internal 'graph' format file. This file is later loaded on the Neural Compute Stick where the inferences on the network can be executed. Demonstrates NCSDK tool: mvNCCompile 32 | 33 | ## make check 34 | Runs the network on Caffe on the CPU and compares results when run on the Neural Compute Stick. Consistency results are output to the terminal. Demonstrates the NCSDK tool: mvNCCheck. 35 | 36 | ## make run_py 37 | Runs the provided run.py python script which sends a single image to the Neural Compute Stick and receives and displays the inference results. 38 | 39 | ## make cpp 40 | Builds the C++ example program run_cpp which can be executed with make run_cpp. 41 | 42 | ## make run_cpp 43 | Runs the provided run_cpp executable program that is built via make cpp. This program sends a single image to the Neural Compute Stick and receives and displays the inference results. 44 | 45 | ## make clean 46 | Removes all the temporary and target files that are created by the Makefile. 47 | -------------------------------------------------------------------------------- /examples/caffe/AlexNet/cpp/build.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | g++ run.cpp fp16.c -o run_cpp -lmvnc 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /examples/caffe/AlexNet/cpp/fp16.h: -------------------------------------------------------------------------------- 1 | // Copied from Numpy 2 | 3 | 4 | static unsigned half2float(unsigned short h); 5 | unsigned short float2half(unsigned f); 6 | void floattofp16(unsigned char *dst, float *src, unsigned nelem); 7 | void fp16tofloat(float *dst, unsigned char *src, unsigned nelem); 8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/caffe/AlexNet/input_shape.prototxt: -------------------------------------------------------------------------------- 1 | input: "data" 2 | input_shape { 3 | dim: 1 4 | dim: 3 5 | dim: 227 6 | dim: 227 7 | } 8 | -------------------------------------------------------------------------------- /examples/caffe/AlexNet/run.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python3 2 | 3 | # Copyright 2017 Intel Corporation. 4 | # The source code, information and material ("Material") contained herein is 5 | # owned by Intel Corporation or its suppliers or licensors, and title to such 6 | # Material remains with Intel Corporation or its suppliers or licensors. 7 | # The Material contains proprietary information of Intel or its suppliers and 8 | # licensors. The Material is protected by worldwide copyright laws and treaty 9 | # provisions. 10 | # No part of the Material may be used, copied, reproduced, modified, published, 11 | # uploaded, posted, transmitted, distributed or disclosed in any way without 12 | # Intel's prior express written permission. No license under any patent, 13 | # copyright or other intellectual property rights in the Material is granted to 14 | # or conferred upon you, either expressly, by implication, inducement, estoppel 15 | # or otherwise. 16 | # Any license under such intellectual property rights must be express and 17 | # approved by Intel in writing. 18 | 19 | from mvnc import mvncapi as mvnc 20 | import sys 21 | import numpy 22 | import cv2 23 | import time 24 | import csv 25 | import os 26 | import sys 27 | 28 | dim=(227,227) 29 | EXAMPLES_BASE_DIR='../../' 30 | 31 | # *************************************************************** 32 | # get labels 33 | # *************************************************************** 34 | labels_file=EXAMPLES_BASE_DIR+'data/ilsvrc12/synset_words.txt' 35 | labels=numpy.loadtxt(labels_file,str,delimiter='\t') 36 | 37 | # *************************************************************** 38 | # configure the NCS 39 | # *************************************************************** 40 | mvnc.SetGlobalOption(mvnc.GlobalOption.LOG_LEVEL, 2) 41 | 42 | # *************************************************************** 43 | # Get a list of ALL the sticks that are plugged in 44 | # *************************************************************** 45 | devices = mvnc.EnumerateDevices() 46 | if len(devices) == 0: 47 | print('No devices found') 48 | quit() 49 | 50 | # *************************************************************** 51 | # Pick the first stick to run the network 52 | # *************************************************************** 53 | device = mvnc.Device(devices[0]) 54 | 55 | # *************************************************************** 56 | # Open the NCS 57 | # *************************************************************** 58 | device.OpenDevice() 59 | 60 | network_blob='graph' 61 | 62 | #Load blob 63 | with open(network_blob, mode='rb') as f: 64 | blob = f.read() 65 | 66 | graph = device.AllocateGraph(blob) 67 | 68 | # *************************************************************** 69 | # Load the image 70 | # *************************************************************** 71 | ilsvrc_mean = numpy.load(EXAMPLES_BASE_DIR+'data/ilsvrc12/ilsvrc_2012_mean.npy').mean(1).mean(1) #loading the mean file 72 | img = cv2.imread(EXAMPLES_BASE_DIR+'data/images/nps_electric_guitar.png') 73 | img=cv2.resize(img,dim) 74 | img = img.astype(numpy.float32) 75 | img[:,:,0] = (img[:,:,0] - ilsvrc_mean[0]) 76 | img[:,:,1] = (img[:,:,1] - ilsvrc_mean[1]) 77 | img[:,:,2] = (img[:,:,2] - ilsvrc_mean[2]) 78 | 79 | # *************************************************************** 80 | # Send the image to the NCS 81 | # *************************************************************** 82 | graph.LoadTensor(img.astype(numpy.float16), 'user object') 83 | 84 | # *************************************************************** 85 | # Get the result from the NCS 86 | # *************************************************************** 87 | output, userobj = graph.GetResult() 88 | 89 | # *************************************************************** 90 | # Print the results of the inference form the NCS 91 | # *************************************************************** 92 | order = output.argsort()[::-1][:6] 93 | print('\n------- predictions --------') 94 | for i in range(0,5): 95 | print ('prediction ' + str(i) + ' (probability ' + str(output[order[i]]*100) + '%) is ' + labels[order[i]] + ' label index is: ' + str(order[i]) ) 96 | 97 | 98 | # *************************************************************** 99 | # Clean up the graph and the device 100 | # *************************************************************** 101 | graph.DeallocateGraph() 102 | device.CloseDevice() 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /examples/caffe/GoogLeNet/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | The [GoogLeNet](https://github.com/BVLC/caffe/tree/master/models/bvlc_googlenet) network can be used for image classification. The provided Makefile does the following 3 | 1. Downloads the Caffe prototxt file and makes any changes necessary to work with the Movidius Neural Compute SDK 4 | 2. Downloads and generates the required ilsvrc12 data 5 | 3. Downloads the .caffemodel file which was trained and provided by BVLC. 6 | 3. Profiles, Compiles and Checks the network using the Neural Compute SDK. 7 | 4. There is a python example (run.py) and a C++ example (cpp/run.cpp) which both do a single inference on an image as an example of how to use the network with the Neural Compute API thats provided in the Neural Compute SDK. 8 | 9 | # Makefile 10 | Provided Makefile describes various targets that help with the above mentioned tasks. 11 | 12 | ## make help 13 | Shows makefile possible targets and brief descriptions. 14 | 15 | ## make all 16 | Makes the following: prototxt, caffemodel, profile, compile, check, cpp, run, run_cpp. 17 | 18 | ## make prototxt 19 | Downloads the Caffe prototxt file and makes a few changes necessary to work with the Movidius Neural Compute SDK. 20 | 21 | ## make caffemodel 22 | Downloads the Caffe model file 23 | 24 | ## make profile 25 | Runs the provided network on the NCS and generates per layer statistics that are helpful for understanding the performance of the network on the Neural Compute Stick. Output diplayed on terminal and the output_report.html file is also created. Demonstrates NCSDK tool: mvNCProfile 26 | 27 | ## make browse_profile 28 | profiles the network similar to make profile and then brings up output_report.html in a browser. Demonstrates NCSDK tool: mvNCProfile 29 | 30 | ## make compile 31 | Uses the network description and the trained weights files to generate a Movidius internal 'graph' format file. This file is later loaded on the Neural Compute Stick where the inferences on the network can be executed. Demonstrates NCSDK tool: mvNCCompile 32 | 33 | ## make check 34 | Runs the network on Caffe on the CPU and compares results when run on the Neural Compute Stick. Consistency results are output to the terminal. Demonstrates the NCSDK tool: mvNCCheck. 35 | 36 | ## make run_py 37 | Runs the provided run.py python script which sends a single image to the Neural Compute Stick and receives and displays the inference results. 38 | 39 | ## make cpp 40 | Builds the C++ example program run_cpp which can be executed with make run_cpp. 41 | 42 | ## make run_cpp 43 | Runs the provided run_cpp executable program that is built via make cpp. This program sends a single image to the Neural Compute Stick and receives and displays the inference results. 44 | 45 | ## make clean 46 | Removes all the temporary and target files that are created by the Makefile. 47 | -------------------------------------------------------------------------------- /examples/caffe/GoogLeNet/cpp/build.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | g++ run.cpp fp16.c -o run_cpp -lmvnc 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /examples/caffe/GoogLeNet/cpp/fp16.h: -------------------------------------------------------------------------------- 1 | // Copied from Numpy 2 | 3 | 4 | static unsigned half2float(unsigned short h); 5 | unsigned short float2half(unsigned f); 6 | void floattofp16(unsigned char *dst, float *src, unsigned nelem); 7 | void fp16tofloat(float *dst, unsigned char *src, unsigned nelem); 8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/caffe/GoogLeNet/input_shape.prototxt: -------------------------------------------------------------------------------- 1 | input: "data" 2 | input_shape { 3 | dim: 1 4 | dim: 3 5 | dim: 224 6 | dim: 224 7 | } 8 | -------------------------------------------------------------------------------- /examples/caffe/GoogLeNet/run.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python3 2 | 3 | # Copyright 2017 Intel Corporation. 4 | # The source code, information and material ("Material") contained herein is 5 | # owned by Intel Corporation or its suppliers or licensors, and title to such 6 | # Material remains with Intel Corporation or its suppliers or licensors. 7 | # The Material contains proprietary information of Intel or its suppliers and 8 | # licensors. The Material is protected by worldwide copyright laws and treaty 9 | # provisions. 10 | # No part of the Material may be used, copied, reproduced, modified, published, 11 | # uploaded, posted, transmitted, distributed or disclosed in any way without 12 | # Intel's prior express written permission. No license under any patent, 13 | # copyright or other intellectual property rights in the Material is granted to 14 | # or conferred upon you, either expressly, by implication, inducement, estoppel 15 | # or otherwise. 16 | # Any license under such intellectual property rights must be express and 17 | # approved by Intel in writing. 18 | 19 | from mvnc import mvncapi as mvnc 20 | import sys 21 | import numpy 22 | import cv2 23 | import time 24 | import csv 25 | import os 26 | import sys 27 | 28 | dim=(224,224) 29 | EXAMPLES_BASE_DIR='../../' 30 | 31 | # *************************************************************** 32 | # get labels 33 | # *************************************************************** 34 | labels_file=EXAMPLES_BASE_DIR+'data/ilsvrc12/synset_words.txt' 35 | labels=numpy.loadtxt(labels_file,str,delimiter='\t') 36 | 37 | # *************************************************************** 38 | # configure the NCS 39 | # *************************************************************** 40 | mvnc.SetGlobalOption(mvnc.GlobalOption.LOG_LEVEL, 2) 41 | 42 | # *************************************************************** 43 | # Get a list of ALL the sticks that are plugged in 44 | # *************************************************************** 45 | devices = mvnc.EnumerateDevices() 46 | if len(devices) == 0: 47 | print('No devices found') 48 | quit() 49 | 50 | # *************************************************************** 51 | # Pick the first stick to run the network 52 | # *************************************************************** 53 | device = mvnc.Device(devices[0]) 54 | 55 | # *************************************************************** 56 | # Open the NCS 57 | # *************************************************************** 58 | device.OpenDevice() 59 | 60 | network_blob='graph' 61 | 62 | #Load blob 63 | with open(network_blob, mode='rb') as f: 64 | blob = f.read() 65 | 66 | graph = device.AllocateGraph(blob) 67 | 68 | # *************************************************************** 69 | # Load the image 70 | # *************************************************************** 71 | ilsvrc_mean = numpy.load(EXAMPLES_BASE_DIR+'data/ilsvrc12/ilsvrc_2012_mean.npy').mean(1).mean(1) #loading the mean file 72 | img = cv2.imread(EXAMPLES_BASE_DIR+'data/images/nps_electric_guitar.png') 73 | img=cv2.resize(img,dim) 74 | img = img.astype(numpy.float32) 75 | img[:,:,0] = (img[:,:,0] - ilsvrc_mean[0]) 76 | img[:,:,1] = (img[:,:,1] - ilsvrc_mean[1]) 77 | img[:,:,2] = (img[:,:,2] - ilsvrc_mean[2]) 78 | 79 | # *************************************************************** 80 | # Send the image to the NCS 81 | # *************************************************************** 82 | graph.LoadTensor(img.astype(numpy.float16), 'user object') 83 | 84 | # *************************************************************** 85 | # Get the result from the NCS 86 | # *************************************************************** 87 | output, userobj = graph.GetResult() 88 | 89 | # *************************************************************** 90 | # Print the results of the inference form the NCS 91 | # *************************************************************** 92 | order = output.argsort()[::-1][:6] 93 | print('\n------- predictions --------') 94 | for i in range(0,5): 95 | print ('prediction ' + str(i) + ' (probability ' + str(output[order[i]]) + ') is ' + labels[order[i]] + ' label index is: ' + str(order[i]) ) 96 | 97 | 98 | # *************************************************************** 99 | # Clean up the graph and the device 100 | # *************************************************************** 101 | graph.DeallocateGraph() 102 | device.CloseDevice() 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /examples/caffe/Makefile: -------------------------------------------------------------------------------- 1 | 2 | ifneq ($(findstring movidius, $(PYTHONPATH)), movidius) 3 | export PYTHONPATH:=/opt/movidius/caffe/python:$(PYTHONPATH) 4 | endif 5 | 6 | TOPTARGETS := all clean check compile profile run 7 | 8 | SUBDIRS := $(wildcard */.) 9 | 10 | $(TOPTARGETS): $(SUBDIRS) 11 | $(SUBDIRS): 12 | $(MAKE) -C $@ $(MAKECMDGOALS) 13 | 14 | .PHONY: $(TOPTARGETS) $(SUBDIRS) 15 | 16 | .PHONY: help 17 | help: 18 | @echo "Possible Make targets" 19 | @echo " make help - shows this message" 20 | @echo " make all - Makes all targets" 21 | @echo " make clean - Removes all temp files from all directories" 22 | @echo " make check - Runs check on all caffe/tensorflow models" 23 | @echo " make profile - Runs profile on all caffe/tensorflow models" 24 | @echo " make compile - Runs compile on all caffe/tensorflow models" 25 | @echo " make run - Runs all caffe/tensorflow/apps" 26 | -------------------------------------------------------------------------------- /examples/caffe/SqueezeNet/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | The [SqueezeNet V1.0](https://github.com/DeepScale/SqueezeNet) network can be used for image classification. The provided Makefile does the following 3 | 1. Downloads the Caffe prototxt file and makes any changes necessary to work with the Movidius Neural Compute SDK 4 | 2. Downloads and generates the required ilsvrc12 data 5 | 3. Downloads the .caffemodel file which was trained and provided by BVLC. 6 | 3. Profiles, Compiles and Checks the network using the Neural Compute SDK. 7 | 4. There is a python example (run.py) and a C++ example (cpp/run.cpp) which both do a single inference on an image as an example of how to use this network with the Neural Compute API thats provided in the Neural Compute SDK. 8 | 9 | # Makefile 10 | Provided Makefile describes various targets that help with the above mentioned tasks. 11 | 12 | ## make help 13 | Shows makefile possible targets and brief descriptions. 14 | 15 | ## make all 16 | Makes the following: prototxt, caffemodel, profile, compile, check, cpp, run, run_cpp. 17 | 18 | ## make prototxt 19 | Downloads the Caffe prototxt file and makes a few changes necessary to work with the Movidius Neural Compute SDK. 20 | 21 | ## make caffemodel 22 | Downloads the Caffe model file 23 | 24 | ## make profile 25 | Runs the provided network on the NCS and generates per layer statistics that are helpful for understanding the performance of the network on the Neural Compute Stick. Output diplayed on terminal and the output_report.html file is also created. Demonstrates NCSDK tool: mvNCProfile 26 | 27 | ## make browse_profile 28 | profiles the network similar to make profile and then brings up output_report.html in a browser. Demonstrates NCSDK tool: mvNCProfile 29 | 30 | ## make compile 31 | Uses the network description and the trained weights files to generate a Movidius internal 'graph' format file. This file is later loaded on the Neural Compute Stick where the inferences on the network can be executed. Demonstrates NCSDK tool: mvNCCompile 32 | 33 | ## make check 34 | Runs the network on Caffe on the CPU and compares results when run on the Neural Compute Stick. Consistency results are output to the terminal. Demonstrates the NCSDK tool: mvNCCheck. 35 | 36 | ## make run_py 37 | Runs the provided run.py python script which sends a single image to the Neural Compute Stick and receives and displays the inference results. 38 | 39 | ## make cpp 40 | Builds the C++ example program run_cpp which can be executed with make run_cpp. 41 | 42 | ## make run_cpp 43 | Runs the provided run_cpp executable program that is built via make cpp. This program sends a single image to the Neural Compute Stick and receives and displays the inference results. 44 | 45 | ## make clean 46 | Removes all the temporary and target files that are created by the Makefile. 47 | -------------------------------------------------------------------------------- /examples/caffe/SqueezeNet/cpp/build.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | g++ run.cpp fp16.c -o run_cpp -lmvnc 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /examples/caffe/SqueezeNet/cpp/fp16.h: -------------------------------------------------------------------------------- 1 | // Copied from Numpy 2 | 3 | 4 | static unsigned half2float(unsigned short h); 5 | unsigned short float2half(unsigned f); 6 | void floattofp16(unsigned char *dst, float *src, unsigned nelem); 7 | void fp16tofloat(float *dst, unsigned char *src, unsigned nelem); 8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/caffe/SqueezeNet/run.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python3 2 | 3 | # Copyright 2017 Intel Corporation. 4 | # The source code, information and material ("Material") contained herein is 5 | # owned by Intel Corporation or its suppliers or licensors, and title to such 6 | # Material remains with Intel Corporation or its suppliers or licensors. 7 | # The Material contains proprietary information of Intel or its suppliers and 8 | # licensors. The Material is protected by worldwide copyright laws and treaty 9 | # provisions. 10 | # No part of the Material may be used, copied, reproduced, modified, published, 11 | # uploaded, posted, transmitted, distributed or disclosed in any way without 12 | # Intel's prior express written permission. No license under any patent, 13 | # copyright or other intellectual property rights in the Material is granted to 14 | # or conferred upon you, either expressly, by implication, inducement, estoppel 15 | # or otherwise. 16 | # Any license under such intellectual property rights must be express and 17 | # approved by Intel in writing. 18 | 19 | from mvnc import mvncapi as mvnc 20 | import sys 21 | import numpy 22 | import cv2 23 | import time 24 | import csv 25 | import os 26 | import sys 27 | 28 | dim=(227,227) 29 | EXAMPLES_BASE_DIR='../../' 30 | 31 | # *************************************************************** 32 | # get labels 33 | # *************************************************************** 34 | labels_file=EXAMPLES_BASE_DIR+'data/ilsvrc12/synset_words.txt' 35 | labels=numpy.loadtxt(labels_file,str,delimiter='\t') 36 | 37 | # *************************************************************** 38 | # configure the NCS 39 | # *************************************************************** 40 | mvnc.SetGlobalOption(mvnc.GlobalOption.LOG_LEVEL, 2) 41 | 42 | # *************************************************************** 43 | # Get a list of ALL the sticks that are plugged in 44 | # *************************************************************** 45 | devices = mvnc.EnumerateDevices() 46 | if len(devices) == 0: 47 | print('No devices found') 48 | quit() 49 | 50 | # *************************************************************** 51 | # Pick the first stick to run the network 52 | # *************************************************************** 53 | device = mvnc.Device(devices[0]) 54 | 55 | # *************************************************************** 56 | # Open the NCS 57 | # *************************************************************** 58 | device.OpenDevice() 59 | 60 | network_blob='graph' 61 | 62 | #Load blob 63 | with open(network_blob, mode='rb') as f: 64 | blob = f.read() 65 | 66 | graph = device.AllocateGraph(blob) 67 | 68 | # *************************************************************** 69 | # Load the image 70 | # *************************************************************** 71 | ilsvrc_mean = numpy.load(EXAMPLES_BASE_DIR+'data/ilsvrc12/ilsvrc_2012_mean.npy').mean(1).mean(1) #loading the mean file 72 | img = cv2.imread(EXAMPLES_BASE_DIR+'data/images/nps_electric_guitar.png') 73 | img=cv2.resize(img,dim) 74 | img = img.astype(numpy.float32) 75 | img[:,:,0] = (img[:,:,0] - ilsvrc_mean[0]) 76 | img[:,:,1] = (img[:,:,1] - ilsvrc_mean[1]) 77 | img[:,:,2] = (img[:,:,2] - ilsvrc_mean[2]) 78 | 79 | # *************************************************************** 80 | # Send the image to the NCS 81 | # *************************************************************** 82 | graph.LoadTensor(img.astype(numpy.float16), 'user object') 83 | 84 | # *************************************************************** 85 | # Get the result from the NCS 86 | # *************************************************************** 87 | output, userobj = graph.GetResult() 88 | 89 | # *************************************************************** 90 | # Print the results of the inference form the NCS 91 | # *************************************************************** 92 | order = output.argsort()[::-1][:6] 93 | print('\n------- predictions --------') 94 | for i in range(0,5): 95 | print ('prediction ' + str(i) + ' (probability ' + str(output[order[i]]*100) + '%) is ' + labels[order[i]] + ' label index is: ' + str(order[i]) ) 96 | 97 | 98 | # *************************************************************** 99 | # Clean up the graph and the device 100 | # *************************************************************** 101 | graph.DeallocateGraph() 102 | device.CloseDevice() 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /examples/caffe/SqueezeNet/synset_words.txt: -------------------------------------------------------------------------------- 1 | ../../data/ilsvrc12/synset_words.txt -------------------------------------------------------------------------------- /examples/data/Makefile: -------------------------------------------------------------------------------- 1 | 2 | ifneq ($(findstring movidius, $(PYTHONPATH)), movidius) 3 | export PYTHONPATH:=/opt/movidius/caffe/python:$(PYTHONPATH) 4 | endif 5 | 6 | .PHONY: help 7 | help: 8 | @echo "Possible Make targets" 9 | @echo " make help - shows this message" 10 | @echo " make clean - Removes all temp files from all directories" 11 | 12 | TOPTARGETS := clean 13 | 14 | SUBDIRS := $(wildcard il*/.) 15 | 16 | $(TOPTARGETS): $(SUBDIRS) 17 | $(SUBDIRS): 18 | $(MAKE) -C $@ $(MAKECMDGOALS) 19 | 20 | .PHONY: $(TOPTARGETS) $(SUBDIRS) 21 | 22 | all compile profile check run: 23 | 24 | -------------------------------------------------------------------------------- /examples/data/ilsvrc12/Makefile: -------------------------------------------------------------------------------- 1 | python_version_full := $(wordlist 2,4,$(subst ., ,$(shell python3 --version 2>&1))) 2 | python_version_minor := $(word 2,${python_version_full}) 3 | 4 | ILSVRC_SH = get_ilsvrc_aux.sh 5 | GET_ILSVRC_AUX = wget https://raw.githubusercontent.com/BVLC/caffe/master/data/ilsvrc12/get_ilsvrc_aux.sh 6 | .PHONY: all 7 | 8 | all: 9 | @test -f ${ILSVRC_SH} || (${GET_ILSVRC_AUX};chmod +x ${ILSVRC_SH};./${ILSVRC_SH}); 10 | @test -f ilsvrc_2012_mean.npy || wget https://raw.githubusercontent.com/BVLC/caffe/master/python/caffe/imagenet/ilsvrc_2012_mean.npy 11 | 12 | .PHONY: clean 13 | clean: 14 | @rm -f ${ILSVRC_SH} 15 | @rm -f test.txt 16 | @rm -f synsets.txt 17 | @rm -f val.txt 18 | @rm -f train.txt 19 | @rm -f synset_words.txt 20 | @rm -f det_synset_words.txt 21 | @rm -f imagenet.bet.pickle 22 | @rm -f imagenet_mean.binaryproto 23 | @rm -f ._* 24 | @rm -f caffe_ilsvrc12.tar.gz 25 | @rm -f ilsvrc_2012_mean.npy 26 | -------------------------------------------------------------------------------- /examples/data/images/512_Amplifier.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/512_Amplifier.jpg -------------------------------------------------------------------------------- /examples/data/images/512_Ball.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/512_Ball.jpg -------------------------------------------------------------------------------- /examples/data/images/512_Cellphone.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/512_Cellphone.jpg -------------------------------------------------------------------------------- /examples/data/images/512_ElectricGuitar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/512_ElectricGuitar.jpg -------------------------------------------------------------------------------- /examples/data/images/512_InkjetPrinter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/512_InkjetPrinter.jpg -------------------------------------------------------------------------------- /examples/data/images/512_LaserPrinter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/512_LaserPrinter.jpg -------------------------------------------------------------------------------- /examples/data/images/512_Monitor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/512_Monitor.jpg -------------------------------------------------------------------------------- /examples/data/images/512_Phone.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/512_Phone.jpg -------------------------------------------------------------------------------- /examples/data/images/512_Remote.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/512_Remote.jpg -------------------------------------------------------------------------------- /examples/data/images/512_Sink.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/512_Sink.jpg -------------------------------------------------------------------------------- /examples/data/images/512_Slippers.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/512_Slippers.jpg -------------------------------------------------------------------------------- /examples/data/images/cat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/cat.jpg -------------------------------------------------------------------------------- /examples/data/images/nps_acoustic_guitar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/nps_acoustic_guitar.png -------------------------------------------------------------------------------- /examples/data/images/nps_backpack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/nps_backpack.png -------------------------------------------------------------------------------- /examples/data/images/nps_baseball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/nps_baseball.png -------------------------------------------------------------------------------- /examples/data/images/nps_chair.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/nps_chair.png -------------------------------------------------------------------------------- /examples/data/images/nps_electric_guitar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/nps_electric_guitar.png -------------------------------------------------------------------------------- /examples/data/images/nps_guac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/nps_guac.png -------------------------------------------------------------------------------- /examples/data/images/nps_keyboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/nps_keyboard.png -------------------------------------------------------------------------------- /examples/data/images/nps_mouse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/nps_mouse.png -------------------------------------------------------------------------------- /examples/data/images/nps_mug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/nps_mug.png -------------------------------------------------------------------------------- /examples/data/images/nps_screwdriver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/data/images/nps_screwdriver.png -------------------------------------------------------------------------------- /examples/tensorflow/Makefile: -------------------------------------------------------------------------------- 1 | 2 | ifneq ($(findstring movidius, $(PYTHONPATH)), movidius) 3 | export PYTHONPATH:=/opt/movidius/caffe/python:$(PYTHONPATH) 4 | endif 5 | 6 | 7 | SUBDIRS := $(wildcard */.) 8 | TOPTARGETS := all clean check compile profile run 9 | 10 | $(TOPTARGETS): $(SUBDIRS) 11 | $(SUBDIRS): 12 | $(MAKE) -C $@ $(MAKECMDGOALS) 13 | 14 | .PHONY: $(TOPTARGETS) $(SUBDIRS) 15 | 16 | .PHONY: help 17 | help: 18 | @echo "Possible Make targets" 19 | @echo " make help - shows this message" 20 | @echo " make all - Makes all targets" 21 | @echo " make clean - Removes all temp files from all directories" 22 | @echo " make check - Runs check on all caffe/tensorflow models" 23 | @echo " make profile - Runs profile on all caffe/tensorflow models" 24 | @echo " make compile - Runs compile on all caffe/tensorflow models" 25 | @echo " make run - Runs all caffe/tensorflow/apps" 26 | -------------------------------------------------------------------------------- /examples/tensorflow/inception_v1/Makefile: -------------------------------------------------------------------------------- 1 | 2 | ifneq ($(findstring movidius, $(PYTHONPATH)), movidius) 3 | export PYTHONPATH:=/opt/movidius/caffe/python:$(PYTHONPATH) 4 | endif 5 | 6 | NCCOMPILE = mvNCCompile 7 | NCPROFILE = mvNCProfile 8 | NCCHECK = mvNCCheck 9 | 10 | .IGNORE: profile check compile 11 | 12 | WEIGHTS_FILENAME = inception_v1_2016_08_28.tar.gz 13 | GET_WEIGHTS = (wget http://download.tensorflow.org/models/${WEIGHTS_FILENAME} && tar zxf ${WEIGHTS_FILENAME} && rm ${WEIGHTS_FILENAME}) 14 | 15 | MODEL_FILENAME = output/inception-v1.meta 16 | CONV_SCRIPT = ./inception-v1.py 17 | 18 | INPUT_NODE_FLAG = -in=input 19 | OUTPUT_NODE_FLAG = -on=InceptionV1/Logits/Predictions/Reshape_1 20 | 21 | .PHONY: all 22 | all: profile check compile 23 | 24 | .PHONY: prereqs 25 | prereqs: 26 | (cd ../../data/ilsvrc12; make) 27 | @sed -i 's/\r//' run.py 28 | @chmod +x run.py 29 | 30 | .PHONY: profile 31 | profile: weights 32 | ${NCPROFILE} -s 12 ${MODEL_FILENAME} ${INPUT_NODE_FLAG} ${OUTPUT_NODE_FLAG} 33 | 34 | .PHONY: browse_profile 35 | browse_profile: weights profile 36 | @if [ -e output_report.html ] ; \ 37 | then \ 38 | firefox output_report.html & \ 39 | else \ 40 | @echo "***\nError - output_report.html not found" ; \ 41 | fi ; 42 | 43 | .PHONY: weights 44 | weights: 45 | @sed -i 's/\r//' ${CONV_SCRIPT} 46 | @chmod +x ${CONV_SCRIPT} 47 | test -f ${MODEL_FILENAME} || (${GET_WEIGHTS} && ${CONV_SCRIPT}) 48 | 49 | .PHONY: compile 50 | compile: weights 51 | test -f graph || ${NCCOMPILE} -s 12 ${MODEL_FILENAME} ${INPUT_NODE_FLAG} ${OUTPUT_NODE_FLAG} 52 | 53 | .PHONY: check 54 | check: weights 55 | -${NCCHECK} -s 12 ${MODEL_FILENAME} ${INPUT_NODE_FLAG} ${OUTPUT_NODE_FLAG} -i ../../data/images/cat.jpg -id 829 -S 2 -M 128 -cs 0,1,2 -metric top1 56 | 57 | .PHONY: run 58 | run: compile 59 | ./run.py 60 | 61 | .PHONY: run_py 62 | run_py: compile 63 | ./run.py 64 | 65 | .PHONY: help 66 | help: 67 | @echo "possible make targets: "; 68 | @echo " make help - shows this message"; 69 | @echo " make all - makes the following: prototxt, profile, compile, check, cpp, run_py, run_cpp"; 70 | @echo " make weights - downloads the trained model"; 71 | @echo " make compile - runs SDK compiler tool to compile the NCS graph file for the network"; 72 | @echo " make check - runs SDK checker tool to verify an NCS graph file"; 73 | @echo " make profile - runs the SDK profiler tool to profile the network creating output_report.html"; 74 | @echo " make browse_profile - runs the SDK profiler tool and brings up report in browser."; 75 | @echo " make run_py - runs the run.py python example program"; 76 | @echo " make clean - removes all created content" 77 | 78 | 79 | clean: 80 | rm -f output.gv 81 | rm -f output.gv.svg 82 | rm -f output_report.html 83 | rm -f output_expected.npy 84 | rm -f *.ckpt 85 | rm -f output_result.npy 86 | rm -f output_val.csv 87 | rm -rf output 88 | 89 | -------------------------------------------------------------------------------- /examples/tensorflow/inception_v1/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | The [inception v1](https://github.com/tensorflow/models/tree/master/slim/nets) network can be used for image classification. The provided Makefile does the following 3 | 1. Downloads the TensorFlow checkpoint file 4 | 2. Runs the conversion/save python script to generate network.meta file. 5 | 3. Profiles, Compiles and Checks the network using the Neural Compute SDK. 6 | 4. There is a run.py provided that does a single inference on a provided image as an example on how to use the network using the Neural Compute API 7 | 8 | # Makefile 9 | Provided Makefile describes various targets that help with the above mentioned tasks. 10 | 11 | ## make all 12 | Runs ncprofile, ncompile and run. 13 | 14 | ## make profile 15 | Runs the provided network on the NCS and generates per layer statistics that are helpful for understanding the performance of the network on the Neural Compute Stick. 16 | 17 | ## make compile 18 | Uses the network description and the trained weights files to generate a Movidius internal 'graph' format file. This file is later used for loading the network on to the Neural Compute Stick and executing the network. 19 | 20 | ## make run 21 | Runs the provided run.py file which sends a single image to the Neural Compute Stick and receives and displays the inference results. 22 | 23 | ## make check 24 | Runs the network on Caffe on CPU and runs the network on the Neural Compute Stick. Check then compares the two results to make sure they are consistent with each other. 25 | 26 | ## make clean 27 | Removes all the temporary files that are created by the Makefile 28 | 29 | -------------------------------------------------------------------------------- /examples/tensorflow/inception_v1/graph: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/tensorflow/inception_v1/graph -------------------------------------------------------------------------------- /examples/tensorflow/inception_v1/inception-v1.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python3 2 | 3 | import numpy as np 4 | import tensorflow as tf 5 | 6 | from tensorflow.contrib.slim.nets import inception 7 | 8 | slim = tf.contrib.slim 9 | 10 | def run(name, image_size, num_classes): 11 | with tf.Graph().as_default(): 12 | image = tf.placeholder("float", [1, image_size, image_size, 3], name="input") 13 | with slim.arg_scope(inception.inception_v1_arg_scope()): 14 | logits, _ = inception.inception_v1(image, num_classes, is_training=False, spatial_squeeze=False) 15 | probabilities = tf.nn.softmax(logits) 16 | init_fn = slim.assign_from_checkpoint_fn('inception_v1.ckpt', slim.get_model_variables('InceptionV1')) 17 | 18 | with tf.Session() as sess: 19 | init_fn(sess) 20 | saver = tf.train.Saver(tf.global_variables()) 21 | saver.save(sess, "output/"+name) 22 | 23 | run('inception-v1', 224, 1001) 24 | -------------------------------------------------------------------------------- /examples/tensorflow/inception_v1/inputsize.txt: -------------------------------------------------------------------------------- 1 | 224 -------------------------------------------------------------------------------- /examples/tensorflow/inception_v1/run.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python3 2 | 3 | # Copyright 2017 Intel Corporation. 4 | # The source code, information and material ("Material") contained herein is 5 | # owned by Intel Corporation or its suppliers or licensors, and title to such 6 | # Material remains with Intel Corporation or its suppliers or licensors. 7 | # The Material contains proprietary information of Intel or its suppliers and 8 | # licensors. The Material is protected by worldwide copyright laws and treaty 9 | # provisions. 10 | # No part of the Material may be used, copied, reproduced, modified, published, 11 | # uploaded, posted, transmitted, distributed or disclosed in any way without 12 | # Intel's prior express written permission. No license under any patent, 13 | # copyright or other intellectual property rights in the Material is granted to 14 | # or conferred upon you, either expressly, by implication, inducement, estoppel 15 | # or otherwise. 16 | # Any license under such intellectual property rights must be express and 17 | # approved by Intel in writing. 18 | 19 | from mvnc import mvncapi as mvnc 20 | import sys 21 | import numpy 22 | import cv2 23 | 24 | path_to_networks = './' 25 | path_to_images = '../../data/images/' 26 | graph_filename = 'graph' 27 | image_filename = path_to_images + 'nps_electric_guitar.png' 28 | 29 | #mvnc.SetGlobalOption(mvnc.GlobalOption.LOGLEVEL, 2) 30 | devices = mvnc.EnumerateDevices() 31 | if len(devices) == 0: 32 | print('No devices found') 33 | quit() 34 | 35 | device = mvnc.Device(devices[0]) 36 | device.OpenDevice() 37 | 38 | #Load graph 39 | with open(path_to_networks + graph_filename, mode='rb') as f: 40 | graphfile = f.read() 41 | 42 | #Load preprocessing data 43 | mean = 128 44 | std = 1/128 45 | 46 | #Load categories 47 | categories = [] 48 | with open(path_to_networks + 'categories.txt', 'r') as f: 49 | for line in f: 50 | cat = line.split('\n')[0] 51 | if cat != 'classes': 52 | categories.append(cat) 53 | f.close() 54 | print('Number of categories:', len(categories)) 55 | 56 | #Load image size 57 | with open(path_to_networks + 'inputsize.txt', 'r') as f: 58 | reqsize = int(f.readline().split('\n')[0]) 59 | 60 | graph = device.AllocateGraph(graphfile) 61 | 62 | img = cv2.imread(image_filename).astype(numpy.float32) 63 | 64 | dx,dy,dz= img.shape 65 | delta=float(abs(dy-dx)) 66 | if dx > dy: #crop the x dimension 67 | img=img[int(0.5*delta):dx-int(0.5*delta),0:dy] 68 | else: 69 | img=img[0:dx,int(0.5*delta):dy-int(0.5*delta)] 70 | 71 | img = cv2.resize(img, (reqsize, reqsize)) 72 | 73 | img=cv2.cvtColor(img,cv2.COLOR_BGR2RGB) 74 | 75 | for i in range(3): 76 | img[:,:,i] = (img[:,:,i] - mean) * std 77 | 78 | print('Start download to NCS...') 79 | graph.LoadTensor(img.astype(numpy.float16), 'user object') 80 | output, userobj = graph.GetResult() 81 | 82 | top_inds = output.argsort()[::-1][:5] 83 | 84 | print(''.join(['*' for i in range(79)])) 85 | print('inception-v1 on NCS') 86 | print(''.join(['*' for i in range(79)])) 87 | for i in range(5): 88 | print(top_inds[i], categories[top_inds[i]], output[top_inds[i]]) 89 | 90 | print(''.join(['*' for i in range(79)])) 91 | graph.DeallocateGraph() 92 | device.CloseDevice() 93 | print('Finished') 94 | -------------------------------------------------------------------------------- /examples/tensorflow/inception_v3/Makefile: -------------------------------------------------------------------------------- 1 | 2 | ifneq ($(findstring movidius, $(PYTHONPATH)), movidius) 3 | export PYTHONPATH:=/opt/movidius/caffe/python:$(PYTHONPATH) 4 | endif 5 | 6 | NCCOMPILE = mvNCCompile 7 | NCPROFILE = mvNCProfile 8 | NCCHECK = mvNCCheck 9 | 10 | .IGNORE: profile check compile 11 | 12 | WEIGHTS_FILENAME = inception_v3_2016_08_28.tar.gz 13 | GET_WEIGHTS = (wget http://download.tensorflow.org/models/${WEIGHTS_FILENAME} && tar zxf ${WEIGHTS_FILENAME} && rm ${WEIGHTS_FILENAME}) 14 | 15 | MODEL_FILENAME = output/inception-v3.meta 16 | CONV_SCRIPT = ./inception-v3.py 17 | 18 | INPUT_NODE_FLAG = -in=input 19 | OUTPUT_NODE_FLAG = -on=InceptionV3/Predictions/Reshape_1 20 | 21 | .PHONY: all 22 | all: profile check compile 23 | 24 | .PHONY: prereqs 25 | prereqs: 26 | (cd ../../data/ilsvrc12; make) 27 | @sed -i 's/\r//' run.py 28 | @chmod +x run.py 29 | 30 | .PHONY: profile 31 | profile: weights 32 | ${NCPROFILE} -s 12 ${MODEL_FILENAME} ${INPUT_NODE_FLAG} ${OUTPUT_NODE_FLAG} 33 | 34 | .PHONY: browse_profile 35 | browse_profile: weights 36 | ${NCPROFILE} -s 12 ${MODEL_FILENAME} ${INPUT_NODE_FLAG} ${OUTPUT_NODE_FLAG} 37 | firefox output_report.html & 38 | 39 | .PHONY: weights 40 | weights: 41 | @sed -i 's/\r//' ${CONV_SCRIPT} 42 | @chmod +x ${CONV_SCRIPT} 43 | test -f ${MODEL_FILENAME} || (${GET_WEIGHTS} && ${CONV_SCRIPT}) 44 | 45 | .PHONY: compile 46 | compile: weights 47 | test -f graph || ${NCCOMPILE} -s 12 ${MODEL_FILENAME} ${INPUT_NODE_FLAG} ${OUTPUT_NODE_FLAG} 48 | 49 | .PHONY: check 50 | check: weights 51 | -${NCCHECK} -s 12 ${MODEL_FILENAME} ${INPUT_NODE_FLAG} ${OUTPUT_NODE_FLAG} -i ../../data/images/cat.jpg -id 917 -M 128 -S 2 -cs 0,1,2 -metric top1 52 | 53 | .PHONY: run 54 | run: compile 55 | ./run.py 56 | 57 | .PHONY: run_py 58 | run_py: compile 59 | ./run.py 60 | 61 | .PHONY: help 62 | help: 63 | @echo "possible make targets: "; 64 | @echo " make help - shows this message"; 65 | @echo " make all - makes the following: prototxt, profile, compile, check, cpp, run_py, run_cpp"; 66 | @echo " make weights - downloads the trained model"; 67 | @echo " make compile - runs SDK compiler tool to compile the NCS graph file for the network"; 68 | @echo " make check - runs SDK checker tool to verify an NCS graph file"; 69 | @echo " make profile - runs the SDK profiler tool to profile the network creating output_report.html"; 70 | @echo " make browse_profile - runs the SDK profiler tool and brings up report in browser."; 71 | @echo " make run_py - runs the run.py python example program"; 72 | @echo " make clean - removes all created content" 73 | 74 | clean: 75 | rm -f output.gv 76 | rm -f output.gv.svg 77 | rm -f output_report.html 78 | rm -f output_expected.npy 79 | rm -f *.ckpt 80 | rm -f output_result.npy 81 | rm -f output_val.csv 82 | rm -rf output 83 | 84 | -------------------------------------------------------------------------------- /examples/tensorflow/inception_v3/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | The [inception v3](https://github.com/tensorflow/models/tree/master/research/slim) network can be used for image classification. The provided Makefile does the following 3 | 1. Downloads the TensorFlow checkpoint file 4 | 2. Runs the conversion/save python script to generate network.meta file. 5 | 3. Profiles, Compiles and Checks the network using the Neural Compute SDK. 6 | 4. There is a run.py provided that does a single inference on a provided image as an example on how to use the network using the Neural Compute API 7 | 8 | # Makefile 9 | Provided Makefile describes various targets that help with the above mentioned tasks. 10 | 11 | ## make all 12 | Runs ncprofile, nccompile and run. 13 | 14 | ## make profile 15 | Runs the provided network on the NCS and generates per layer statistics that are helpful for understanding the performance of the network on the Neural Compute Stick. 16 | 17 | ## make compile 18 | Uses the network description and the trained weights files to generate a Movidius internal 'graph' format file. This file is later used for loading the network on to the Neural Compute Stick and executing the network. 19 | 20 | ## make run 21 | Runs the provided run.py file which sends a single image to the Neural Compute Stick and receives and displays the inference results. 22 | 23 | ## make check 24 | Runs the network on Caffe on CPU and runs the network on the Neural Compute Stick. Check then compares the two results to make sure they are consistent with each other. 25 | 26 | ## make clean 27 | Removes all the temporary files that are created by the Makefile 28 | -------------------------------------------------------------------------------- /examples/tensorflow/inception_v3/graph: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markjay4k/ncsdk-aarch64/cbe7a0cfd64eab0c27bb6817497a4a0adc676cef/examples/tensorflow/inception_v3/graph -------------------------------------------------------------------------------- /examples/tensorflow/inception_v3/inception-v3.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python3 2 | 3 | import numpy as np 4 | import tensorflow as tf 5 | 6 | from tensorflow.contrib.slim.nets import inception 7 | 8 | slim = tf.contrib.slim 9 | 10 | def run(name, image_size, num_classes): 11 | with tf.Graph().as_default(): 12 | image = tf.placeholder("float", [1, image_size, image_size, 3], name="input") 13 | with slim.arg_scope(inception.inception_v3_arg_scope()): 14 | logits, _ = inception.inception_v3(image, num_classes, is_training=False, spatial_squeeze=False) 15 | probabilities = tf.nn.softmax(logits) 16 | init_fn = slim.assign_from_checkpoint_fn('inception_v3.ckpt', slim.get_model_variables('InceptionV3')) 17 | 18 | with tf.Session() as sess: 19 | init_fn(sess) 20 | saver = tf.train.Saver(tf.global_variables()) 21 | saver.save(sess, "output/"+name) 22 | 23 | run('inception-v3', 299, 1001) 24 | -------------------------------------------------------------------------------- /examples/tensorflow/inception_v3/inputsize.txt: -------------------------------------------------------------------------------- 1 | 299 -------------------------------------------------------------------------------- /examples/tensorflow/inception_v3/run.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python3 2 | 3 | # Copyright 2017 Intel Corporation. 4 | # The source code, information and material ("Material") contained herein is 5 | # owned by Intel Corporation or its suppliers or licensors, and title to such 6 | # Material remains with Intel Corporation or its suppliers or licensors. 7 | # The Material contains proprietary information of Intel or its suppliers and 8 | # licensors. The Material is protected by worldwide copyright laws and treaty 9 | # provisions. 10 | # No part of the Material may be used, copied, reproduced, modified, published, 11 | # uploaded, posted, transmitted, distributed or disclosed in any way without 12 | # Intel's prior express written permission. No license under any patent, 13 | # copyright or other intellectual property rights in the Material is granted to 14 | # or conferred upon you, either expressly, by implication, inducement, estoppel 15 | # or otherwise. 16 | # Any license under such intellectual property rights must be express and 17 | # approved by Intel in writing. 18 | 19 | from mvnc import mvncapi as mvnc 20 | import sys 21 | import numpy 22 | import cv2 23 | 24 | path_to_networks = './' 25 | path_to_images = '../../data/images/' 26 | graph_filename = 'graph' 27 | image_filename = path_to_images + 'nps_electric_guitar.png' 28 | 29 | #mvnc.SetGlobalOption(mvnc.GlobalOption.LOGLEVEL, 2) 30 | devices = mvnc.EnumerateDevices() 31 | if len(devices) == 0: 32 | print('No devices found') 33 | quit() 34 | 35 | device = mvnc.Device(devices[0]) 36 | device.OpenDevice() 37 | 38 | #Load graph 39 | with open(path_to_networks + graph_filename, mode='rb') as f: 40 | graphfile = f.read() 41 | 42 | #Load preprocessing data 43 | mean = 128 44 | std = 1/128 45 | 46 | #Load categories 47 | categories = [] 48 | with open(path_to_networks + 'categories.txt', 'r') as f: 49 | for line in f: 50 | cat = line.split('\n')[0] 51 | if cat != 'classes': 52 | categories.append(cat) 53 | f.close() 54 | print('Number of categories:', len(categories)) 55 | 56 | #Load image size 57 | with open(path_to_networks + 'inputsize.txt', 'r') as f: 58 | reqsize = int(f.readline().split('\n')[0]) 59 | 60 | graph = device.AllocateGraph(graphfile) 61 | 62 | img = cv2.imread(image_filename).astype(numpy.float32) 63 | dx,dy,dz= img.shape 64 | delta=float(abs(dy-dx)) 65 | if dx > dy: #crop the x dimension 66 | img=img[int(0.5*delta):dx-int(0.5*delta),0:dy] 67 | else: 68 | img=img[0:dx,int(0.5*delta):dy-int(0.5*delta)] 69 | img = cv2.resize(img, (reqsize, reqsize)) 70 | 71 | img=cv2.cvtColor(img,cv2.COLOR_BGR2RGB) 72 | 73 | for i in range(3): 74 | img[:,:,i] = (img[:,:,i] - mean) * std 75 | 76 | print('Start download to NCS...') 77 | graph.LoadTensor(img.astype(numpy.float16), 'user object') 78 | output, userobj = graph.GetResult() 79 | 80 | top_inds = output.argsort()[::-1][:5] 81 | 82 | print(''.join(['*' for i in range(79)])) 83 | print('inception-v3 on NCS') 84 | print(''.join(['*' for i in range(79)])) 85 | for i in range(5): 86 | print(top_inds[i], categories[top_inds[i]], output[top_inds[i]]) 87 | 88 | print(''.join(['*' for i in range(79)])) 89 | graph.DeallocateGraph() 90 | device.CloseDevice() 91 | print('Finished') 92 | -------------------------------------------------------------------------------- /examples/tensorflow/readme.md: -------------------------------------------------------------------------------- 1 | # Examples showing TensorFlow usage 2 | -------------------------------------------------------------------------------- /install-opencv.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | #test for python already installed for opencv 4 | python3 -c "import cv2" > /dev/null 2>&1 5 | if [ $? -eq 0 ] ; 6 | then 7 | echo ""; 8 | echo "OpenCV already setup for python"; 9 | echo ""; 10 | exit 0 11 | fi; 12 | 13 | ## Install OpenCV 14 | echo "" 15 | echo "************************ Please confirm *******************************" 16 | echo " Installing OpenCV on Raspberry Pi or rock64 may take a long time. " 17 | echo " You may skip this part of the installation in which case some examples " 18 | echo " may not work without modifications but the rest of the SDK will still " 19 | echo " be functional. Select n to skip OpenCV installation or y to install it." 20 | read -p " Continue installing OpenCV (y/n) ? " CONTINUE 21 | 22 | if [[ "$CONTINUE" == "y" || "$CONTINUE" == "Y" ]]; then 23 | if [[ `uname -p` =~ "aarch64" ]]; then 24 | echo ""; 25 | echo "Installing OpenCV for rock64"; 26 | echo ""; 27 | 28 | sudo apt update 29 | sudo apt upgrade 30 | sudo apt-get install -y build-essential cmake unzip pkg-config 31 | sudo apt-get install -y libjpeg-dev libpng-dev libtiff-dev 32 | sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev libv4l-dev 33 | sudo apt-get install -y libxvidcore-dev libx264-dev 34 | sudo apt-get install -y libgtk-3-dev 35 | sudo apt-get install -y libatlas-base-dev gfortran 36 | sudo apt-get install -y python3-dev 37 | cd ~ 38 | wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/3.4.1.zip 39 | wget -O opencv.zip https://github.com/opencv/opencv/archive/3.4.1.zip 40 | unzip opencv_contrib.zip 41 | unzip opencv.zip 42 | 43 | cd ~/opencv-3.4.1/ 44 | mkdir build 45 | cd build 46 | cmake -D CMAKE_BUILD_TYPE=RELEASE \ 47 | -D CMAKE_INSTALL_PREFIX=/usr/local \ 48 | -D INSTALL_PYTHON_EXAMPLES=OFF\ 49 | -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.4.1/modules \ 50 | -D BUILD_EXAMPLES=OFF .. 51 | 52 | make 53 | sudo make install 54 | sudo ldconfig 55 | 56 | elif [[ `lsb_release -d` =~ .*Raspbian.* ]]; then 57 | echo ""; 58 | echo "Installing OpenCV for Raspbian"; 59 | echo ""; 60 | sudo apt-get update -y && sudo apt-get upgrade -y 61 | sudo apt-get install -y build-essential cmake pkg-config 62 | sudo apt-get install -y libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev 63 | sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev libv4l-dev 64 | sudo apt-get install -y libxvidcore-dev libx264-dev 65 | sudo apt-get install -y libgtk2.0-dev libgtk-3-dev 66 | sudo apt-get install -y libatlas-base-dev gfortran 67 | sudo apt-get install -y python2.7-dev python3-dev 68 | cd ~ 69 | wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.4.0.zip 70 | unzip opencv.zip 71 | wget -O opencv_contrib.zip https://github.com/Itseez/opencv_contrib/archive/3.3.0.zip 72 | unzip opencv_contrib.zip 73 | cd ~/opencv-3.4.0/ 74 | mkdir build 75 | cd build 76 | cmake -D CMAKE_BUILD_TYPE=RELEASE \ 77 | -D CMAKE_INSTALL_PREFIX=/usr/local \ 78 | -D INSTALL_PYTHON_EXAMPLES=OFF \ 79 | -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.3.0/modules \ 80 | -D BUILD_EXAMPLES=OFF .. 81 | make 82 | sudo make install 83 | sudo ldconfig 84 | else 85 | echo "Installing opencv python for non-Raspbian"; 86 | sudo -H pip3 install opencv-python 87 | sudo -H pip3 install opencv-contrib-python 88 | fi 89 | else 90 | echo ""; 91 | echo "Skipping OpenCV installation"; 92 | echo ""; 93 | fi 94 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # download the file 4 | sudo cp -f ncsdk.conf /tmp 5 | 6 | download_filename=NCSDK-1.12.tar.gz 7 | 8 | # ncsdk_link is the url 9 | # ncsdk_link=https://software.intel.com/sites/default/files/managed/33/1b/NCSDK-1.12.00.01.tar.gz 10 | 11 | # download the payload from the redirector link 12 | # and save it the download_filename no matter what the original filename was 13 | # wget --no-cache -O ${download_filename} $ncsdk_link 14 | 15 | # Get the filenames, ncsdk_archive is just the download filename 16 | # and ncsdk_pkg is the filename without the .tar.gz 17 | #ncsdk_archive=$(echo "$ncsdk_link" | grep -o '[^/]*$') 18 | ncsdk_archive=${download_filename} 19 | ncsdk_pkg=${ncsdk_archive%%.tar.gz} 20 | 21 | # now install-ncsdk.sh is doing the uninstallation if necessary. 22 | # Remove older installation dirs 23 | # if [ -f /opt/movidius/uninstall-ncsdk.sh ] 24 | # then 25 | # echo "Removing previous install..." 26 | # /opt/movidius/uninstall-ncsdk.sh 27 | #fi 28 | 29 | # Create Required installation dirs 30 | sudo rm -rf /opt/movidius 31 | sudo mkdir -p /opt/movidius 32 | 33 | # untar the new install and run the install script 34 | # sudo tar zxvf ./ncsdk.tar.gz 35 | # sudo mv $ncsdk_pkg* NCSDK 36 | sudo cp -r NCSDK-1.12.00.01 /opt/movidius/NCSDK 37 | cd /opt/movidius/NCSDK 38 | sudo cp /tmp/ncsdk.conf . 39 | ./install-ncsdk.sh 40 | 41 | # leave the uninstall script on the target 42 | #sudo cp ./uninstall-ncsdk.sh ../ncsdk/ 43 | 44 | # cleanup 45 | cd .. 46 | # sudo rm ncsdk.tar.gz 47 | #sudo rm -r NCSDK 48 | # sudo rm -f /tmp/${ncsdk_archive} 49 | -------------------------------------------------------------------------------- /ncsdk.conf: -------------------------------------------------------------------------------- 1 | MAKE_PROCS=1 2 | SETUPDIR=/opt/movidius 3 | VERBOSE=yes 4 | SYSTEM_INSTALL=yes 5 | CAFFE_FLAVOR=ssd 6 | CAFFE_USE_CUDA=no 7 | INSTALL_TENSORFLOW=yes 8 | INSTALL_TOOLKIT=yes 9 | -------------------------------------------------------------------------------- /uninstall-opencv.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | #test for python already installed for opencv 4 | python3 -c "import cv2" > /dev/null 2>&1 5 | if [ $? -eq 0 ] ; 6 | then 7 | echo "" 8 | echo "************************ Please confirm *******************************" 9 | echo " NCSDK 1.11 requires that previous installations of openCV" 10 | echo " be uninstalled before proceeding with NCSDK installation." 11 | echo " Note that if you installed opencv via pip3 or from source into the" 12 | echo " home directory, it will be uninstalled." 13 | read -p " Continue uninstalling OpenCV (y/n) ? " CONTINUE 14 | if [[ "$CONTINUE" == "y" || "$CONTINUE" == "Y" ]]; then 15 | echo ""; 16 | echo "OpenCV already setup for python"; 17 | echo ""; 18 | echo "Uninstalling opencv pip installation"; 19 | sudo pip3 uninstall opencv-contrib-python 20 | sudo pip3 uninstall opencv-python 21 | 22 | echo "Looking for opencv source installation"; 23 | if [ -d "$HOME/opencv-3.3.0" ]; then 24 | echo "opencv-3.3.0 directory exists" 25 | if [ -e "$HOME/opencv-3.3.0/build/Makefile" ]; then 26 | echo "opencv-3.3.0 Makefile exists, attempting to uninstall opencv-3.3.0" 27 | cd "$HOME/opencv-3.3.0/build" 28 | sudo make uninstall &> /dev/null 29 | echo "done." 30 | fi 31 | fi 32 | else 33 | echo " Not removing opencv, quitting." 34 | exit 1 35 | fi 36 | fi 37 | -------------------------------------------------------------------------------- /uninstall.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | if [ -f /opt/movidius/uninstall-ncsdk.sh ]; then 4 | echo "running uninstall-ncsdk.sh" 5 | /opt/movidius/uninstall-ncsdk.sh 6 | else 7 | echo "could not find uninstall-ncsdk.sh - nothing to uninstall" 8 | fi 9 | 10 | sudo rm -rf /opt/movidius/ncsdk 11 | 12 | --------------------------------------------------------------------------------