          return output_im
  
      def align(self, ref_img, img):
          ref_rect = self.get_first_rect(ref_img)
          if ref_rect is None:
              return None
          ref_landmarks = self.get_landmarks(ref_img, ref_rect)
 
</s> remove             return rects[0]
 </s> add             return rects[0].rect
 </s> remove         rects = self.detector(img)
 </s> add         rects = self.detector(img, 1)
 </s> remove     def __init__(self, pred):
        self.detector = dlib.get_frontal_face_detector()
 </s> add     def __init__(self, pred, detect):
        self.detector = dlib.cnn_face_detection_model_v1(detect)
 </s> remove aligner = Aligner("shape_predictor_68_face_landmarks.dat")
 </s> add aligner = Aligner("shape_predictor_68_face_landmarks.dat","mmod_human_face_detector.dat")
        # TODO optimize with a one step detection for both images

          return output_im
  
      def align(self, ref_img, img):
        # TODO optimize with a one step detection for both images
          ref_rect = self.get_first_rect(ref_img)
          if ref_rect is None:
              return None
          ref_landmarks = self.get_landmarks(ref_img, ref_rect)
keep keep add keep keep keep keep
 Different aligner setup

Using cnn_face_detection_model_v1 as per
https://www.reddit.com/r/deepfakes/comments/7kfva4/face_alignment_with_d
lib/

Note this gives good result on trump/cage, but not on the group photos
I tried 
lib/aligner.py