Classes tracked by hailo-detect

The standalone app hailo-detect tracks just class “person”, and I understand “cellphone”. How do you configure it to track other classes. For my use case it is enough to track all classes.

I found how to configure this for HailoTracker but hailo-detect and related apps use BYTETracker instead.

Hi,

Maybe this will explain - the link points to a specific line in the code: hailo-apps/hailo_apps/python/pipeline_apps/detection/detection.py at main · hailo-ai/hailo-apps · GitHub

Thanks,

Hi,

Thanks for the quick response. The line you linked to is within the app callback and hence downstream from the tracker. I have already modified it to handle multiple classes. With a little bit more investigation, I found that the solution is to set the class_id argument to the tracker initialiser at this line: hailo-apps/blob/29acd11a8e641b2b61c3df45c95c97a775878e9f/hailo_apps/python/pipeline_apps/detection/detection_pipeline.py#L152. I changed class_id from 1 to -1 and it now does what I want.

A follow up question is whether it is possible to set class_id to a list of ids if I wanted to track more than one but not all.

Thanks

Hi @Alan_McIvor,

The class-id property of hailotracker is a single integer - it does not accept a list of IDs. The supported values are specific class ID to track only that class or -1 to track across all classes (and then filter in the callback).

Thanks,

Strangely, I get all detected objects in detection.py even if I have tracker_pipeline = TRACKER_PIPELINE(class_id=1) in detection_pipeline.py.

How do I know? I’ve added print(label) after the line label = detection.get_label() in detection.py and waved a phone for the camera. The terminal window shows me all the detected labels.

Gabor

Hi @GaborLJMU,

That’s expected behavior. The class_id parameter on the tracker only controls which detections get tracking IDs assigned - it doesn’t filter out other detections from the pipeline. The detection model still outputs all classes it finds. If you print label for every detection, you’ll see them all. However, only detections matching the tracker’s class_id will have a valid track_id.

If you want to process only specific classes, filter them in the callback e.g.,if label == "person"

Thanks,