This project utilizes NVIDIA's DeepStream SDK to track the trajectory of people in a CCTV feed. The application processes video streams, detects objects, and visualizes their paths in real-time. It can be particularly useful for analyzing foot traffic in retail environments or monitoring public spaces.
The application draws the trajectory paths of people walking through a defined region of interest (ROI). It can help identify areas with high demand, such as locations near advertisement hoardings or popular sections in a store.
- Retail Analysis: Understand customer movement patterns and optimize store layouts.
- Security Monitoring: Track individuals in sensitive areas for enhanced security.
- Traffic Management: Analyze pedestrian traffic in public spaces.
- Python 3.x
- GStreamer
- NVIDIA DeepStream SDK
- Required Python packages (e.g.,
gi
,pyds
,argparse
,configparser
)
-
Clone the repository:
git clone <repository-url> cd Deepstream_people_trajectory_CCTV
-
Install the required dependencies:
pip install -r requirements.txt
-
Ensure you have the NVIDIA DeepStream SDK installed and configured on your system.
The application requires configuration files for the primary and secondary inference engines, as well as the tracker. These files should be placed in the project directory:
dstest2_pgie_config.txt
: Configuration for the primary inference engine.dstest2_tracker_config.txt
: Configuration for the tracker.
The models used in this project can be found in the model
folder. Ensure that the model files are compatible with the DeepStream SDK and are properly configured in the respective configuration files.
To run the application, use the following command:
python trajectory.py -i <input_stream>
Replace <input_stream>
with the path to your input H264 elementary stream or RTSP URL. You can specify multiple input streams by separating them with spaces.
-i
,--input
: Path to input H264 elementary stream (required).-g
,--gie
: Choose GPU inference engine type (nvinfer
ornvinferserver
, default isnvinfer
).-c
,--codec
: RTSP Streaming Codec (H264
orH265
, default isH264
).-b
,--bitrate
: Set the encoding bitrate (default is4000000
).--rtsp-ts
: Attach NTP timestamp from RTSP source (optional).
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
- NVIDIA for the DeepStream SDK.
- The open-source community for various libraries and tools used in this project.