  
          if input_is_predetected_face:
              self.detector.set_predetected(self.frame.width, self.frame.height)
          else:
              self.detector.detect_faces(self.frame.images)
  
      def convert_to_dlib_rectangle(self):
          """ Convert detected faces to dlib_rectangle """
          detected = [d_rect.rect
                      if self.detector.is_mmod_rectangle(d_rect)
                      else d_rect
                      for d_rect in self.detector.detected_faces]
 
</s> remove         detected = [d_rect.rect
                    if self.detector.is_mmod_rectangle(d_rect)
                    else d_rect
                    for d_rect in self.detector.detected_faces]

        self.detector.detected_faces = detected
 </s> add         if self.detector.is_mmod_rectangle(d_rect):
            return d_rect.rect
        return d_rect </s> remove         for d_rect in self.detected_faces:
            self.get_bounding_box(d_rect)
            del d_rect
 </s> add         for detected_face in self.detected_faces: </s> remove             center, scale = self.get_center_scale()
 </s> add             center, scale = self.get_center_scale(detected_face) </s> remove         self.input_scale = 1.0
        self.images = self.process_input(input_image,
                                         input_is_predetected_face)

    def process_input(self, input_image, input_is_predetected_face):
        """ Process import image:
            Size down if required
            Duplicate into rgb colour space """
        if not input_is_predetected_face:
            input_image = self.scale_down(input_image)
        return self.compile_color_space(input_image)

    def scale_down(self, image):
 </s> add     def scale_image(self, input_is_predetected_face, detector): </s> remove     def detect_faces(self, images):
        """ Detect faces in images """
 </s> add     def detect_faces(self, image):
        """ Detect faces in rgb image """
            self.detector.detect_faces(self.frame.image_detect)

    def get_bounding_boxes(self):
        """ Return the corner points of the bounding box scaled
            to original image """
        bounding_boxes = list()
        for d_rect in self.detector.detected_faces:
            d_rect = self.convert_to_dlib_rectangle(d_rect)
            bounding_box = {
                'left': int(d_rect.left() / self.frame.input_scale),
                'top': int(d_rect.top() / self.frame.input_scale),
                'right': int(d_rect.right() / self.frame.input_scale),
                'bottom': int(d_rect.bottom() / self.frame.input_scale)}
            bounding_boxes.append(bounding_box)
        return bounding_boxes

    def convert_to_dlib_rectangle(self, d_rect):
  
          if input_is_predetected_face:
              self.detector.set_predetected(self.frame.width, self.frame.height)
          else:
            self.detector.detect_faces(self.frame.image_detect)

    def get_bounding_boxes(self):
        """ Return the corner points of the bounding box scaled
            to original image """
        bounding_boxes = list()
        for d_rect in self.detector.detected_faces:
            d_rect = self.convert_to_dlib_rectangle(d_rect)
            bounding_box = {
                'left': int(d_rect.left() / self.frame.input_scale),
                'top': int(d_rect.top() / self.frame.input_scale),
                'right': int(d_rect.right() / self.frame.input_scale),
                'bottom': int(d_rect.bottom() / self.frame.input_scale)}
            bounding_boxes.append(bounding_box)
        return bounding_boxes

    def convert_to_dlib_rectangle(self, d_rect):
            self.detector.detect_faces(self.frame.image_detect)

    def get_bounding_boxes(self):
        """ Return the corner points of the bounding box scaled
            to original image """
        bounding_boxes = list()
        for d_rect in self.detector.detected_faces:
            d_rect = self.convert_to_dlib_rectangle(d_rect)
            bounding_box = {
                'left': int(d_rect.left() / self.frame.input_scale),
                'top': int(d_rect.top() / self.frame.input_scale),
                'right': int(d_rect.right() / self.frame.input_scale),
                'bottom': int(d_rect.bottom() / self.frame.input_scale)}
            bounding_boxes.append(bounding_box)
        return bounding_boxes

    def convert_to_dlib_rectangle(self, d_rect):
            self.detector.detect_faces(self.frame.image_detect)

    def get_bounding_boxes(self):
        """ Return the corner points of the bounding box scaled
            to original image """
        bounding_boxes = list()
        for d_rect in self.detector.detected_faces:
            d_rect = self.convert_to_dlib_rectangle(d_rect)
            bounding_box = {
                'left': int(d_rect.left() / self.frame.input_scale),
                'top': int(d_rect.top() / self.frame.input_scale),
                'right': int(d_rect.right() / self.frame.input_scale),
                'bottom': int(d_rect.bottom() / self.frame.input_scale)}
            bounding_boxes.append(bounding_box)
        return bounding_boxes

    def convert_to_dlib_rectangle(self, d_rect):
          """ Convert detected faces to dlib_rectangle """
          detected = [d_rect.rect
                      if self.detector.is_mmod_rectangle(d_rect)
                      else d_rect
                      for d_rect in self.detector.detected_faces]
keep keep keep keep replace replace replace keep keep keep keep keep
 DLib scaling amends (#461)

* Scaling area fix and rework of frames and bounding boxes

* Update DLib scaling and initialization 
lib/face_alignment/extractor.py