https://github.com/nnstreamer/nnstreamer-example
Example applications of nnstreamer. Note that we have to enable the 'apptest" CI module in the near future.
https://github.com/nnstreamer/nnstreamer-example
android hacktoberfest nnstreamer nnstreamer-applications tizen ubuntu
Last synced: 5 days ago
JSON representation
Example applications of nnstreamer. Note that we have to enable the 'apptest" CI module in the near future.
- Host: GitHub
- URL: https://github.com/nnstreamer/nnstreamer-example
- Owner: nnstreamer
- License: lgpl-2.1
- Created: 2018-11-07T07:16:29.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2025-11-21T01:49:13.000Z (2 months ago)
- Last Synced: 2025-11-21T03:32:55.069Z (2 months ago)
- Topics: android, hacktoberfest, nnstreamer, nnstreamer-applications, tizen, ubuntu
- Language: C
- Homepage:
- Size: 135 MB
- Stars: 83
- Watchers: 10
- Forks: 74
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# NNStreamer Examples
This repository shows developers how to create their applications with nnstreamer/gstreamer. We recommend to install nnstreamer by downloading prebuilt binary packages from Launchpad/PPA (Ubuntu) or Download.Tizen.org (Tizen). If you want to build nnstreamer in your system for your example application builds, pdebuild (Ubuntu) with PPA or gbs (Tizen) are recommended for building nnstreamer. This repository has been detached from nnstreamer.git to build examples independently from the nnstreamer source code since Jan-09-2019.
Ubuntu PPA: nnstreamer/ppa [[PPA Main](https://launchpad.net/~nnstreamer/+archive/ubuntu/ppa)]
Tizen Project: devel:Tizen:6.0:AI [[OBS Project](https://build.tizen.org/project/show/devel:Tizen:6.0:AI)] [[RPM Repo](http://download.tizen.org/live/devel%3A/Tizen%3A/6.0%3A/AI/Tizen_Unified_standard/)]
We provide example nnstreamer applications:
- Traditional Linux native applications
- Linux/Ubuntu: GTK+ application
- gst-launch-1.0 based scripts
- Tizen GUI Application
- Tizen C/C++ application
- Tizen .NET (C#) application
- Tizen Web application
- Android applications
- NDK based C/C++ CLI applicaton
- JNI based GUI application
# Quick start guide for NNStreamer example
## Use PPA
* Download nnstreamer :
```
$ sudo add-apt-repository ppa:nnstreamer/ppa
$ sudo apt-get update
$ sudo apt-get install nnstreamer
$ sudo apt-get install nnstreamer-example
$ cd /usr/lib/nnstreamer/bin # binary install directory
```
*note: `nnstreamer-example` ppa was integrated into `nnstreamer` ppa.
As of 2018/10/13, we support 16.04 and 18.04
If you want to build nnstreamer example yourself, please refer to the link : [[Build example](https://github.com/nnstreamer/nnstreamer/wiki/usage-examples-screenshots#build-examples-ubuntu-1604)]
## Usage Examples
### Text classification
```
$ cd /usr/lib/nnstreamer/bin
$ ./nnstreamer_example_text_classification_tflite
```
Refer to this link for more examples : [[NNStreamer example](https://github.com/nnstreamer/nnstreamer/wiki/usage-examples-screenshots#usage-examples)]
# Example List
## Ubuntu Native
| Application | Implementations | Used gstreamer/nnstreamer feature |
| -- | -- | -- |
| [](./native/example_image_classification_tflite)
[Image Classification](./native/example_image_classification_tflite) | - [C (tflite)](./native/example_image_classification_tflite/nnstreamer_example_image_classification_tflite.c)
- [Python (tflite)](./native/example_image_classification_tflite/nnstreamer_example_image_classification_tflite.py)
- [C (ONE)](./native/example_image_classification_nnfw/nnstreamer_example_image_classification_nnfw.c)
- [C (caffe2)](./native/example_image_classification_caffe2/nnstreamer_example_image_classification_caffe2.c) | - v4l2src for input image stream
- textoverlay for showing labels |
| [](./native/example_object_detection_tensorflow_lite)
[Object Detection](./native/example_object_detection_tensorflow_lite) | - [C++ (tf)](./native/example_object_detection_tensorflow/nnstreamer_example_object_detection_tf.cc)
- [C++ (tflite)](./native/example_object_detection_tensorflow_lite/nnstreamer_example_object_detection_tflite.cc)
- [Python (tflite)](./native/example_object_detection_tensorflow_lite/nnstreamer_example_object_detection_tflite.py) | - v4l2src for input image stream
- cairooverlay for drawing boxes |
| [](./native/example_pose_estimation_tflite)
[Pose Estimation](./native/example_pose_estimation_tflite) | - [C++ (tflite)](./native/example_pose_estimation_tflite/nnstreamer_example_pose_estimation_tflite.cc)
- [Python (tflite)](./native/example_pose_estimation_tflite/nnstreamer_example_pose_estimation_tflite.py) | - v4l2src for input image stream
- cairooverlay for drawing body points |
| Image Classification with tensor_decoder | - [C++ (tflite)](./native/example_decoder_image_labelling/nnstreamer_example_decoder_image_labelling.c) | - [`tensor_decoder mode=image_labeling`](https://github.com/nnstreamer/nnstreamer/blob/main/ext/nnstreamer/tensor_decoder/tensordec-imagelabel.c) for postprocessing
| 9/P | TBD |
| Text Classification| - [C (tflite)](./native/example_text_classification/nnstreamer_example_text_classification_tflite.c) | - appsrc for input text data |
| [](./native/example_object_detection_tflite_2cam)
[Object Detection with 2 cameras](./native/example_object_detection_tflite_2cam) | - [C++ (tflite)](./native/example_object_detection_tflite_2cam/nnstreamer_example_object_detection_tflite_2cam.cc) | - v4l2src for input image stream
- cairooverlay for drawing boxes |
## With gst-launch-1.0
| Application | Implementations | Used gstreamer/nnstreamer feature |
| -- | -- | -- |
| [Object Detection](./bash_script/example_object_detection_tensorflow_lite/gst-launch-object-detection-tflite.sh) | - [tflite](./bash_script/example_object_detection_tensorflow_lite/gst-launch-object-detection-tflite.sh)
- [tf](./bash_script/example_object_detection_tensorflow/gst-launch-object-detection-tf.sh) | - v4l2src for input image stream
- [`tensor_decoder mode=bounding_boxes`](https://github.com/nnstreamer/nnstreamer/blob/main/ext/nnstreamer/tensor_decoder/tensordec-boundingbox.cc) for postprocessing
- compositor for drawing decoded boxes |
| [Image Segmentation](./bash_script/example_image_segmentation_tensorflow_lite) | - [tflite](./bash_script/example_image_segmentation_tensorflow_lite/gst-launch-image-segmentation-tflite.sh)
- [Edge TPU](./bash_script/example_image_segmentation_tensorflow_lite)
* [Edge-AI server](./bash_script/example_image_segmentation_tensorflow_lite/gst-launch-image-seg-flatbuf-edgetpu-server.sh)
* [Edge-AI client](./bash_script/example_image_segmentation_tensorflow_lite/gst-launch-image-seg-flatbuf-edgetpu-client.sh)
| - v4l2src for input image stream
- [`tensor_decoder mode=image_segment`](https://github.com/nnstreamer/nnstreamer/blob/main/ext/nnstreamer/tensor_decoder/tensordec-imagesegment.c) for postprocessing
- tcpclientsrc / tcpserversink / gdppay / gdpdepay for networking between devices
- `tensor_converter` / `tensor_decoder mode=flatbuf` for using Flatbuffers |
| [Pipeline Flow Control in Face Detection](./bash_script/example_tensorif) | - [OpenVINO + tflite + passthrough](./bash_script/example_tensorif/gst-launch-tensorif-passthrough.sh)
- [OpenVINO + tflite + tensorpick](./bash_script/example_tensorif/gst-launch-tensorif-tensorpick.sh) | - v4l2src for input image stream
- `tensor_if` for flow control |
## Tizen Applications
| Application | Implementations | Used gstreamer/nnstreamer feature |
| -- | -- | -- |
| [
](./Tizen.native/ImageClassification)
[Image Classification](./Tizen.native/ImageClassification) | - [Native App with Pipeline API](./Tizen.native/ImageClassification)
- [Native App with Single API](./Tizen.native/ImageClassification_SingleShot) | - appsrc for input image data from hardward camera
- [Machine Learning Inference Native API](https://docs.tizen.org/application/native/guides/machine-learning/machine-learning-inference/) |
| [](./Tizen.native/ObjectDetection)
[Object Detection](./Tizen.native/ObjectDetection) | - [Native App with Pipeline API](Tizen.native/ObjectDetection) | - appsrc for input image data from hardward camera
- [`tensor_decoder mode=bounding_boxes`](https://github.com/nnstreamer/nnstreamer/blob/main/ext/nnstreamer/tensor_decoder/tensordec-boundingbox.cc) for postprocessing
- [Pipeline API](https://docs.tizen.org/application/native/guides/machine-learning/machine-learning-inference/#pipeline-api) |
| [](./Tizen.NET/TextClassification)
[Text Classification](./Tizen.NET/TextClassification) | - [Native App with Pipeline API](./Tizen.native/TextClassification)
- [.NET App with C# API](./Tizen.NET/TextClassification) | - appsrc for input text data
- [Pipeline API](https://docs.tizen.org/application/native/guides/machine-learning/machine-learning-inference/#pipeline-api)
- [C# API](https://samsung.github.io/TizenFX/API8/api/Tizen.MachineLearning.Inference.html) |
| [](./Tizen.native/OrientationDetection)
[Orientation Detection](./Tizen.native/OrientationDetection) | - [Native App with Pipeline API](./Tizen.native/OrientationDetection)
- [.NET App with C# API](./Tizen.NET/OrientationDetection) | - [`tensor_src_tizensensor type=accelerometer`](https://github.com/nnstreamer/nnstreamer/blob/main/ext/nnstreamer/tensor_source/tensor_src_tizensensor.c) for hardware sensor data
- [Pipeline API](https://docs.tizen.org/application/native/guides/machine-learning/machine-learning-inference/#pipeline-api)
- [C# API](https://samsung.github.io/TizenFX/API8/api/Tizen.MachineLearning.Inference.html) |
| [](./Tizen.platform/Tizen_IoT_face_landmark)
[Face Landmark](./Tizen.platform/Tizen_IoT_face_landmark) | - [Tizen IoT App](./Tizen.platform/Tizen_IoT_face_landmark) | - v4l2src for input data from camera
- tizenwlsink for lendering video to display
- cairooverlay for drawing dots |
## Android Applications
| Application | Implementations | Used gstreamer/nnstreamer feature |
| -- | -- | -- |
| [
](./android/example_app/nnstreamer-ssd)
[Object Detection](./android/example_app/nnstreamer-ssd) | - [w/ JNI + ahc2src](./android/example_app/nnstreamer-ssd)
- [w/ JNI + amcsrc](./android/example_app/nnstreamer-media-ssd) | - [`ahc2src`](https://justinjoy9to5.blogspot.com/2017/10/gstreamer-camera-2-source-for-android.html) for hardware camera input
- [`amcsrc`](https://github.com/nnstreamer/nnstreamer/tree/main/ext/nnstreamer/android_source) for media file input |
| [
](https://play.google.com/store/apps/details?id=org.freedesktop.gstreamer.nnstreamer.multi)
[NNStreamer Multi Model
Face Detection + Hand Detection +
Object Detection + Pose Estimation](https://play.google.com/store/apps/details?id=org.freedesktop.gstreamer.nnstreamer.multi) | - [JNI App](android/example_app/nnstreamer-multi)
- [GooglePlay App](https://play.google.com/store/apps/details?id=org.freedesktop.gstreamer.nnstreamer.multi) | - [`ahc2src`](https://justinjoy9to5.blogspot.com/2017/10/gstreamer-camera-2-source-for-android.html) for hardware camera input
- [application code](./android/example_app/nnstreamer-multi/jni/nnstreamer-ex.cpp) for multiple pipeline control |
| [](./android/example_app/use-camera-with-nnstreamer-java-api)
[Sample App using NNStreamer JAVA API](./android/example_app/use-camera-with-nnstreamer-java-api) | - [JAVA w/o JNI](./android/example_app/use-camera-with-nnstreamer-java-api/src/main/java/org/nnsuite/nnstreamer/sample/MainActivity.java) | - `appsrc` for input image data from hardward camera
- `videoflip` for flipping image
- [NNStreamer JAVA API](https://github.com/nnstreamer/nnstreamer/tree/main/api/android/api/src/main/java/org/nnsuite/nnstreamer) |