Anonymizing videos by DSFD: Dual Shot Face Detector
Modified by Jongkuk Lim
This repository was forked from FaceDetection-DSFD which is implentation of DSFD: Dual Shot Face Detector by Jian Li, Yabiao Wang, Changan Wang, Ying Tai, Jianjun Qian, Jian Yang, Chengjie Wang, Jilin Li, Feiyue Huang.
Simple implementation of video anonymization.
If you are looking for a faster version, check Anonymizing videos by lightDSFD. And, if you are looking for a simpler example, noone video is implemented by only OpenCV examples.
Note that this repository is not designed for training models. If you are looking for training models, please visit original repository FaceDetection-DSFD.
CUDA supported enviornment
(Tested on NVIDIA GTX 1060(6GB) and GTX 1080 Ti(8GB))
- Torch >= 0.3.1
- Torchvision >= 0.2.1
- (Tested on torch 1.3.1 and Torchvision 0.4.2)
- Python 3.6
-
Download DSFD model from original repository provided [微云] [google drive]
-
Place
WIDERFace_DSFD_RES152.pth
to./weights/
. -
Run
./demo.py
to check if it is running.
python demo.py [--trained_model [TRAINED_MODEL]] [--img_root [IMG_ROOT]]
[--save_folder [SAVE_FOLDER]] [--visual_threshold [VISUAL_THRESHOLD]]
--trained_model Path to the saved model
--img_root Path of test images
--save_folder Path of output detection resutls
--visual_threshold Confidence thresh
usage: blur_video.py [-h] -i INPUT -o OUTPUT [--vertical VERTICAL]
[--verbose VERBOSE] [--reduce_scale REDUCE_SCALE]
[--trained_model TRAINED_MODEL] [--threshold THRESHOLD]
[--cuda CUDA]
Required file paths:
-i INPUT, --input INPUT
Video file path
-o OUTPUT, --output OUTPUT
Output video path
optional arguments:
-h, --help show this help message and exit
--vertical VERTICAL 0 : horizontal video(default), 1 : vertical video
--verbose VERBOSE Show current progress and remaining time
--reduce_scale REDUCE_SCALE
Reduce scale ratio. ex) 2 = half size of the input.
Default : 2
--trained_model TRAINED_MODEL
Trained state_dict file path to open
--threshold THRESHOLD
Final confidence threshold
--cuda CUDA Use cuda
If you find DSFD useful in your research, please consider citing:
@inproceedings{li2018dsfd,
title={DSFD: Dual Shot Face Detector},
author={Li, Jian and Wang, Yabiao and Wang, Changan and Tai, Ying and Qian, Jianjun and Yang, Jian and Wang, Chengjie and Li, Jilin and Huang, Feiyue},
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
year={2019}
}