          self.image = image[self.y: self.y + self.h,
                             self.x: self.x + self.w]
  
      def to_alignment(self):
          """ Convert a detected face to alignment dict """
          alignment = dict()
          alignment["x"] = self.x
          alignment["w"] = self.w
          alignment["y"] = self.y
          alignment["h"] = self.h
 
</s> remove     def image_to_face(self, image):
        """ Crop an image around bounding box to the face
            and capture it's dimensions """
        logger.trace("Cropping face from image")
        self.image = image[self.y: self.y + self.h,
                           self.x: self.x + self.w]
 </s> add     @property
    def right(self):
        """int: Right point (in pixels) of face detection bounding box within the parent image """
        return self.x + self.w

    @property
    def bottom(self):
        """int: Bottom point (in pixels) of face detection bounding box within the parent image """
        return self.y + self.h

    @property
    def _extract_ratio(self):
        """ float: The ratio of padding to add for training images """
        return 0.375 </s> remove         alignment["landmarksXY"] = self.landmarksXY
 </s> add         alignment["landmarks_xy"] = self.landmarks_xy </s> remove         self.landmarksXY = alignment["landmarksXY"]
 </s> add         self.landmarks_xy = alignment["landmarks_xy"] </s> remove 
    @staticmethod
    def extracted_to_alignment(extract_data):
        """ Convert Extracted Tuple to Alignments data """
        alignment = dict()
        bbox, landmarks = extract_data
        alignment["x"] = bbox["left"]
        alignment["w"] = bbox["right"] - bbox["left"]
        alignment["y"] = bbox["top"]
        alignment["h"] = bbox["bottom"] - bbox["top"]
        alignment["landmarksXY"] = landmarks
        return alignment
 </s> add  </s> remove         """ Convert a face alignment to detected face object """
 </s> add         """ Set the attributes of this class from an alignments file and optionally load the face
        into the ``image`` attribute.

        Parameters
        ----------
        alignment: dict
            A dictionary entry for a face from an alignments file containing the keys
            ``x``, ``w``, ``y``, ``h``, ``landmarks_xy``. Optionally the key ``hash``
            will be provided, but not all use cases will know the face hash at this time.
        image: numpy.ndarray, optional
            If an image is passed in, then the ``image`` attribute will
            be set to the cropped face based on the passed in bounding box co-ordinates
        """

        """  Return the detected face formatted for an alignments file

        returns
        -------
        alignment: dict
            The alignment dict will be returned with the keys ``x``, ``w``, ``y``, ``h``,
            ``landmarks_xy``, ``hash``.
        """

          self.image = image[self.y: self.y + self.h,
                             self.x: self.x + self.w]
  
      def to_alignment(self):
        """  Return the detected face formatted for an alignments file

        returns
        -------
        alignment: dict
            The alignment dict will be returned with the keys ``x``, ``w``, ``y``, ``h``,
            ``landmarks_xy``, ``hash``.
        """

          alignment = dict()
          alignment["x"] = self.x
          alignment["w"] = self.w
          alignment["y"] = self.y
          alignment["h"] = self.h
keep keep keep keep 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 
lib/faces_detect.py