Preserving tracker object_id between two primary detectors

I have the following pipeline:
head detector (pgie) - tracker (DCF) - face detector (pgie) - tee
– queue - age classifier (sgie)
– queue - gender classifier (sgie)
– queue - face angle/pose estimator (custom)

I am trying to get the age/gender classifiers to run with ‘classifier-async-mode’. However, object_id assigned by the tracker is not available after the face detector is done. Is there a way to push the object_id further down the pipeline? The reason behind this approach is that I would like to still track a person head to measure “stay time”, but also gather additional detection info if the face was available, so object_id has the same purpose. I would like to avoid adding another tracker after the face detector, if possible.

Host: 1080 Ti, Target: Jetson Nano/NX
OS: Ubuntu 18.04
DS: 5.0
JetPack: 4.4
TRT: 7.1
Host Driver: 440

I’m considering that the face detector in PGIE configuration is not the best approach in this case. Perhaps a face/no-face classifier would be more appropriate. This would allow me to continue tracking a head detection, and if the face classifier was positive, continue with age/gender pipeline, otherwise continue tracking the head normally. Any suggestions would be much appreciated.

Did your Face detector work on Secondary mode?

Hi bcao,

I’m using the facedetectir model from the TLT repos temporarily. After the head detector finishes, the face detector in SGIE mode doesn’t do a very good job and ends up detecting multiple bounding boxes inside the head detection. Which is fair enough, as it wasn’t really meant for this task.

I now have a gst probe at the face detector src sink, where I simply try to match bounding boxes of heads and faces, if the IOU is above a certain threshold, I take the head NvDsObjectMeta and set it as NvDsObjectMeta->parent of the face. A bit of a rough solution though. This still doesn’t let me use classifier-async-mode.

Setting face_meta->object_id = head_meta->object_id unfortunately doesn’t help either.

So the issue only exist when enable classifier-async-mode, right?
The issue is “object_id assigned by the tracker is not available after the face detector is done.”?

I have two back-to-back detectors (head then face), and I would like to track the head, while giving the same head->object_id to the detected face, if any faces were found. So yes, your description is on point! I guess the classifier-async-mode is not really the problem.

Even if I run the face detector as a SGIE, it still does not retain the object_id obtained from the head tracking.

My use case is also simple, head tracking to determine presence/duration. If the person happened to face the camera during tracking, gather extra data and associate it with the same tracked “head”, so to speak.

The object-id will not be propagated to the objects detected by secondary detector. A few solutions would be

  • Add tracker after facedetector, so that tracker will also track the face, but this will mean increase in processing by tracker

  • Another would be what the user tried/wants to try. Use facedetect as an Secondary detector, and copy the object-id from head object to face object in the buffer probe.

  • Yet another would be using a face/no-face classifier instead of a detector but then the Age/Gender/Pose SGIEs will not be able to filter on the face/no-face label. The SGIEs can infer on all the heads, or the user can modify the nvinfer code

  • face_meta->object_id = head_meta->object_id should have worked. If it hasn’t user might have to configure the operate-on-gie-id and operate-on-class-ids property of SGIEs properly

Thank you for your suggestions! I will try using an additional tracker directly on Jetson to see if it will have a big performance impact. Otherwise I’ll probably take your suggestion and just copy object_id from head detection to face.