English|中文
Pedestrian tracking and helmet wearing identification(red: not wearing helmet, green: wearing helmet)
Pedestrian tracking and face mask wearing identification(red: not wearing face mask, green: wearing face mask)
-
Clone this repository
git clone https://github.com/thu-huangzc/VPED.git git pull
-
Install necessary python packages
pip install -r requirements.txt
The Python version is 3.9.19 and the cuda version is 11.8. Of course, other python or cuda versions may also be possible. You can have a try.
-
Download pre-trained model checkpoints
a. Pedestrain detection and tracking -> yolov8m.pt
b. Helmet detection -> helmet_head_person_epoch10.pt
c. CLIP model -> clip-vit-base-patch16
d. Cigarette detection -> cigarette_epoch20.pt
e. Phone detection -> phone_detection.pth
Then, place
yolov8m.pt,helmet_head_person_epoch10.ptandcigarette_epoch20.ptunder./ckpt/yolo/, placeclip-vit-base-patch16under./ckpt/, placephone_detection.pthunder./ckpt/classifier. -
Run demo
a. Upload videos for offline testing
CUDA_VISIBLE_DEVICES=0 python demo.py --input TEST_VIDEO_PATH --event EVENT --draw-results
b. Camera online test
CUDA_VISIBLE_DEVICES=0 python demo.py --input webcam --event EVENT --draw-results
input: 'webcam' or input video file path;event: 'gender', 'helmet', 'mask', 'smoking' or 'phone' (More behavioral recognition will be added later);draw-results: whether to save the inference result video, which will be saved under./inference/test_videosby default.
Related Projects: Smart_Construction, yolo, clip, Safety-Helmet-Wearing-Dataset, MiVOLO
If you find this project helpful, we would greatly appreciate it if you could give us a free star~


