                                rotated_width=None, rotated_height=None):
          """ Rotate an image by a given angle.
              From: https://stackoverflow.com/questions/22041699 """
  
          logger.trace("Rotating image: (angle: %s, rotated_width: %s, rotated_height: %s)",
                       angle, rotated_width, rotated_height)
          height, width = image.shape[:2]
          image_center = (width/2, height/2)
          rotation_matrix = cv2.getRotationMatrix2D(  # pylint: disable=no-member
              image_center, -1.*angle, 1.)
          if rotated_width is None or rotated_height is None:
 
</s> remove     @staticmethod
    def rotate_image_by_angle(image, angle,
                              rotated_width=None, rotated_height=None):
 </s> add     def _rotate_image_by_angle(self, image, angle): </s> remove         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]
 </s> add         rotation_matrix[0, 2] += self.input_size / 2 - image_center[0]
        rotation_matrix[1, 2] += self.input_size / 2 - image_center[1] </s> remove     def scale_image(image, scale, pad_to=None):
 </s> add     def _scale_image(image, image_size, scale): </s> remove         # pylint: disable=no-member
        height, width = image.shape[:2]
        interpln = cv2.INTER_LINEAR if scale > 1.0 else cv2.INTER_AREA
 </s> add         interpln = cv2.INTER_CUBIC if scale > 1.0 else cv2.INTER_AREA  # pylint:disable=no-member </s> remove     @staticmethod
    def pad_image(image, target):
        """ Pad an image to a square """
 </s> add     def _pad_image(self, image):
        """ Pad a resized image to input size """
        logger.trace("Rotating image: (image: %s, angle: %s)", image.shape, angle)
        channels_first = image.shape[0] <= 4
        if channels_first:
            image = np.moveaxis(image, 0, 2)

                                rotated_width=None, rotated_height=None):
          """ Rotate an image by a given angle.
              From: https://stackoverflow.com/questions/22041699 """
  
        logger.trace("Rotating image: (image: %s, angle: %s)", image.shape, angle)
        channels_first = image.shape[0] <= 4
        if channels_first:
            image = np.moveaxis(image, 0, 2)

        logger.trace("Rotating image: (image: %s, angle: %s)", image.shape, angle)
        channels_first = image.shape[0] <= 4
        if channels_first:
            image = np.moveaxis(image, 0, 2)

          height, width = image.shape[:2]
          image_center = (width/2, height/2)
          rotation_matrix = cv2.getRotationMatrix2D(  # pylint: disable=no-member
              image_center, -1.*angle, 1.)
          if rotated_width is None or rotated_height is None:
keep keep keep keep replace replace keep keep keep keep keep
 De-Multiprocess Extract (#871)

* requirements.txt: - Pin opencv to 4.1.1 (fixes cv2-dnn error)

* lib.face_detect.DetectedFace: change LandmarksXY to landmarks_xy. Add left, right, top, bottom attributes

* lib.model.session: Session manager for loading models into different graphs (for Nvidia + CPU)

* plugins.extract._base: New parent class for all extract plugins

* plugins.extract.pipeline. Remove MultiProcessing. Dynamically limit batchsize for Nvidia cards. Remove loglevel input

* S3FD + FAN plugins. Standardise to Keras version for all backends

* Standardize all extract plugins to new threaded codebase

* Documentation. Start implementing Numpy style docstrings for Sphinx Documentation

* Remove s3fd_amd. Change convert OTF to expect DetectedFace object

* faces_detect - clean up and documentation

* Remove PoolProcess

* Migrate manual tool to new extract workflow

* Remove AMD specific extractor code from cli and plugins

* Sort tool to new extract workflow

* Remove multiprocessing from project

* Remove multiprocessing queues from QueueManager

* Remove multiprocessing support from logger

* Move face_filter to new extraction pipeline

* Alignments landmarksXY > landmarks_xy and legacy handling

* Intercept get_backend for sphinx doc build

# Add Sphinx documentation 
plugins/extract/detect/_base.py