Skip to content

[FEA] nvtracker: keep the ID of a target that leaves the frame and comes back, by Re-ID match #147

Todo

Description

@sergeykad

Is your feature request related to a problem? Please describe.

We count distinct people, usually fewer than 5 per video, in recorded video files with nvinfer and an NvDCF tracker (DeepStream 9.2, x86, dGPU). A person who walks out of the picture and comes back gets a new tracking ID, so one person is counted twice. The docs state this limit: "If an object moves out of frame or gets occluded beyond maxShadowTrackingAge, it will be assigned a new ID even if it returns into the frame." A larger maxShadowTrackingAge does not help: a target whose box leaves the frame ends at once at every value we tried (up to 250), and the larger values slow the tracker and give more ID switches.

Describe the solution you'd like

An option in the tracker to give a new target the ID of an ended target of the same stream and class when their Re-ID features match, within a configurable time window (for example several minutes) and similarity threshold. Ended targets would keep their gallery features for that window. A stream reset (GST_NVEVENT_STREAM_RESET) would clear them.

Describe alternatives you've considered

Post-processing, as your staff suggested on the forum ("If this is a required feature, we can plan adding that support"). We read the per-object Re-ID vectors (outputReidTensor: 1) and join tracks offline by the cosine similarity of each track's mean vector. On our test clips this gave the right count with no wrong join, but the window between the highest score of two different people (0.60) and the lowest score of one returning person (0.64) is small. The tracker itself would do better: it knows which features came from clean, unoccluded views (minVisibility4GalleryUpdate) and which targets were ID switches, and the result would be the ID on the object, ready for downstream elements such as a secondary nvinfer.

Additional context

x86_64, dGPU, DeepStream 9.2, config_tracker_NvDCF_accuracy.yml with ReID models resnet50_market1501.etlt and resnet50_market1501_aicity156.onnx.

Activity

  1. kevinsongbing commented on Nov 25, 2026

    @kevinsongbing
    Collaborator

    Thanks for the detailed report and for sharing your Re-ID similarity scores. DeepStream 9.2 doesn’t have a setting to restore a terminated NvDCF track’s ID based on appearance alone. maxShadowTrackingAge controls how long a track can remain in shadow tracking; increasing it doesn’t allow an already-terminated track to recover its ID.

    For offline counting, stitching track segments using the embeddings from outputReidTensor: 1 is a reasonable workaround. Given the narrow gap you measured (0.60 for different people vs. 0.64 for returning people), we’d recommend validating the threshold on additional clips and leaving ambiguous matches unmerged. That workaround won’t preserve the ID seen by downstream nvinfer, so we’ll keep the feature request open.

    If you can share a short, non-sensitive clip that reproduces the exit and return, along with your tracker YAML, that would give us a concrete case to evaluate.

  2. sergeykad commented on Nov 25, 2026

    @sergeykad
    Author

    Thank you. A correction to our numbers: the 0.60 and 0.64 came from constructed clips, where a returning person is the same pixels mirrored. On real returns in the public CAVIAR corridor set (https://homepages.inf.ed.ac.uk/rbf/CAVIARDATA1/, 384x288, people 12 to 80 px wide) the scores of one returning person and of two different people overlapped with NvDCF accuracy and the stock Re-ID model, so no threshold separated them. That footage has a much lower resolution than ours, so it is a hard case. This work is postponed on our side for now; we will share a clip when we come back to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions