Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make indentation consistent with PEP8 (4 spaces) #13

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

ifneq ($(findstring movidius, $(PYTHONPATH)), movidius)
export PYTHONPATH:=/opt/movidius/caffe/python:/opt/movidius/mvnc/python:$(PYTHONPATH)
export PYTHONPATH:=/opt/movidius/caffe/python:$(PYTHONPATH)
endif


Expand All @@ -11,6 +11,7 @@ help:
@echo " make help - shows this message"
@echo " make install - Installs the ncsdk."
@echo " make examples - makes the ncsdk examples."
@echo " make api - installs only the api. Ideal for RPi setup."
@echo " make uninstall - uninstalls the ncsdk."
@echo " make clean - removes targets and intermediate files."

Expand All @@ -21,6 +22,10 @@ all: install examples
opencv:
./install-opencv.sh

.PHONY: uninstallopencv
uninstallopencv:
./uninstall-opencv.sh

.PHONY: prereqs
prereqs:
@sed -i 's/\r//' ncsdk.conf
Expand All @@ -35,9 +40,10 @@ prereqs:
@chmod +x install.sh
@chmod +x uninstall.sh
@chmod +x install-opencv.sh
@chmod +x uninstall-opencv.sh

.PHONY: install
install: prereqs
install: prereqs uninstallopencv
@echo "\nmake install starting."
./install.sh

Expand All @@ -56,6 +62,10 @@ runexamples: prereqs opencv
@echo "\nmake examples starting."
(cd examples; make run)

.PHONY: api
api: @echo "\nmake api starting."
(cd api/src; make; make install)

