  
              # Make box square.
              roi = self.get_square_box(box_moved)
              # Pad the image if face is outside of boundaries
              image = self.pad_image(roi, face.image)
              face = image[roi[1]: roi[3], roi[0]: roi[2]]
  
              interpolation = cv2.INTER_CUBIC if face.shape[0] < self.input_size else cv2.INTER_AREA
              face = cv2.resize(face, dsize=sizes, interpolation=interpolation)
              faces.append(face)
 
</s> remove             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]
 </s> add             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] </s> remove         for face in detected_faces:
 </s> add         for face, image in zip(batch["detected_faces"], batch["image"]): </s> remove         >>> for face in extractor.detected_faces():
        >>>     filename = face["filename"]
        >>>     image = face["image"]
        >>>     detected_faces = face["detected_faces"]
 </s> add         >>> for extract_media in extractor.detected_faces():
        >>>     filename = extract_media.filename
        >>>     image = extract_media.image
        >>>     detected_faces = extract_media.detected_faces </s> remove         filename, extension = os.path.splitext(os.path.basename(faces["filename"]))
        for idx, face in enumerate(faces["detected_faces"]):
 </s> add         filename, extension = os.path.splitext(os.path.basename(extract_media.filename))
        for idx, face in enumerate(extract_media.detected_faces): </s> remove         # TODO modify detected face to hold this data as a matrix
 </s> add 
            image = self.pad_image(roi, image)
  
              # Make box square.
              roi = self.get_square_box(box_moved)
              # Pad the image if face is outside of boundaries
            image = self.pad_image(roi, image)
              face = image[roi[1]: roi[3], roi[0]: roi[2]]
  
              interpolation = cv2.INTER_CUBIC if face.shape[0] < self.input_size else cv2.INTER_AREA
              face = cv2.resize(face, dsize=sizes, interpolation=interpolation)
              faces.append(face)
keep keep keep keep replace keep keep keep keep keep
 plugins.extract - Create ExtractMedia class for pipeline flow
Bugfix - Fix memory leak in extract 
plugins/extract/align/cv2_dnn.py