This projects uses RTSP from multiple cameras and tracks people with in it, also reidentifying them across multiple cameras and estimating their poses in real-time. This project is compatible with Python >= 3.6 and uses both Pytorch and Tensorflow at its backend. It is built on top of these amazing projects:
- Multi camera people tracking and reidentifcation: This repo provides an implementation but it had to be modified for real-time use case. For this, multiprocessing, shared memory objects and multithreading has been used.
- Openpose-pytorch implementation: This implementation estimates poses of re-identified people with 18 keypoints.
- Download this model data folder and it to your local repo with the same name.
- Download this model and add it to
model_data/models/
- Download the body_pose_model.pth and add it to
model_data/models/
- Download the crowdhuman_yolov5m.pt and add it to the root repo folder.
- Run
pip install -r requirements.txt
- To run the code with multiple RTSP feeds:
python demo.py -u host1:port1 host2:port2 ...
(*No need to prefix http/https with host names) - To debug the app and use computer webcam:
python demo.py -u 0
- To run pose estimation, use
-p
flag:python demo.py -p -u host1:port1 host2:port2 ...
orpython demo.py -p -u 0
unittest
module has been used to for writing the testcases. The testcase checks if the extraction subprocess and inference process are running correctly. The inference process uses a test video found in/tests/videos/
- To run the test:
python -m unittest -v tests.test_reid
2.Cameras.mp4
On my setup(i5 8th gen, 8 Gb RAM and NVIDI GTX 1650) with low-resolution streams(640 × 480), I got 10 fps without pose estimation and 2 fps with pose esimtation. With better hardware, it can be improved.
- Raise an issue with mentioning the issue being faced, your system specifications along with OS and Python version
- PRs are welcome!