R2Inference/Examples/NCSDK: Difference between revisions
No edit summary |
mNo edit summary |
||
Line 3: | Line 3: | ||
</noinclude> | </noinclude> | ||
{{DISPLAYTITLE:R2Inference - NCSDK Examples|noerror}} | {{DISPLAYTITLE:R2Inference - NCSDK Examples|noerror}} | ||
__TOC__ | |||
R2Inference provide several examples to highlight its usage with different architectures and frameworks. The models used for this examples can be downloaded from our [[R2Inference/Model Zoo|Model Zoo]]. | R2Inference provide several examples to highlight its usage with different architectures and frameworks. The models used for this examples can be downloaded from our [[R2Inference/Model Zoo|Model Zoo]]. | ||
= Preparation = | == Preparation == | ||
To test the NCSDK examples you will need a NCSDK C API compatible graph file. You can generate it from caffe or tensorflow model files with the mvNCCompile tool. | To test the NCSDK examples you will need a NCSDK C API compatible graph file. You can generate it from caffe or tensorflow model files with the mvNCCompile tool. | ||
Line 15: | Line 17: | ||
This command will output the '''graph''' and '''output_expected.npy''' files. We will use the graph file for the examples and ignore the other one. This model can also be downloaded from our [[R2Inference/Model Zoo|Model Zoo]]. | This command will output the '''graph''' and '''output_expected.npy''' files. We will use the graph file for the examples and ignore the other one. This model can also be downloaded from our [[R2Inference/Model Zoo|Model Zoo]]. | ||
= Inception v2 = | == Inception v2 == | ||
This example is located in <code> r2inference/examples/r2i/ncsdk </code>. | This example is located in <code> r2inference/examples/r2i/ncsdk </code>. | ||
Line 43: | Line 45: | ||
According to the [https://gist.github.com/yrevar/942d3a0ac09ec9e5eb3a ImageNet labels] 404 corresponds to an 'airliner'. | According to the [https://gist.github.com/yrevar/942d3a0ac09ec9e5eb3a ImageNet labels] 404 corresponds to an 'airliner'. | ||
= TinyYOLO v2 = | == TinyYOLO v2 == | ||
This example is located in <code> r2inference/examples/r2i/ncsdk </code>. | This example is located in <code> r2inference/examples/r2i/ncsdk </code>. |
Revision as of 20:56, 16 March 2020
Make sure you also check R2Inference's companion project: GstInference |
R2Inference |
---|
Introduction |
Getting started |
Supported backends |
Examples |
Model Zoo |
Contact Us |
|
R2Inference provide several examples to highlight its usage with different architectures and frameworks. The models used for this examples can be downloaded from our Model Zoo.
Preparation
To test the NCSDK examples you will need a NCSDK C API compatible graph file. You can generate it from caffe or tensorflow model files with the mvNCCompile tool. For example, given a caffe model (googlenet.caffemodel) and a network description (deploy.prototxt):
mvNCCompile -w bvlc_googlenet.caffemodel -s 12 deploy.prototxt
This command will output the graph and output_expected.npy files. We will use the graph file for the examples and ignore the other one. This model can also be downloaded from our Model Zoo.
Inception v2
This example is located in r2inference/examples/r2i/ncsdk
.
To use this example run:
./googlenet -i [JPG input_image] -m [GoogLeNet Inception v2 Model]
For example evaluating this image:
Should produce the following output:
./googlenet -i plane.jpg -m graph_googlenet Loading Model: graph_googlenet... Setting model to engine... Loading image: plane.jpg... Configuring frame... Starting engine... Predicting... Highest probability is label 404 (0.823242) Stopping engine...
According to the ImageNet labels 404 corresponds to an 'airliner'.
TinyYOLO v2
This example is located in r2inference/examples/r2i/ncsdk
.
To use this example run:
./tinyyolo -i [JPG input_image] -m [TinyYOLO v2 Model]
For example evaluating this image:
Should produce the following output:
./tinyyolo -i yolo.jpg -m graph_yolo Loading Model: graph_yolo... Setting model to engine... Loading image: yolo.jpg... Configuring frame... Starting engine... Predicting... Box:[class:'dog', x_center:205.714, y_center:372.857, width:199.956, height:293.533, prob:0.141857] Box:[class:'bicycle', x_center:369.964, y_center:283.239, width:522.349, height:373.425, prob:0.454611] Box:[class:'car', x_center:525.696, y_center:123.167, width:163.172, height:50.8492, prob:0.489166] Stopping engine...
Drawing the boxes over the original image we get: