              return image
  
          image = self.images.rotate_image(image, face.r)
          # TODO: This switch between 64 and 128 is a hack for now.
          # We should have a separate cli option for size
          
          size = 128 if (self.args.trainer.strip().lower()
                         in ('gan128', 'originalhighres')) else 64
 
</s> remove     @staticmethod
    def rotate_image_by_angle(image, angle,
                              rotated_width=None, rotated_height=None):
        """ Rotate an image by a given angle.
            From: https://stackoverflow.com/questions/22041699

            This is required by both Faces and Images
            so placed here for now """
        height, width = image.shape[:2]
        image_center = (width/2, height/2)
        rotation_matrix = cv2.getRotationMatrix2D(image_center, -1.*angle, 1.)
        if rotated_width is None or rotated_height is None:
            abs_cos = abs(rotation_matrix[0, 0])
            abs_sin = abs(rotation_matrix[0, 1])
            if rotated_width is None:
                rotated_width = int(height*abs_sin + width*abs_cos)
            if rotated_height is None:
                rotated_height = int(height*abs_cos + width*abs_sin)
        rotation_matrix[0, 2] += rotated_width/2 - image_center[0]
        rotation_matrix[1, 2] += rotated_height/2 - image_center[1]
        return cv2.warpAffine(image,
                              rotation_matrix,
                              (rotated_width, rotated_height))

 </s> add  </s> remove     def detect_faces(self, input_is_predetected_face):
 </s> add     def execute(self, input_image_bgr,
                input_is_predetected_face=False, manual_face=None):
        """ Execute extract """
        self.frame = Frame(detector=self.detector_name,
                           input_image=input_image_bgr,
                           verbose=self.verbose,
                           input_is_predetected_face=input_is_predetected_face)

        self.detect_faces(input_is_predetected_face, manual_face)
        self.bounding_boxes = self.get_bounding_boxes()

        self.landmarks = Align(image=self.frame.image_rgb,
                               detected_faces=self.bounding_boxes,
                               keras_model=self.keras,
                               verbose=self.verbose).landmarks

    def detect_faces(self, input_is_predetected_face, manual_face): </s> remove                 image = Utils.rotate_image_by_angle(image, face.r)
 </s> add                 image, _ = rotate_image_by_angle(image, face.r)
        # Rotating an image is legacy code. Landmarks are now
        # rotated at extract stage. For newer extracts face.r
        # will always be zero.
              return image
  
        # Rotating an image is legacy code. Landmarks are now
        # rotated at extract stage. For newer extracts face.r
        # will always be zero.
          image = self.images.rotate_image(image, face.r)
          # TODO: This switch between 64 and 128 is a hack for now.
          # We should have a separate cli option for size
          
          size = 128 if (self.args.trainer.strip().lower()
                         in ('gan128', 'originalhighres')) else 64
keep add keep keep keep keep keep keep
 Alignments Tool - Manual (#503)

* Initial alignment tool implementation

* Add face processing. Fix helptext formatting for cli and gui

* Extract faces from alignments file

* Add draw landmarks

* fix analysis hours past 24 bug

* Remove tools flag. Enlarge GUI tooltips

* Add filename extension check for image folders

* Fix folder nonetype bug and linting

* Bugfix renaming of faces

* Import alignments from DeepFaceLab

* Remove frames requirement for dfl

* Alignments Tool: Add remove frames

* Alignments: Add remove frames (#492)

* Alignments Tool: Add remove frames

* Implement Frame display for manual extract

* Alignments refactor

* Further navigation improvements

* Further navigation improvements

* Alignment Tool: Refactor

* Move rotate_image_by_angle() to utils

* Further refactoring improvements

* Reduce key bindings. Add skip to has faces, Add resize frame binding

* More navigation options. Delete faces added. Save alignments added

* Add: Reload alignments. Add extra api calls. Better redraw handling.

* Manual Alignments - Alpha Build

* Rotate landmarks for rotated images

* Rebase to remove OriginalHiRes changes 
scripts/convert.py