          bot_right = self.transform(matrix_size, batch["center_scale"], resolutions)
  
          # TODO second pass .. convert to matrix
          new_images = []
          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)
              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))
 
</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         # s_sort[-1] have hightest prob score, s_sort[0:-1]->others
 </s> add         # s_sort[-1] have highest prob score, s_sort[0:-1]->others </s> remove         # TODO improve rudimentary subpixel logic to centroid of 3x3 window algorithm
 </s> add         # TODO improve rudimentary sub-pixel logic to centroid of 3x3 window algorithm </s> remove         batch["feed"] = (batch["scaled_image"] - 127.5) / 127.5
 </s> add         batch["feed"] = (batch["image"] - 127.5) / 127.5
        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)
          bot_right = self.transform(matrix_size, batch["center_scale"], resolutions)
  
          # TODO second pass .. convert to matrix
          new_images = []
        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)
        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)
        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)
        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)
        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)
        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)
              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))
keep keep keep keep replace 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