Skip to content

thu-huangzc/VPED

Repository files navigation

Video Pedestrian Event Detection

English|中文

gender

Pedestrian tracking and gender recognition(red: female, green: male)

helmet

Pedestrian tracking and helmet wearing identification(red: not wearing helmet, green: wearing helmet)

helmet

Pedestrian tracking and face mask wearing identification(red: not wearing face mask, green: wearing face mask)

helmet

Pedestrian tracking and using phone identification(red: using phone, green: not using phone)

helmet

Pedestrian tracking and smoking detection(red: smoking, green: not smoking)

Quick Start

  1. Clone this repository

    git clone https://github.com/thu-huangzc/VPED.git
    git pull
  2. 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.

  3. 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.pt and cigarette_epoch20.pt under ./ckpt/yolo/, place clip-vit-base-patch16 under ./ckpt/, place phone_detection.pth under ./ckpt/classifier.

  4. 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_videos by default.

Notes

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~

About

Video Pedestrian Event Detection. Given a video and an event to be detected, identify, detect and track the people in the video, and make corresponding event judgments, such as smoking, helmets, gender, etc. 视频行人事件检测。给定一段视频和一个待检测事件,对视频中的人进行识别、检测和跟踪,并做出相应的事件判断,如吸烟、戴头盔、性别等。

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages