def prepare_data(video_dir, output_dir, max_video_limit=1, screen_display=False):
"""
Args:
1. video_dir: Directory storing all videos to be processed.
2. output_dir: Directory where all mouth region images are to be stored.
3. max_video_limit: Puts a limit on number of videos to be used for processing.
4. screen_display: Decides whether to use screen (to display video being processed).
"""
video_file_paths = sorted(glob.glob(video_dir + "*.mp4"))[:max_video_limit]
load_trained_models()
if not FACE_DETECTOR_MODEL:
print "[ERROR]: Please ensure that you have dlib's landmarks predictor file " + \
"at data/dlib_data/. You can download it here: " + \
"http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2"
return False
for path in video_file_paths:
extract_mouth_regions(path, output_dir, screen_display)
return True
data_preprocessing_autoencoder.py 文件源码
python
阅读 43
收藏 0
点赞 0
评论 0
评论列表
文章目录