          logger.trace("image dims: %s", dims)
          batch["detected_faces"] = [[face for face in faces
                                      if face.right > 0 and face.left < dim[1]
                                      and face.bottom > 0 and face.top < dim[0]]
                                     for dim, faces in zip(dims,
                                                           batch.get("detected_faces", list()))]
  
      def _filter_small_faces(self, detected_faces):
          """ Filter out any faces smaller than the min size threshold """
          retval = []
          for faces in detected_faces:
 
</s> remove         batch["detected_faces"] = [[face for face in faces
 </s> add         batch["detected_faces"] = [[face
                                    for face in faces </s> remove     def align_face(self, faces, size, filename):
        """ Align the detected face and add the destination file path """
        final_faces = list()
        image = faces["image"]
        detected_faces = faces["detected_faces"]
        for face in detected_faces:
            face.load_aligned(image, size=size)
            final_faces.append({"file_location": self.output_dir / Path(filename).stem,
                                "face": face})
        faces["detected_faces"] = final_faces

 </s> add  </s> remove         batch["feed"] = np.array(faces, dtype="float32").transpose((0, 3, 1, 2)) / 255.0
 </s> add         batch["feed"] = np.array(faces, dtype="float32")[..., :3].transpose((0, 3, 1, 2)) / 255.0 </s> remove         batch["feed"] = np.array(faces, dtype="float32").transpose((0, 3, 1, 2))
 </s> add         batch["feed"] = np.array(faces, dtype="float32")[..., :3].transpose((0, 3, 1, 2)) </s> remove         self.align_face(faces, size, filename)
 </s> add         final_faces = list()
        for detected_face in faces["detected_faces"]:
            filename = self.output_dir / Path(detected_face.filename).stem
            final_faces.append({"file_location": filename,
                                "face": detected_face})
        faces["detected_faces"] = final_faces
                                   for dim, faces in zip(dims, batch.get("detected_faces", []))]
          logger.trace("image dims: %s", dims)
          batch["detected_faces"] = [[face for face in faces
                                      if face.right > 0 and face.left < dim[1]
                                      and face.bottom > 0 and face.top < dim[0]]
                                   for dim, faces in zip(dims, batch.get("detected_faces", []))]
                                   for dim, faces in zip(dims, batch.get("detected_faces", []))]
  
      def _filter_small_faces(self, detected_faces):
          """ Filter out any faces smaller than the min size threshold """
          retval = []
          for faces in detected_faces:
keep keep keep keep replace replace keep keep keep keep keep
 Smart Mask Exposure for Extraction & Training (#831)

Smart Masks - Initial Commit 
plugins/extract/detect/_base.py