This sample demonstrates gvapython element and ability to customize pipeline with application provided Python script for pre- or post-processing of inference operations. It typically used for interpretation of inference results and various application logic, especially if required in the middle of GStreamer pipeline.
In this sample the
gvapython element is used three times.
First time it's inserted after
gvainference element running object detection. This demonstrates custom conversion of model output into list of bounding boxes. See file
ssd_object_detection.py with conversion function coded in Python.
Second time it's inserted after
gvainference element running object classification. This demonstrates custom conversion of model output into object attributes (age and gender in this example). See file
age_gender_classification.py with conversion function coded in Python.
Third time it's inserted after previous
gvapython to log ages into file. This demonstrates resource management in Python script. It opens log file in class constructor and closes it in destructor. Constructor will be called during pipeline initialization and destructor will be called on pipeline stop. See file
age_logger.py. This is just an example of how to work with resources in Python script, for better logging please refer to Metadata Publishing Sample
The sample uses by default the following pre-trained models from OpenVINO™ Toolkit Open Model Zoo
NOTE: Before running samples (including this one), run script
download_models.shonce (the script located in
samplestop folder) to download all models required for this and other samples.
If Python requirements are not installed yet:
The sample takes three command-line optional parameters:
rtsp://) or other streaming source (ex URL starting with
http://) If parameter is not specified, the sample by default streams video example from HTTPS link (utilizing
urisourcebinelement) so requires internet conection.