# NNStreamer
-Neural Network Streamer for AI Projects. http://suprem.sec.samsung.net/confluence/display/SRAMLABC/NN+Streamer
+
+Neural Network Streamer for AI Projects.
+http://suprem.sec.samsung.net/confluence/display/STAR/NN+Streamer
## Objectives
- other/tensor
+findtype specifics: TBD
+
### Gstreamer Elements (Plugins)
- tensor\_converter
- Known Issues
- If video width is not divisible by 4, it is supposed to do zero-padding, which is not working (Found 2018-05-17, #7)
- Audio
- - TBD
+ - Planned
- Text
- - TBD
-- tensor\_transformer
+ - Planned
- tensor\_filter
+ - Main
+ - Work in Progress
+ - Tensorflow-Lite
+ - Skeleton only
+ - Custom
+ - Concept only
+ - Other NNFW TBD
- tensor\_sink
+ - Planned
+- tensor\_transformer
+ - Planned
- tensor\_merge
+ - Planned
## How to Build
### Linux Self-Hosted Build
-In each plugin source directory,
+At the git repo root directory,
```
$ mkdir -p build # We recommend to build in a "build" directory
$ cd build
$ rm -Rf * # Ensure the build directory is empty
$ cmake ..
$ make
+$ cd ..
```
-You may copy the resulting plugin (.so file) to gstreamer plugin repository.
+You may copy the resulting plugin (.so file) to gstreamer plugin repository. Or do
+```
+$ cd build
+$ sudo make install
+```
+if installing NNstreamer plugin libraries into ```%{_libdir}```.
### Tizen
-Not-Yet-Implemented Feature
-Tizen is going to be the first official target along with Ubuntu.
```
$ gbs build
```
+```gbs build``` will execute unit testing as well unlike cmake build.
## How to Test
-Use the built library as a general gstreamer plugin.
+- Use the built library as a general gstreamer plugin.
+
+- Unit Test
+
+For common library unit test
+```
+$ cd build
+$ ./unittest_common
+```
+
+For tensor_converter golden test
+```
+$ cd tensor_convert/test
+$ ./runTest.sh
+```
## Usage Examples
-# NNStreamer::convert2tensor
+# NNStreamer::tensor\_converter
-TODO Version 0.0.1
-Direct conversion of video/x-raw 1view / non-interace(progressive) stream to [height][width-stride-4][RGB] tensor.
-The main objective of this version is to draft standard tensor format for Gstreamer.
+## Supported features
-TODO Version 0.0.2
-Support basic dimension reform (order of dimsisions, color space changes)
+- Direct conversion of video/x-raw / non-interace(progressive) / RGB or BGRx stream to [height][width][RGB/BGRx] tensor.
+- Golden test for such inputs
-TODO Version 0.0.3
-Support dimension reshape (width/height)
-
-TODO Version 0.0.4
-Support color space conversions
-
-TODO Version 0.1.0
-Direct conversion of general audio stream to FORMAT-TO-BE-DETERMINED
+## Planned features
+From higher priority
+- Support other color spaces (IUV, BGGR, ...)
+- Support audio stream
+- Support text stream
# Gstreamer standard tensor media type draft
- Proposed Name: other/tensor
- Properties
- - rank: int (0: scalar, 1: vector, 2: matrix, 3: 3-tensor, ...)
+ - rank: int (1: vector, 2: matrix, 3: 3-tensor, 4: 4-tensor
- dim1: int (depth / color-RGB)
- dim2: int (width)
- dim3: int (height) / With version 0.0.1, this is with rstride-4.
- dim4: int (batch. 1 for image stream)
- type: string: int32, uint32, float32, float64, int16, uint16, int8, uint8
- - framerate; fraction (TODO: to redefine the range)
+ - framerate; fraction
- data: (binary data, can be treated as an C array of [dim4][dim3][dim2][dim1])