Object ID comeback to zero too many times

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) 1080Ti, RTX 3060
• DeepStream Version 6.0.0
• JetPack Version (valid for Jetson only)
• TensorRT Version 8.2.0.6
• NVIDIA GPU Driver Version (valid for GPU only) 470.82.01
• Issue Type( questions, new requirements, bugs)
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

I need to count tracked person in a face recognition project. I want to count them by check “Object_id” from obj_meta, but it come backs to zeros too many times and causes to underestimate detected objects counted by obj_meta->object_id . Bellow is a sample output of tracked persons and their object_id. The first number is object_id and second one is number of frames that person is viewed.

 Visibility for person# 2= 71
 Visibility for person# 3= 10
 Visibility for person# 4= 3
 Visibility for person# 0= 33 
 Visibility for person# 5= 49  
 Visibility for person# 6= 42
 Visibility for person# 0= 6
 Visibility for person# 7= 67
 Visibility for person# 8= 58
 Visibility for person# 0= 4
 Visibility for person# 9= 212
 Visibility for person# 10= 91
 Visibility for person# 0= 8
 Visibility for person# 0= 3
 Visibility for person# 12= 68
 Visibility for person# 0= 2
 Visibility for person# 13= 63
 Visibility for person# 14= 77
 Visibility for person# 15= 305
 Visibility for person# 16= 97
 Visibility for person# 17= 14
 Visibility for person# 0= 15
 Visibility for person# 18= 81
 Visibility for person# 0= 4
 Visibility for person# 19= 94
 Visibility for person# 20= 9
 Visibility for person# 0= 8
 Visibility for person# 21= 85
 Visibility for person# 0= 4
 Visibility for person# 22= 92
 Visibility for person# 23= 12
 Visibility for person# 24= 77
 Visibility for person# 0= 8
 Visibility for person# 25= 72
 Visibility for person# 0= 4
 Visibility for person# 26= 67
 Visibility for person# 27= 1
 Visibility for person# 0= 9
 Visibility for person# 29= 163
 Visibility for person# 30= 34
 Visibility for person# 32= 105
 Visibility for person# 34= 38
 Visibility for person# 0= 24
 Visibility for person# 35= 113
 Visibility for person# 36= 102
 Visibility for person# 37= 60
 Visibility for person# 38= 89
 Visibility for person# 0= 8
 Visibility for person# 39= 263
 Visibility for person# 0= 3
 Visibility for person# 40= 91
 Visibility for person# 0= 4
 Visibility for person# 41= 81
 Visibility for person# 42= 4
 Visibility for person# 44= 86
 Visibility for person# 49= 6
 Visibility for person# 50= 46
 Visibility for person# 47= 59
 Visibility for person# 0= 44
 Visibility for person# 52= 41
 Visibility for person# 53= 17
 Visibility for person# 46= 9
 Visibility for person# 51= 82
 Visibility for person# 54= 23
 Visibility for person# 55= 70
 Visibility for person# 0= 3
 Visibility for person# 56= 72
 Visibility for person# 58= 3
 Visibility for person# 0= 11
 Visibility for person# 57= 83
 Visibility for person# 59= 100
 Visibility for person# 0= 1
 Visibility for person# 60= 41
 Visibility for person# 61= 14
 Visibility for person# 62= 77
 Visibility for person# 0= 16
 Visibility for person# 63= 82
 Visibility for person# 64= 69
 Visibility for person# 0= 6
 Visibility for person# 65= 141
 Visibility for person# 0= 7
 Visibility for person# 66= 94
 Visibility for person# 0= 4
 Visibility for person# 68= 102
 Visibility for person# 0= 4
 Visibility for person# 69= 77
 Visibility for person# 70= 10
 Visibility for person# 0= 7
 Visibility for person# 71= 112
 Visibility for person# 72= 63
 Visibility for person# 73= 59
 Visibility for person# 0= 19
 Visibility for person# 74= 97
 Visibility for person# 75= 70
 Visibility for person# 76= 86
 Visibility for person# 77= 58
 Visibility for person# 78= 2
 Visibility for person# 79= 62
 Visibility for person# 80= 11
 Visibility for person# 0= 31
 Visibility for person# 81= 91
 Visibility for person# 82= 8
 Visibility for person# 0= 8
 Visibility for person# 83= 107
 Visibility for person# 85= 110
 Visibility for person# 86= 91
 Visibility for person# 87= 73
 Visibility for person# 0= 12
 Visibility for person# 0= 4
 Visibility for person# 89= 74
 Visibility for person# 90= 6
 Visibility for person# 91= 69
 Visibility for person# 0= 4
 Visibility for person# 92= 106
 Visibility for person# 0= 3
 Visibility for person# 93= 141
 Visibility for person# 94= 4
 Visibility for person# 0= 7
 Visibility for person# 95= 162
 Visibility for person# 96= 169
 Visibility for person# 97= 68
 Visibility for person# 0= 5
 Visibility for person# 98= 70
 Visibility for person# 99= 7
 Visibility for person# 0= 8
 Visibility for person# 100= 64
 Visibility for person# 101= 82
 Visibility for person# 0= 1
 Visibility for person# 102= 78

How could I count them? Should I ignore zero object_id ? What happened when I want to do that on multiple streams? Because I’d like to count persons in each camera separately.

Thanks in advance

Can you use nvdsanalytics for counting?

Gst-nvdsanalytics — DeepStream 6.1.1 Release documentation (nvidia.com)

It seems to be a good offer, but what is happened here and why I have these zero object_ids?

Are you sure the first person with ID 0 is different than the next person with ID 0? Please verify that with visual outputs.

How do you count the number of frames? If you counted only the consecutive appearances over contiguous frames, it would not be a right way to do that. Please refer to “Shadow Tracking” in tracker documentation.

Also, have you enabled past-frame data? If not, the tracker outputs may not be contiguous.

This is shadow setting in config_tracker_NvDCF_accuracy.yml file:

  maxTargetsPerStream: 150  # Max number of targets to track per stream. Recommended to set >10. Note: this value should account for the targets being tracked in shadow mode as well. Max value depends on the GPU memory capacity  

  # [Creation & Termination Policy]
  minIouDiff4NewTarget: 0.5   # If the IOU between the newly detected object and any of the existing targets is higher than this threshold, this newly detected object will be discarded.
  minTrackerConfidence: 0.2   # If the confidence of an object tracker is lower than this on the fly, then it will be tracked in shadow mode. Valid Range: [0.0, 1.0]
  probationAge: 3 # If the target's age exceeds this, the target will be considered to be valid.
  maxShadowTrackingAge: 150   # Max length of shadow tracking. If the shadowTrackingAge exceeds this limit, the tracker will be terminated.
  earlyTerminationAge: 1      # If the shadowTrackingAge reaches this threshold while in TENTATIVE period, the target will be terminated prematurely.

As may you know, object_id started at 0 but I checked obj_meta->object_id in gst_dsexample_transform_ip and it happened multiple times - 439 times - even in a short video. For the first time that’s ok but not for the next ones. I could bring some saved images or log that shows 0 obj_meta->object_id in the middle or last of the video.

But object_id does not continue from 0 again, I think it’s a temporary id and then it will be changed to its correct value. But it’s confusing and may create some challenges.

Can you share your test video? And the output video after nvdsods?

Sure. How could I save output video?

If you use deepstream-app, you can save the output video by modify the configure file.

DeepStream Reference Application - deepstream-app — DeepStream 6.1.1 Release documentation (nvidia.com)

Unfortunately I don’t use deepstream-app.

Can you reproduce it with deepstream-app?