R2Inference - TensorFlow Examples

From RidgeRun Developer Connection
Jump to: navigation, search



Previous: Examples Index Next: Examples/TensorFlow-Lite




R2Inference provides several examples to highlight its usage with different architectures and frameworks. The models used for these examples can be downloaded from our Model Zoo.

Preparation

To test the Tensorflow example you will need a Tensorflow C++ API compatible graph file. You can obtain the model from the Model Zoo.

Inception v2

This example is located in r2inference/examples/r2i/tensorflow . To use this example run:

./inception -i [JPG input Image] -m [Tflite Model] -s [Model Input Size] -I input -O Softmax

For example, evaluating this image:

Error creating thumbnail: Unable to save thumbnail to destination
Inception example input

Should produce the following output:

./inception -i Plane_example_input.jpg -m graph_inceptionv2_tensorflow.pb -s 224 -I input -O Softmax
Loading Model: graph_inceptionv2_tensorflow.pb
Setting model to engine
Configuring input and output layers
Loading image: Plane_example_input.jpg
Configuring frame
Starting engine
Predicting...
Highest probability is label 405 (0.702023)
Stopping engine

According to the ImageNet labels, 405 corresponds to an 'airship'.




Previous: Examples Index Next: Examples/TensorFlow-Lite