          try:
              with open(self.location, self.serializer.roptions) as align:
                  data = self.serializer.unmarshal(align.read())
  
  
          if skip_faces:
              # Remove items from algnments that have no faces so they will
              # be re-detected
 
</s> remove class Faces():
    """ Holds the faces """
    def __init__(self, arguments):
        self.args = arguments
        self.extractor = self.load_extractor()
        self.mtcnn_kwargs = self.get_mtcnn_kwargs()
        self.filter = self.load_face_filter()
        self.align_eyes = self.args.align_eyes if hasattr(
            self.args, 'align_eyes') else False
        self.output_dir = get_folder(self.args.output_dir)
 </s> add         if skip_faces:
            # Remove items from algnments that have no faces so they will
            # be re-detected
            del_keys = [key for key, val in data.items() if not val]
            for key in del_keys:
                if key in data:
                    del data[key] </s> remove     def rotate_image(self, image, rotation, reverse=False):
        """ Rotate the image forwards or backwards """
        if rotation == 0:
            return image
        if not reverse:
            self.rotation_height, self.rotation_width = image.shape[:2]
            image, _ = rotate_image_by_angle(image, rotation)
        else:
            image, _ = rotate_image_by_angle(
                image,
                rotation * -1,
                rotated_width=self.rotation_width,
                rotated_height=self.rotation_height)
        return image
 </s> add         try:
            with open(self.location, self.serializer.roptions) as align:
                data = self.serializer.unmarshal(align.read()) </s> remove     def read_alignments(self):
        """ Read the serialized alignments file """
        try:
            with open(self.alignments_path, self.serializer.roptions) as align:
                faces_detected = self.serializer.unmarshal(align.read())
        except Exception as err:
            print("{} not read!".format(self.alignments_path))
            print(str(err))
            faces_detected = dict()
        return faces_detected
 </s> add     @staticmethod
    def set_face_filter(f_type, f_args):
        """ Set the required filters """
        if not f_args:
            return list() </s> remove         return input_images
 </s> add     def load(self):
        """ Load the alignments data if it exists or create empty dict """
        data = dict()
        skip_faces = None
        if self.is_extract:
            skip_existing = bool(hasattr(self.args, 'skip_existing')
                                 and self.args.skip_existing)
            skip_faces = bool(hasattr(self.args, 'skip_faces')
                              and self.args.skip_faces)

            if not self.have_alignments_file:
                if skip_existing or skip_faces:
                    print("Skip Existing/Skip Faces selected, but no "
                          "alignments file found!")
                return data
            if not skip_existing and not skip_faces:
                return data </s> remove         self.trainer_name = "LowMem" if trainer_name.lower() == "lowmem" else trainer_name
 </s> add         self.trainer_name = trainer_name
        if trainer_name.lower() == "lowmem":
            self.trainer_name = "LowMem"
        except Exception as err:
            print("{} not read!".format(self.location))
            print(str(err))
            data = dict()
          try:
              with open(self.location, self.serializer.roptions) as align:
                  data = self.serializer.unmarshal(align.read())
  
        except Exception as err:
            print("{} not read!".format(self.location))
            print(str(err))
            data = dict()
  
          if skip_faces:
              # Remove items from algnments that have no faces so they will
              # be re-detected
keep keep keep add keep keep keep keep
 Extraction - Speed improvements (#522) (#523)

* Extraction - Speed improvements (#522)

* Initial Plugin restructure

* Detectors to plugins. Detector speed improvements

* Re-implement dlib aligner, remove models, FAN to TF. Parallel processing

* Update manual, update convert, implement parallel/serial switching

* linting + fix cuda check (setup.py). requirements update keras 2.2.4

* Add extract size option. Fix dlib hog init

* GUI: Increase tooltip width

* Update alignment tool to support new DetectedFace

* Add skip existing faces option

* Fix sort tool to new plugin structure

* remove old align plugin

* fix convert -skip faces bug

* Fix convert skipping no faces frames

* Convert - draw onto transparent layer

* Fix blur threshold bug

* fix skip_faces convert bug

* Fix training 
scripts/fsmedia.py