add seq_nms on yolo v2 for video object detection
This project combines YOLOv2(reference) and seq-nms(reference) to realise real time video detection.
- Install
Tensorflow Object Detction API
(reference); - Modify the
Makefile
file according to your environment.
GPU=1 # 0 if your pc doesn't support CUDA
CUDNN=1 # 0 if your pc doesn't support CUDNN
OPENCV=1 # 0 if your pc doesn't support OPENCV
make
the project;- Download
yolo.weights
andtiny-yolo.weights
by running:
wget https://pjreddie.com/media/files/yolo.weights
wget https://pjreddie.com/media/files/tiny-yolo-voc.weights
- Copy a video file to the video directory, for example,
input.mp4
; - From the video directory, run:
python video2img.py input.mp4
- Return to root directory and run:
python yolo_seqnms.py
- Attention: This scipt will fail if Tensorflow Object Detection API is not installed;
- If you want a fatser detect, run:
python yolo_seqnms.py tiny
- If you want to reconstruct a video from these output images, you can go to the video directory and run:
python img2video.py output.mp4
- If you want to watch the video after creat it, run:
python img2video.py output.mp4 play
This project copies lots of code from darknet , Seq-NMS and models.