|
| 1 | +# rs-dnn-vino Sample |
| 2 | + |
| 3 | +## Overview |
| 4 | +This example demonstrates OpenVINO™ toolkit integration with object detection, using |
| 5 | +basic depth information to approximate distance. |
| 6 | + |
| 7 | +<p align="center"><img src="rs-dnn-vino.jpg" alt="screenshot"/></p> |
| 8 | + |
| 9 | +The same exact neural network is used here as in the OpenCV DNN sample, for |
| 10 | +comparison. |
| 11 | + |
| 12 | + |
| 13 | +## Requirements |
| 14 | + |
| 15 | +A camera with both depth and RGB sensors is required. |
| 16 | + |
| 17 | +This sample makes use of OpenCV. You can use the OpenCV that is packaged |
| 18 | +with OpenVINO by pointing OpenCV_DIR to `${INTEL_OPENVINO_DIR}/opencv/cmake`. |
| 19 | + |
| 20 | + |
| 21 | +## Implementation |
| 22 | + |
| 23 | +We can reuse the `openvino_helpers::object_detection` code we used in the |
| 24 | +[rs-face-vino example](../face), but we now provide it with a different model |
| 25 | +aimed at object rather than face detection. You can see it now recognizes a |
| 26 | +`person` rather than each face. |
| 27 | + |
| 28 | +There is a single trained model with two Intermediate Representation files |
| 29 | +(`mobilenet-ssd.xml` and `.bin`) provided with the sample. The sample |
| 30 | +will, however, load any model present in the current directory and is able to |
| 31 | +switch between them at runtime, allowing some experimentation. |
| 32 | + |
| 33 | +> The `object_detection` class does have requirements from the model: it is |
| 34 | +> expected to have **a single input and output!!!** (bounding box, classification, |
| 35 | +> confidence, etc.), and will be rejected otherwise. |
| 36 | +
|
| 37 | +> You can see the inputs and outputs of a model listed in the .xml file. Search |
| 38 | +> for a layer with `type="Input"` to find the inputs. Similarly, the expected |
| 39 | +> output layer is of `type="DetectionOutput"`. |
| 40 | +
|
| 41 | +> Some neural networks (e.g., the version of Faster R-CNN available with |
| 42 | +> OpenVINO) have two inputs, adding an additional layer for more information. |
| 43 | +> Some effort was made to support such models. Feel free to experiment. |
| 44 | +
|
| 45 | +Each model can optionally provide a `.labels` classification file to help map |
| 46 | +the output "label" integer into a human-recognizable name such as "person", |
| 47 | +"bottle", etc. |
| 48 | +These are not provided by the OpenVINO model zoo and need to be created |
| 49 | +manually according to the classes used when training the model. |
| 50 | +See the format in `mobilenet-ssd.labels` for an example: one line per |
| 51 | +classification, starting at 0 (which is expected to be the background). |
| 52 | + |
| 53 | + |
| 54 | +## Speed |
| 55 | + |
| 56 | +The MobileNet models are intended for use on mobile devices and so their |
| 57 | +performance is high and they are suitable for use on the CPU. More advanced |
| 58 | +models can be more accurate or provide better classification but may require |
| 59 | +acceleration using a GPU or other device. |
0 commit comments