Skip to content

Commit

Permalink
Merge pull request #19 from movidius/ncsdk2-v2.05
Browse files Browse the repository at this point in the history
V2.05.00 Release Changes
  • Loading branch information
ecopty authored Jun 15, 2018
2 parents 588d12f + b608ed0 commit fde1265
Show file tree
Hide file tree
Showing 211 changed files with 89,175 additions and 5,872 deletions.
101 changes: 55 additions & 46 deletions ATTRIBUTIONS
Original file line number Diff line number Diff line change
Expand Up @@ -91,50 +91,59 @@ License License that accompanies it.

Creative Commons may be contacted at http://creativecommons.org/.

3. The Modernist theme

License: Creative Commons Zero v1.0 Universal
Homepage: https://github.com/pages-themes/modernist
3. documentation-theme-jekyll
License: MIT
Homepage: https://github.com/tomjoht/documentation-theme-jekyll

The MIT License (MIT)

Copyright (c) 2016 Tom Johnson

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

4. Navgoco
License: BSD 3-clause "New" or "Revised" License
homepage: http://github.com/tefra/navgoco/
/* This license pertains to the Navgoco jQuery component used for the sidebar. */

Copyright (c) 2013, Christodoulos Tsoulloftas, http://www.komposta.net
All rights reserved.

Creative Commons CC0 1.0 Universal
Creative Commons Legal Code
CC0 1.0 Universal
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER.
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work").

Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others.

For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights.

1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following:

the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;
moral rights retained by the original author(s) and/or performer(s);
publicity and privacy rights pertaining to a person's image or likeness depicted in a Work;
rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below;
rights protecting the extraction, dissemination, use and reuse of data in a Work;
database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and
other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work

in all territories worldwide,
for the maximum duration provided by applicable law or treaty (including future time extensions),
in any current or future medium and for any number of copies, and
for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver").
Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer's Copyright and Related Rights in the Work

in all territories worldwide,
for the maximum duration provided by applicable law or treaty (including future time extensions),
in any current or future medium and for any number of copies, and
for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License").
The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not
exercise any of his or her remaining Copyright and Related Rights in the Work or
assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer's express Statement of Purpose.
4. Limitations and Disclaimers.

No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document.
Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.
Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.
Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the <Christodoulos Tsoulloftas> nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
# 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.


# Neural Compute SDK2
## [NCSDK v2](https://github.com/movidius/ncsdk/releases/latest) is now available.

