R2Inference/Examples/TensorFlow-Lite: Difference between revisions

From RidgeRun Developer Wiki
No edit summary
mNo edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
{{R2Inference/Head|previous=Examples/TensorFlow|next=Model Zoo|keywords=tflite examples, tflite Inception v2 model}}
{{R2Inference/Head|previous=Examples/TensorFlow|next=Examples/TensorRT|metakeywords=tflite examples, tflite Inception v2 model}}
</noinclude>
</noinclude>
{{DISPLAYTITLE:R2Inference - TensorFlow-Lite Examples|noerror}}
{{DISPLAYTITLE:R2Inference - TensorFlow-Lite Examples|noerror}}


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]].
__TOC__


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


To test the Tensorflow-Lite example you will need a Tensorflow-Lite C++ API compatible graph file. You can obtain the model from the [[R2Inference/Model Zoo|Model Zoo]].
To test the Tensorflow-Lite example you will need a Tensorflow-Lite C++ API compatible graph file. You can obtain the model from the [[R2Inference/Model Zoo|Model Zoo]].


= Inception v2 =
== Inception v2 ==


This example is located in <code> r2inference/examples/r2i/tflite </code>.
This example is located in <code> r2inference/examples/r2i/tflite </code>.
Line 18: Line 20:
</syntaxhighlight>
</syntaxhighlight>


For example evaluating this image:
For example, evaluating this image:


[[File:Plane example input.jpg|1800px|center|thumb|Inception example input]]
[[File:Plane example input.jpg|1800px|center|thumb|Inception example input]]
Line 39: Line 41:
According to the [https://gist.github.com/yrevar/942d3a0ac09ec9e5eb3a ImageNet labels] 405 corresponds to an 'airship'.
According to the [https://gist.github.com/yrevar/942d3a0ac09ec9e5eb3a ImageNet labels] 405 corresponds to an 'airship'.
<noinclude>
<noinclude>
{{R2Inference/Foot|Examples/TensorFlow|Model Zoo}}
{{R2Inference/Foot|Examples/TensorFlow|Examples/TensorRT}}
</noinclude>
</noinclude>

Latest revision as of 18:27, 7 March 2023




Previous: Examples/TensorFlow Index Next: Examples/TensorRT




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-Lite example you will need a Tensorflow-Lite C++ API compatible graph file. You can obtain the model from the Model Zoo.

Inception v2

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

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

For example, evaluating this image:

Inception example input

Should produce the following output:

./inception -i Plane_example_input.jpg -m graph_inceptionv2.tflite -s 224
Loading Model: graph_inceptionv2.tflite
Setting model to engine
Loading image: Plane_example_input.jpg
Configuring frame
Starting engine
Predicting...
Highest probability is label 405 (0.704471)
Stopping engine

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



Previous: Examples/TensorFlow Index Next: Examples/TensorRT