  
      def predict_landmarks(self, feed_dict):
          """ Predict the 68 point landmarks """
          logger.trace("Predicting Landmarks")
          image = np.expand_dims(
              feed_dict["image"].transpose((2, 0, 1)).astype(np.float32) / 255.0, 0)
          prediction = self.model.predict(image)[-1]
          pts_img = self.get_pts_from_predict(prediction, feed_dict["center"], feed_dict["scale"])
          retval = [(int(pt[0]), int(pt[1])) for pt in pts_img]
          logger.trace("Predicted Landmarks: %s", retval)
          return retval
  
      def get_pts_from_predict(self, prediction, center, scale):
          """ Get points from predictor """
          logger.trace("Obtain points from prediction")
          var_b = prediction.reshape((prediction.shape[0],
 
</s> remove     def get_pts_from_predict(self, prediction, center, scale):
 </s> add     def get_pts_from_predict(self, batch): </s> remove     def predict_landmarks(self, feed_dict):
 </s> add     def predict(self, batch): </s> remove         image = np.expand_dims(np.transpose(feed_dict["image"], (2, 0, 1)), 0).astype("float32")
        self.model.setInput(image)
        prediction = self.model.forward()
        pts_img = self.get_pts_from_predict(prediction, feed_dict["roi"])
        return pts_img
 </s> add         self.model.setInput(batch["feed"])
        batch["prediction"] = self.model.forward()
        return batch

    def process_output(self, batch):
        """ Process the output from the model """
        self.get_pts_from_predict(batch)
        return batch </s> remove         logger.trace("Obtain points from prediction")
        points = np.array(prediction).flatten()
        points = np.reshape(points, (-1, 2))
        points *= (roi[2] - roi[0])
        points[:, 0] += roi[0]
        points[:, 1] += roi[1]
        retval = np.rint(points).astype("uint").tolist()
        logger.trace("Predicted Landmarks: %s", retval)
        return retval
 </s> add         for prediction, roi in zip(batch["prediction"], batch["roi"]):
            points = np.array(prediction).flatten()
            points = np.reshape(points, (-1, 2))
            points *= (roi[2] - roi[0])
            points[:, 0] += roi[0]
            points[:, 1] += roi[1]
            landmarks = np.rint(points).astype("uint").tolist()
            batch.setdefault("landmarks", []).append(landmarks)
        logger.trace("Predicted Landmarks: %s", batch["landmarks"]) </s> remove     def predict_landmarks(self, feed_dict):
 </s> add     def predict(self, batch):
        batch["prediction"] = self.model.predict(batch["feed"])[-1]
        logger.trace([pred.shape for pred in batch["prediction"]])
        return batch

    def process_output(self, batch):
        """ Process the output from the model """
        self.get_pts_from_predict(batch)
        return batch
  
      def predict_landmarks(self, feed_dict):
          """ Predict the 68 point landmarks """
          logger.trace("Predicting Landmarks")
        batch["prediction"] = self.model.predict(batch["feed"])[-1]
        logger.trace([pred.shape for pred in batch["prediction"]])
        return batch

    def process_output(self, batch):
        """ Process the output from the model """
        self.get_pts_from_predict(batch)
        return batch
        batch["prediction"] = self.model.predict(batch["feed"])[-1]
        logger.trace([pred.shape for pred in batch["prediction"]])
        return batch

    def process_output(self, batch):
        """ Process the output from the model """
        self.get_pts_from_predict(batch)
        return batch
        batch["prediction"] = self.model.predict(batch["feed"])[-1]
        logger.trace([pred.shape for pred in batch["prediction"]])
        return batch

    def process_output(self, batch):
        """ Process the output from the model """
        self.get_pts_from_predict(batch)
        return batch
        batch["prediction"] = self.model.predict(batch["feed"])[-1]
        logger.trace([pred.shape for pred in batch["prediction"]])
        return batch

    def process_output(self, batch):
        """ Process the output from the model """
        self.get_pts_from_predict(batch)
        return batch
        batch["prediction"] = self.model.predict(batch["feed"])[-1]
        logger.trace([pred.shape for pred in batch["prediction"]])
        return batch

    def process_output(self, batch):
        """ Process the output from the model """
        self.get_pts_from_predict(batch)
        return batch
        batch["prediction"] = self.model.predict(batch["feed"])[-1]
        logger.trace([pred.shape for pred in batch["prediction"]])
        return batch

    def process_output(self, batch):
        """ Process the output from the model """
        self.get_pts_from_predict(batch)
        return batch
        batch["prediction"] = self.model.predict(batch["feed"])[-1]
        logger.trace([pred.shape for pred in batch["prediction"]])
        return batch

    def process_output(self, batch):
        """ Process the output from the model """
        self.get_pts_from_predict(batch)
        return batch
  
      def get_pts_from_predict(self, prediction, center, scale):
          """ Get points from predictor """
          logger.trace("Obtain points from prediction")
          var_b = prediction.reshape((prediction.shape[0],
keep keep keep keep replace replace replace replace replace 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/align/fan.py