Reset nvDsAnalytics counters and nvTracker counter, Python

Please provide complete information as applicable to your setup.

**• Hardware Platform ** Jetson
• DeepStream Version 5.0.1
**• JetPack Version ** 4.4.1
• TensorRT Version 7.1
**• Issue Type ** Question
**• Requirement details ** How to reset the counters of nvAnalytics and Trackers

I am using the nvDCF tracker aswell as nvDsAnalytics plugins in Deepstream Python application

In terms of the tracker how would we be able to “reset” its counter, Like each day it would be nice for the counter to start back at 0.

The same kind of reset would be great for analytics such as line crossings and such.

I have tried to find resources about this but seem to have come up short

This we dont support on current DS release, user might need to maintain its own count in the app as of now. This can be later added as a property to reset the count in the plugin

Similar topic here Few questions on NVDSANALYTICS

Thank you,

I assume the same is true for the tracker?

As for the workaround, do we actually modify the id of the meta_data or do we just modify the display_meta Text

I would suggest to modify the meta_data

Okay I will give it a try.

Most of the examples use a pad probe on the tiler/osd , should we modify it here or add a probe to analytics or tracker Elements

You can add probe on any element based on your requirment

@bcao

I Have been experimenting with removing an object from a stream if it is within an ROI using nvdsAnalytics via a pad probe on the src pad of nvdsanalytics element using “pyds.nvds_remove_obj_meta_from_frame(frame_meta, obj)”
So far it works as expected and the object and bounding box dont appear on the OSD, but the tracker still has information about the removed object.
To access the tracker meta I use the pad on the tiler, I assume it has to do with the past frame meta.

How can I remove the tracker meta when I remove the object in my analytics callback

batch_tracker_decoded = {}
    user_meta_list = batch_meta.batch_user_meta_list
    while user_meta_list is not None:
        user_meta = pyds.NvDsUserMeta.cast(user_meta_list.data)

        if user_meta.base_meta.meta_type != pyds.NvDsMetaType.NVDS_TRACKER_PAST_FRAME_META:
            continue
        past_frame_object_batch = pyds_tracker_meta.NvDsPastFrameObjBatch_cast(user_meta.user_meta_data)
        for past_frame_object_stream in pyds_tracker_meta.NvDsPastFrameObjBatch_list(past_frame_object_batch):
            streamId = past_frame_object_stream.streamID
            print('    past_frame_object_stream:', past_frame_object_stream)
            print('      streamID:', past_frame_object_stream.streamID)
            print('      surfaceStreamID:', past_frame_object_stream.surfaceStreamID)
            for past_frame_object_list in pyds_tracker_meta.NvDsPastFrameObjStream_list(past_frame_object_stream):
                print('        past_frame_object_list:', past_frame_object_list)
                print('          numObj:', past_frame_object_list.numObj)
                print('          uniqueId:', past_frame_object_list.uniqueId)
                print('          classId:', past_frame_object_list.classId)
                print('          objLabel:', past_frame_object_list.objLabel)
                for past_frame_object in pyds_tracker_meta.NvDsPastFrameObjList_list(past_frame_object_list):
                    print('            past_frame_object:', past_frame_object)
                    print('              frameNum:', past_frame_object.frameNum)
                    print('              tBbox.left:', past_frame_object.tBbox.left)
                    print('              tBbox.width:', past_frame_object.tBbox.width)
                    print('              tBbox.top:', past_frame_object.tBbox.top)
                    print('              tBbox.right:', past_frame_object.tBbox.height)
                    print('              confidence:', past_frame_object.confidence)
                    print('              age:', past_frame_object.age)
                    
        try:
            user_meta_list = user_meta_list.next
        except StopIteration:
            break

Hey, pls create a new topic for your new issue, we would like one topic to track one issue.