Hi guys,
here is a code snippet to allow you to change the tracked class in our basic pipelines.
In our example the default class-id is set to ‘1’ (person) according to the MS COCO dataset
To change it you can get the tracker element from the GstreamerApp pipeline and change the property before starting the app.
Here is a modified code for the basic_pipeline/detection.py “main entry point”
if __name__ == "__main__":
# Create an instance of the user app callback class
user_data = user_app_callback_class()
app = GStreamerDetectionApp(app_callback, user_data)
# get the hailo-tracker object from the pipeline
hailotracker = app.pipeline.get_by_name("hailo_tracker")
# set the tracker to track a specific class ID (according to MS COCO dataset)
# in this example, we will track the cat class (class ID 16)
hailotracker.set_property("class-id", 16)
app.run()
To see additional controls for the hailotracker you can run:
gst-inspect-1.0 hailotracker
Note that you can track “all classes” by passing ‘-1’ as class id.
Hope you’ll find it useful