GStreamer Scene Classifier

A window displaying a still of a video of a banana in a grassy field. In the upper left, a pink label identifies it as a "Banana".

These examples use the Xnor C and Python bindings with GStreamer to display a window with live-updating scene classification results. The model looks at the input image as a whole and tries to categorize the most prominent thing in the scene, which the example displays at the top of the screen. To run this example, you must have GStreamer installed and a webcam or video file available on your device.

Language

C, Python

Location

xnor-sdk-linux-x86_64/samples/c/gstreamer_live_overlay_scene_classifier.c, xnor-sdk-linux-x86_64/samples/python/gstreamer_live_overlay_scene_classifier.py

Dependencies

pycairo (Python only), pygobject (Python only), GStreamer (via system package manager), an installed Xnor classification model.

Compatible Xnor Models

All classification models

Example Usage

python3 gstreamer_live_overlay_scene_classifier.py --webcam_device /dev/video0