-------
All documentation in the docs directory is now in HTML format which is **best viewed from the documentation site: https://movidius.github.io/ncsdk/**
-------
-------
With this release the existing NCAPI v1 has been rearchitected into NCAPI v2 which will pave the way for future enhancements and capabilities, as well add some now! While users are transitioning to this new NCAPI v2 the legacy NCSDK v1.x release will stay on the master branch and NCSDK2 will be on the [ncsdk2](https://github.com/movidius/ncsdk/tree/ncsdk2) branch. At some point in the not too distant future, NCSDK2 will move to the master.

To help you get ready for NCSDK2 you can take a look at some of the [changes in NCAPI v2](https://movidius.github.io/ncsdk/ncapi/readme.html) as well as the [NCSDK2 Release Notes](https://movidius.github.io/ncsdk/release_notes.html).

To install NCSDK 2.x you can use the following command to clone the ncsdk2 branch
```bash
git clone -b ncsdk2 https://github.com/movidius/ncsdk.git
```
Or if you would rather install the legacy NCSDK 1.x you can use the following command to clone as has always been the case
```bash
git clone https://github.com/movidius/ncsdk.git
```

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

Expand All @@ -27,4 +46,4 @@ For installation and general instructions to get started with the NCSDK, take a
# 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.
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.
34 changes: 22 additions & 12 deletions api/include/mvnc.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,15 @@ typedef enum {
} ncStatus_t;

typedef enum {
NC_RW_LOG_LEVEL = 0, // Log level, int, MVLOG_DEBUG = 0, debug and above (full verbosity)
// MVLOG_INFO = 1, info and above
// MVLOG_WARN = 2, warnings and above
// MVLOG_ERROR = 3, errors and above
// MVLOG_FATAL = 4, fatal only
NC_LOG_DEBUG = 0, // debug and above (full verbosity)
NC_LOG_INFO, // info and above
NC_LOG_WARN, // warning and above
NC_LOG_ERROR, // errors and above
NC_LOG_FATAL, // fatal only
} ncLogLevel_t;

typedef enum {
NC_RW_LOG_LEVEL = 0, // Log level, int, default NC_LOG_WARN
NC_RO_API_VERSION = 1, // retruns API Version. array of unsigned int of size 4
//major.minor.hotfix.rc
} ncGlobalOption_t;
Expand Down Expand Up @@ -169,12 +173,17 @@ typedef enum {
NC_FIFO_FP32 = 1,
} ncFifoDataType_t;


struct ncTensorDescriptor_t {
unsigned int n;
unsigned int c;
unsigned int w;
unsigned int h;
unsigned int totalSize;
unsigned int n; // batch size, currently only 1 is supported
unsigned int c; // number of channels
unsigned int w; // width
unsigned int h; // height
unsigned int totalSize; // Total size of the data in tensor = largest stride* dim size
unsigned int cStride; // Stride in the channels' dimension
unsigned int wStride; // Stride in the horizontal dimension
unsigned int hStride; // Stride in the vertical dimension
ncFifoDataType_t dataType; // data type of the tensor, FP32 or FP16
};

typedef enum {
Expand All @@ -191,13 +200,14 @@ typedef enum {
NC_RO_FIFO_CAPACITY = 4, // return number of maximum elements in the buffer
NC_RO_FIFO_READ_FILL_LEVEL = 5, // return number of tensors in the read buffer
NC_RO_FIFO_WRITE_FILL_LEVEL = 6, // return number of tensors in a write buffer
NC_RO_FIFO_TENSOR_DESCRIPTOR = 7, // return the tensor descriptor of the FIFO
NC_RO_FIFO_GRAPH_TENSOR_DESCRIPTOR = 7, // return the tensor descriptor of the FIFO
NC_RO_FIFO_TENSOR_DESCRIPTOR = NC_RO_FIFO_GRAPH_TENSOR_DESCRIPTOR, // deprecated
NC_RO_FIFO_STATE = 8, // return the fifo state, returns CREATED, ALLOCATED,DESTROYED
NC_RO_FIFO_NAME = 9, // return fifo name
NC_RO_FIFO_ELEMENT_DATA_SIZE = 10, //element data size in bytes, int
NC_RW_FIFO_HOST_TENSOR_DESCRIPTOR = 11, // App's tensor descriptor, defaults to none strided channel minor
} ncFifoOption_t;


// Global
dllexport ncStatus_t ncGlobalSetOption(int option, const void *data,
unsigned int dataLength);
Expand Down
11 changes: 5 additions & 6 deletions api/include/ncCommPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ struct tensorDescriptor_t {
uint32_t w;
uint32_t h;
uint32_t totalSize;
}; //If this structure is equivalent with the API structure, it is just a coincidence. Don't make any assumptions based on this in the code.

uint32_t widthStride;
uint32_t heightStride;
uint32_t channelsStride;
};
typedef enum {
NC_GRAPH_OK,
NC_GRAPH_WRONG_INPUT_FORMAT,
Expand Down Expand Up @@ -85,7 +87,6 @@ typedef enum {
typedef enum {
BUFFER_ALLOCATE_CMD = 0,
BUFFER_DEALLOCATE_CMD = 1,

} bufferCommandType_t;

typedef struct {
Expand All @@ -94,10 +95,8 @@ typedef struct {
char streamName[16];
uint32_t buffId1;
uint32_t buffId2;
uint32_t releaseElemBuff1;
uint32_t releaseElemBuff2;
uint32_t executors_number;
uint8_t laterUse[16];
uint8_t laterUse[24];
} graphCommand_t;

typedef struct {
Expand Down
30 changes: 27 additions & 3 deletions api/include/ncPrivateTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
#ifndef _NC_PRIVATE_TYPES_H_
#define _NC_PRIVATE_TYPES_H_

#if (defined(_WIN32) || defined(_WIN64))
#include "win_pthread.h"
#else
#include <pthread.h>
#endif
#include <mvnc.h>
#include "ncCommPrivate.h"
#include "XLinkPublicDefines.h"
Expand All @@ -41,6 +45,25 @@ typedef enum {
NC_OPTION_CLASS3 = 3,
} ncOptionClass_t;

typedef enum {
NC_FIFO_HWC = 0, // row major - channel minor, for RGB image: RGB00, RGB01, RGB02,...
// all RGB pixels by row
NC_FIFO_CHW = 1, // channel major - column minor (planar), for RGB image:
// R01R02R03...G01G02G03...B01B02B03...
// all Red rows..all Green rows..all Blue rows
NC_FIFO_HCW = 2, // row major - column minor (interleaved), for RGB image:
// R00R01..R0k.., G00G01..G0k.., B00B01..B0k.., R10R11..R1k..
// 1st Red row, 1st Green row, 1st Blue Rrw, 2nd Red row..
NC_FIFO_CWH = 3, // channel major - row minor, for RGB image:
// R00R10R20... G00G10G20...B00B10B20...
// all Red columns, all Green columns, all blue columns
NC_FIFO_WCH = 4, // column major - row minor; for RGB image:
// R00R10..Rk0.., G00G10..Gk0.., B00B10..Bk0.., R01R11..Rk1..
// 1st Red col, 1st Green col, 1st blue col, 2nd Red col...
NC_FIFO_WHC = 5, // column major - channle minor, for RGB image: RGB00, RGB10, RGB20...
// all RGB pixels by col...
} ncFifoLayout_t;

struct _devicePrivate_t {
int throttle_happened;
float *thermal_stats;
Expand Down Expand Up @@ -84,21 +107,22 @@ struct _graphPrivate_t {

struct _fifoPrivate_t {
ncFifoType_t type;
ncFifoLayout_t graphLayout;
int consumer_cnt;
uint32_t id;
streamId_t streamId;
struct ncTensorDescriptor_t tensor_desc;
struct ncTensorDescriptor_t graph_tensor_desc;
struct ncTensorDescriptor_t host_tensor_desc;
struct _devicePrivate_t *dev;
struct _fifoPrivate_t *next;
char name[NC_MAX_NAME_SIZE];
struct _userParamPrivate_t *user_param_in; //used for write fifo
struct _userParamPrivate_t *user_param_out; //used for read fifo
int host_tensor_desc_set;
int write_count;
int consumed_by_graph;
int num_elements;
int api_read_element;
int api_read_adjust;
int datatype;
int consumers_remaining;
int datasize;
pthread_mutex_t fifo_mutex;
Expand Down
Loading

0 comments on commit fde1265

Please sign in to comment.