.PHONY: clean
clean:
@echo "\nmake clean starting."
Expand Down
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
# Movidius™ Neural Compute Software Development Kit
This SDK is provided for users of the [Movidius™ Neural Compute Stick (NCS)](https://developer.movidius.com/). It provides software tools, an API, and examples which enable developers to create software that takes advantage of the hardware the accelerated neural network capability provided by the NCS.
# Intel® Movidius™ Neural Compute SDK
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.


# Installation
The provided Makefile helps with installation. Clone this repository and then run the following command to install the SDK.
The provided Makefile helps with installation. Clone this repository and then run the following command to install the NCSDK:

```
make install
```

# Examples
Also included in the SDK are examples. After cloning and running 'make install' run the following command to install examples.
The Neural Compute SDK also includes examples. After cloning and running 'make install,' run the following command to install the examples:
```
make examples
```

## NCAPPZOO Examples
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.

# Documentation
The complete Neural Compute SDK documentation can be viewed at [https://movidius.github.io/ncsdk/](https://movidius.github.io/ncsdk/)
The complete Intel Movidius Neural Compute SDK documentation can be viewed at [https://movidius.github.io/ncsdk/](https://movidius.github.io/ncsdk/)

# Getting Started Video
For installation and general instructions to get started with the NCSDK, take a look at this [video](https://www.youtube.com/watch?v=fESFVNcQVVA)

# Troubleshooting and Tech Support
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.

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.
193 changes: 193 additions & 0 deletions api/LICENSE

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions api/include/mvnc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#ifndef __MVNC_H_INCLUDED__
#define __MVNC_H_INCLUDED__

#ifdef __cplusplus
extern "C"
{
#endif

#define MVNC_MAX_NAME_SIZE 28

typedef enum {
MVNC_OK = 0,
MVNC_BUSY = -1, // Device is busy, retry later
MVNC_ERROR = -2, // Error communicating with the device
MVNC_OUT_OF_MEMORY = -3, // Out of memory
MVNC_DEVICE_NOT_FOUND = -4, // No device at the given index or name
MVNC_INVALID_PARAMETERS = -5, // At least one of the given parameters is wrong
MVNC_TIMEOUT = -6, // Timeout in the communication with the device
MVNC_MVCMD_NOT_FOUND = -7, // The file to boot Myriad was not found
MVNC_NO_DATA = -8, // No data to return, call LoadTensor first
MVNC_GONE = -9, // The graph or device has been closed during the operation
MVNC_UNSUPPORTED_GRAPH_FILE = -10, // The graph file version is not supported
MVNC_MYRIAD_ERROR = -11, // An error has been reported by the device, use MVNC_DEBUG_INFO
} mvncStatus;

typedef enum {
MVNC_LOG_LEVEL = 0, // Log level, int, 0 = nothing, 1 = errors, 2 = verbose
} mvncGlobalOptions;

typedef enum {
MVNC_ITERATIONS = 0, // Number of iterations per inference, int, normally 1, not for general use
MVNC_NETWORK_THROTTLE = 1, // Measure temperature once per inference instead of once per layer, int, not for general use
MVNC_DONT_BLOCK = 2, // LoadTensor will return BUSY instead of blocking, GetResult will return NO_DATA, int
MVNC_TIME_TAKEN = 1000, // Return time taken for inference (float *)
MVNC_DEBUG_INFO = 1001, // Return debug info, string
} mvncGraphOptions;

typedef enum {
MVNC_TEMP_LIM_LOWER = 1, // Temperature for short sleep, float, not for general use
MVNC_TEMP_LIM_HIGHER = 2, // Temperature for long sleep, float, not for general use
MVNC_BACKOFF_TIME_NORMAL = 3, // Normal sleep in ms, int, not for general use
MVNC_BACKOFF_TIME_HIGH = 4, // Short sleep in ms, int, not for general use
MVNC_BACKOFF_TIME_CRITICAL = 5, // Long sleep in ms, int, not for general use
MVNC_TEMPERATURE_DEBUG = 6, // Stop on critical temperature, int, not for general use
MVNC_THERMAL_STATS = 1000, // Return temperatures, float *, not for general use
MVNC_OPTIMISATION_LIST = 1001, // Return optimisations list, char *, not for general use
MVNC_THERMAL_THROTTLING_LEVEL = 1002, // 1=TEMP_LIM_LOWER reached, 2=TEMP_LIM_HIGHER reached
} mvncDeviceOptions;

mvncStatus mvncGetDeviceName(int index, char *name, unsigned int nameSize);
mvncStatus mvncOpenDevice(const char *name, void **deviceHandle);
mvncStatus mvncCloseDevice(void *deviceHandle);
mvncStatus mvncAllocateGraph(void *deviceHandle, void **graphHandle, const void *graphFile, unsigned int graphFileLength);
mvncStatus mvncDeallocateGraph(void *graphHandle);
mvncStatus mvncSetGlobalOption(int option, const void *data, unsigned int dataLength);
mvncStatus mvncGetGlobalOption(int option, void *data, unsigned int *dataLength);
mvncStatus mvncSetGraphOption(void *graphHandle, int option, const void *data, unsigned int dataLength);
mvncStatus mvncGetGraphOption(void *graphHandle, int option, void *data, unsigned int *dataLength);
mvncStatus mvncSetDeviceOption(void *deviceHandle, int option, const void *data, unsigned int dataLength);
mvncStatus mvncGetDeviceOption(void *deviceHandle, int option, void *data, unsigned int *dataLength);
mvncStatus mvncLoadTensor(void *graphHandle, const void *inputTensor, unsigned int inputTensorLength, void *userParam);
mvncStatus mvncGetResult(void *graphHandle, void **outputData, unsigned int *outputDataLength, void **userParam);

#include "mvnc_deprecated.h"
#ifdef __cplusplus
}
#endif

#endif
39 changes: 39 additions & 0 deletions api/include/mvnc_deprecated.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#ifndef __MVNC_DEPRECATED_H_INCLUDED__
#define __MVNC_DEPRECATED_H_INCLUDED__

#ifdef __cplusplus
extern "C"
{
#endif

typedef mvncGraphOptions GraphOptions __attribute__ \
((deprecated("GraphOptions is deprecated. Please use mvncGraphOptions")));
typedef mvncDeviceOptions DeviceOptions __attribute__ \
((deprecated("DeviceOptions is deprecated. Please use mvncDeviceOptions")));

// Deprecated Define
#define MVNC_MAXNAMESIZE _Pragma("GCC warning \"'MVNC_MAXNAMESIZE' is deprecated. Please use 'MVNC_MAX_NAME_SIZE'\"") MVNC_MAX_NAME_SIZE

// Deprecated Global Options
#define MVNC_LOGLEVEL _Pragma("GCC warning \"'MVNC_LOGLEVEL' is deprecated. Please use 'MVNC_LOG_LEVEL'\"") MVNC_LOG_LEVEL

// Deprecated status values
#define MVNC_MVCMDNOTFOUND _Pragma("GCC warning \"'MVNC_MVCMDNOTFOUND' is deprecated. Please use 'MVNC_MVCMD_NOT_FOUND'\"") MVNC_MVCMD_NOT_FOUND
#define MVNC_NODATA _Pragma("GCC warning \"'MVNC_NO_DATA' is deprecated. Please use 'MVNC_NO_DATA'\"") MVNC_NO_DATA
#define MVNC_UNSUPPORTEDGRAPHFILE _Pragma("GCC warning \"'MVNC_UNSUPPORTEDGRAPHFILE' is deprecated. Please use 'MVNC_UNSUPPORTED_GRAPH_FILE'\"") MVNC_UNSUPPORTED_GRAPH_FILE
#define MVNC_MYRIADERROR _Pragma("GCC warning \"'MVNC_MYRIADERROR' is deprecated. Please use 'MVNC_MYRIAD_ERROR'\"") MVNC_MYRIAD_ERROR

// Deprecated Graph Options values
#define MVNC_DONTBLOCK _Pragma("GCC warning \"'MVNC_DONTBLOCK' is deprecated. Please use 'MVNC_DONT_BLOCK'\"") MVNC_DONT_BLOCK
#define MVNC_TIMETAKEN _Pragma("GCC warning \"'MVNC_TIMETAKEN' is deprecated. Please use 'MVNC_TIME_TAKEN'\"") MVNC_TIME_TAKEN
#define MVNC_DEBUGINFO _Pragma("GCC warning \"'MVNC_DEBUGINFO' is deprecated. Please use 'MVNC_DEBUG_INFO'\"") MVNC_DEBUG_INFO

// Deprecated Device Options Values
#define MVNC_THERMALSTATS _Pragma("GCC warning \"'MVNC_THERMALSTATS' is deprecated. Please use 'MVNC_THERMAL_STATS'\"") MVNC_THERMAL_STATS
#define MVNC_OPTIMISATIONLIST _Pragma("GCC warning \"'MVNC_OPTIMISATIONLIST' is deprecated. Please use 'MVNC_OPTIMISATION_LIST'\"") MVNC_OPTIMISATION_LIST

#ifdef __cplusplus
}
#endif

#endif
Empty file added api/python/mvnc/__init__.py
Empty file.
Loading