ssdmobilenettensordec

Tensor decoder element for SSD MobileNet object detection models. The model's own post-processing produces the detection count, boxes, scores and (optionally) classes, so this element only filters them by score and size and attaches the result as object detection metadata.

Test image file, model file and labels file can be found here : https://gitlab.collabora.com/gstreamer/onnx-models

 gst-launch-1.0 multifilesrc location=onnx-models/images/bus.jpg \
  ! jpegdec ! videoconvertscale \
  ! onnxinference execution-provider=cpu model-file=onnx-models/models/ssd_mobilenet_v1_coco.onnx \
  ! ssdmobilenettensordec label-file=onnx-models/labels/COCO_classes.txt \
  ! objectdetectionoverlay ! videoconvert ! autovideosink

This takes a JPEG, performs object detection via onnxinference on it, decodes the inferred tensors with ssdmobilenettensordec and then overlays the detected objects on the frame via objectdetectionoverlay.

Hierarchy

GObject
    ╰──GInitiallyUnowned
        ╰──GstObject
            ╰──GstElement
                ╰──GstBaseTransform
                    ╰──ssdmobilenettensordec

Factory details

Authors: – Jeremy Whiting

Classification: – Tensordecoder/Video

Rank – primary

Plugin – rsanalytics

Package – gst-plugin-analytics

Pad Templates

sink

video/x-raw(ANY):
        tensors: "tensorgroups\,\ ssd-mobilenet-v1-variant-1-out\=\(/uniquelist\)\{\ \(caps\)\"tensor/strided\\\,\\\ tensor-id\\\=\\\(string\\\)generic-variant-1-out-count\\\,\\\ dims\\\=\\\(int\\\)\\\<\\\ \\\[\\\ 0\\\,\\\ 1\\\ \\\]\\\ \\\>\\\,\\\ dims-order\\\=\\\(string\\\)row-major\\\,\\\ type\\\=\\\(string\\\)\\\{\\\ float32\\\,\\\ uint32\\\ \\\}\"\,\ \(caps\)\"tensor/strided\\\,\\\ tensor-id\\\=\\\(string\\\)ssd-mobilenet-v1-variant-1-out-scores\\\,\\\ dims\\\=\\\(int\\\)\\\<\\\ \\\[\\\ 0\\\,\\\ 1\\\ \\\]\\\,\\\ \\\[\\\ 0\\\,\\\ 2147483647\\\ \\\]\\\ \\\>\\\,\\\ dims-order\\\=\\\(string\\\)row-major\\\,\\\ type\\\=\\\(string\\\)\\\{\\\ float32\\\,\\\ uint32\\\ \\\}\"\,\ \(caps\)\"tensor/strided\\\,\\\ tensor-id\\\=\\\(string\\\)ssd-mobilenet-v1-variant-1-out-boxes\\\,\\\ dims\\\=\\\(int\\\)\\\<\\\ \\\[\\\ 0\\\,\\\ 1\\\ \\\]\\\,\\\ \\\[\\\ 0\\\,\\\ 2147483647\\\ \\\]\\\,\\\ 4\\\ \\\>\\\,\\\ dims-order\\\=\\\(string\\\)row-major\\\,\\\ type\\\=\\\(string\\\)\\\{\\\ float32\\\,\\\ uint32\\\ \\\}\"\,\ \(caps\)\"tensor/strided\\\,\\\ tensor-id\\\=\\\(string\\\)ssd-mobilenet-v1-variant-1-out-classes\\\,\\\ dims\\\=\\\(int\\\)\\\<\\\ \\\[\\\ 0\\\,\\\ 1\\\ \\\]\\\,\\\ \\\[\\\ 0\\\,\\\ 2147483647\\\ \\\]\\\ \\\>\\\,\\\ dims-order\\\=\\\(string\\\)row-major\\\,\\\ type\\\=\\\(string\\\)\\\{\\\ float32\\\,\\\ uint32\\\ \\\}\"\ \}\;"

Presence – always

Direction – sink

Object type – GstPad


src

video/x-raw(ANY):

Presence – always

Direction – src

Object type – GstPad


Properties

label-file

“label-file” gchararray

Label file

Flags : Read / Write

Default value : NULL


score-threshold

“score-threshold” gfloat

Threshold for deciding when to remove boxes based on score

Flags : Read / Write

Default value : 0.3


size-threshold

“size-threshold” gfloat

Threshold for deciding when to remove boxes based on proportion of the image

Flags : Read / Write

Default value : 0.9


The results of the search are