4b1a4f9e0be8bc88ad627475e12381798d97470d,face_alignment/detection/dlib/dlib_detector.py,DlibDetector,__init__,#DlibDetector#Any#Any#Any#,15

Before Change


        // Initialise the face detector
        if "cuda" in device:
            if path_to_detector is None:
                path_to_detector = os.path.join(
                    base_path, "mmod_human_face_detector.dat")

                if not os.path.isfile(path_to_detector):
                    print("Downloading the face detection CNN. Please wait...")

                    path_to_temp_detector = os.path.join(
                        base_path, "mmod_human_face_detector.dat.download")

                    if os.path.isfile(path_to_temp_detector):
                        os.remove(os.path.join(path_to_temp_detector))

                    request_file.urlretrieve(
                        "https://www.adrianbulat.com/downloads/dlib/mmod_human_face_detector.dat",
                        os.path.join(path_to_temp_detector))

                    os.rename(os.path.join(path_to_temp_detector), os.path.join(path_to_detector))

            self.face_detector = dlib.cnn_face_detection_model_v1(path_to_detector)
        else:
            self.face_detector = dlib.get_frontal_face_detector()

After Change



        // Initialise the face detector
        if "cuda" in device:
            if path_to_detector is None:      
                path_to_detector = load_file_from_url("https://www.adrianbulat.com/downloads/dlib/mmod_human_face_detector.dat")

            self.face_detector = dlib.cnn_face_detection_model_v1(path_to_detector)
        else:
            self.face_detector = dlib.get_frontal_face_detector()

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: 1adrianb/face-alignment
Commit Name: 4b1a4f9e0be8bc88ad627475e12381798d97470d
Time: 2020-12-13
Author: adrian@adrianbulat.com
File Name: face_alignment/detection/dlib/dlib_detector.py
Class Name: DlibDetector
Method Name: __init__


Project Name: 1adrianb/face-alignment
Commit Name: f90efe38fb0b1019e5bdc06b8a325aefe44893ea
Time: 2018-12-19
Author: bulat.adrian@gmail.com
File Name: face_alignment/detection/sfd/sfd_detector.py
Class Name: SFDDetector
Method Name: __init__


Project Name: PetrochukM/PyTorch-NLP
Commit Name: def0dfbfbc6f840484a10cc4e963cfa8686ded69
Time: 2018-04-01
Author: petrochukm@gmail.com
File Name: torchnlp/utils.py
Class Name:
Method Name: download_urls