              ul_width, ul_height = ul[0].astype('int32')
              new_dim = (br_height - ul_height, br_width - ul_width, channels)
              new_img = np.empty(new_dim, dtype=np.uint8)
  
              new_x = slice(max(0, -ul_width), min(br_width, width) - ul_width)
              new_y = slice(max(0, -ul_height), min(br_height, height) - ul_height)
              old_x = slice(max(0, ul_width), min(br_width, width))
              old_y = slice(max(0, ul_height), min(br_height, height))
              new_img[new_y, new_x] = face.image[old_y, old_x]
  
              interp = cv2.INTER_CUBIC if new_dim[0] < self.input_size else cv2.INTER_AREA
              new_images.append(cv2.resize(new_img, dsize=sizes, interpolation=interp))
          logger.trace("Cropped images")
          return new_images
 
</s> remove         for face, ul, br in zip(batch["detected_faces"], upper_left, bot_right):
            height, width = face.image.shape[:2]
            channels = 3 if face.image.ndim > 2 else 1
            br_width, br_height = br[0].astype('int32')
            ul_width, ul_height = ul[0].astype('int32')
            new_dim = (br_height - ul_height, br_width - ul_width, channels)
 </s> add         for image, top_left, bottom_right in zip(batch["image"], upper_left, bot_right):
            height, width = image.shape[:2]
            channels = 3 if image.ndim > 2 else 1
            bottom_right_width, bottom_right_height = bottom_right[0].astype('int32')
            top_left_width, top_left_height = top_left[0].astype('int32')
            new_dim = (bottom_right_height - top_left_height,
                       bottom_right_width - top_left_width,
                       channels) </s> remove             image = self.pad_image(roi, face.image)
 </s> add             image = self.pad_image(roi, image) </s> remove         batch["feed"] = (batch["scaled_image"] - 127.5) / 127.5
 </s> add         batch["feed"] = (batch["image"] - 127.5) / 127.5 </s> remove     def _nms(self, boxes, threshold):
 </s> add     @staticmethod
    def _nms(boxes, threshold): </s> remove         for face in detected_faces:
 </s> add         for face, image in zip(batch["detected_faces"], batch["image"]):
            new_x = slice(max(0, -top_left_width), min(bottom_right_width, width) - top_left_width)
            new_y = slice(max(0, -top_left_height),
                          min(bottom_right_height, height) - top_left_height)
            old_x = slice(max(0, top_left_width), min(bottom_right_width, width))
            old_y = slice(max(0, top_left_height), min(bottom_right_height, height))
            new_img[new_y, new_x] = image[old_y, old_x]
              ul_width, ul_height = ul[0].astype('int32')
              new_dim = (br_height - ul_height, br_width - ul_width, channels)
              new_img = np.empty(new_dim, dtype=np.uint8)
  
            new_x = slice(max(0, -top_left_width), min(bottom_right_width, width) - top_left_width)
            new_y = slice(max(0, -top_left_height),
                          min(bottom_right_height, height) - top_left_height)
            old_x = slice(max(0, top_left_width), min(bottom_right_width, width))
            old_y = slice(max(0, top_left_height), min(bottom_right_height, height))
            new_img[new_y, new_x] = image[old_y, old_x]
            new_x = slice(max(0, -top_left_width), min(bottom_right_width, width) - top_left_width)
            new_y = slice(max(0, -top_left_height),
                          min(bottom_right_height, height) - top_left_height)
            old_x = slice(max(0, top_left_width), min(bottom_right_width, width))
            old_y = slice(max(0, top_left_height), min(bottom_right_height, height))
            new_img[new_y, new_x] = image[old_y, old_x]
            new_x = slice(max(0, -top_left_width), min(bottom_right_width, width) - top_left_width)
            new_y = slice(max(0, -top_left_height),
                          min(bottom_right_height, height) - top_left_height)
            old_x = slice(max(0, top_left_width), min(bottom_right_width, width))
            old_y = slice(max(0, top_left_height), min(bottom_right_height, height))
            new_img[new_y, new_x] = image[old_y, old_x]
            new_x = slice(max(0, -top_left_width), min(bottom_right_width, width) - top_left_width)
            new_y = slice(max(0, -top_left_height),
                          min(bottom_right_height, height) - top_left_height)
            old_x = slice(max(0, top_left_width), min(bottom_right_width, width))
            old_y = slice(max(0, top_left_height), min(bottom_right_height, height))
            new_img[new_y, new_x] = image[old_y, old_x]
            new_x = slice(max(0, -top_left_width), min(bottom_right_width, width) - top_left_width)
            new_y = slice(max(0, -top_left_height),
                          min(bottom_right_height, height) - top_left_height)
            old_x = slice(max(0, top_left_width), min(bottom_right_width, width))
            old_y = slice(max(0, top_left_height), min(bottom_right_height, height))
            new_img[new_y, new_x] = image[old_y, old_x]
  
              interp = cv2.INTER_CUBIC if new_dim[0] < self.input_size else cv2.INTER_AREA
              new_images.append(cv2.resize(new_img, dsize=sizes, interpolation=interp))
          logger.trace("Cropped images")
          return new_images
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
 plugins.extract - Create ExtractMedia class for pipeline flow
Bugfix - Fix memory leak in extract 
plugins/extract/align/fan.py