simaaisoftmax2d
This is a custom plugin that applies the Softmax function on a 2D vector, typically used in semantic segmentation or classification tasks. Reshape to 2D by reshaping to (data_len, num_classs) and apply softmax by reshaping back to 1D.
out_sz = data_len * num_classes * 4 (float size)
To build the plugin use:
source /opt/poky/4.0.10/environment-setup-cortexa65-poky-linux
mkdir build && cd build && cmake .. && make
Installation
Yocto SDK installed.
scp libgstsimaaisoftmax2d.so sima@<IP address of DaVinci board>:/data/my_pipeline/libs
Usage
GST_DEBUG=3 gst-launch-1.0 simaaisrc location=<input_file> delay=1000 ! simaaisoftmax2d config=config.json ! fakesink
Configuration
{
"version" : 0.1,
"node_name" : "softmax2d",
"simaai__params" : {
"params" : 3,
"cpu" : 0,
"next_cpu" : 0,
"out_sz" : 36800,
"no_of_outbuf" : 5,
"data_len" : 100,
"num_classes" : 92,
"debug" : 0,
"dump_data" : 0
}
}