NVIDIA-AI-IOT / deepstream-occupancy-analytics

This is a sample application for counting people entering/leaving in a building using NVIDIA Deepstream SDK, Transfer Learning Toolkit (TLT), and pre-trained models. This application can be used to build real-time occupancy analytics applications for smart buildings, hospitals, retail, etc. The application is based on deepstream-test5 sample application.
MIT License
220 stars 73 forks source link

How to implement traffic flow statistical analysis. #46

Open lwzhaojun opened 2 years ago

lwzhaojun commented 2 years ago

I see that you have adapted it from deepstream-test5-app to implement the function of people flow statistics. Can you realize the statistics of traffic flow? Where to modify it?

monjha commented 2 years ago

Hi Lwzhaojun,

Yes, you can update the class-ids in analytics configuration.https://github.com/NVIDIA-AI-IOT/deepstream-occupancy-analytics/blob/b3430e70e11407bba1e22f4b20de3a2976e8229d/config/config_nvdsanalytics.txt#L72

lwzhaojun commented 2 years ago

Thank you for your answer. For example, when I use peoplenet, I set class-id=2, which means the class is face. But the detection box about the face is not displayed and there is no count, I tried to increase the display-bbox=1 in the osd in the config file, it doesn't work either. image How should I display the detection box about the face and count it.

lwzhaojun commented 2 years ago

I seem to know. There are only cars and persons in your program, so my model peoplenet has no car, so there is no detection box for car. So if I change the model to dashcamnet, firstly the detection boxes about car and persons will be displayed, and secondly update the class-ids=1 in analytics configuration, it should be able to count the car flow. But if you update the class-ids=-1 in analytics configuration, you should not be able to count the flow of cars and people. Is my thinking correct? image

lwzhaojun commented 2 years ago

I changed the model to dashcamnet, the detection boxes about cars and persons will be displayed, and the statistical count of car flow is realized, but the flow of cars and people cannot be counted at the same time. How should I modify it? Is an array added to this function (analytics_custom_parse_nvdsanalytics_meta_data (NvDsMetaList l_user, AnalyticsUserMeta data)) to store the flow of the corresponding class? image

monjha commented 2 years ago

Hi,

You can access the class-id and its respective analytics data.