Python dlib 模块,net() 实例源码

我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用dlib.net()

项目:AVSR-Deep-Speech    作者:pandeydivesh15    | 项目源码 | 文件源码
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