              serializer = Serializer.get_serializer(self.args.serializer)
          print("Using {} serializer".format(serializer.ext))
          return serializer
  
      def get_alignments_path(self):
          """ Return the path to alignments file """
          if self.args.alignments_path:
              alignfile = self.args.alignments_path
          else:
              alignfile = os.path.join(
                  str(self.args.input_dir),
                  "alignments.{}".format(self.serializer.ext))
          print("Alignments filepath: %s" % alignfile)
          return alignfile
  
      def read_alignments(self):
          """ Read the serialized alignments file """
          try:
              with open(self.alignments_path, self.serializer.roptions) as align:
 
</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     def get_serializer(self):
        """ Set the serializer to be used for loading and saving alignments """
        if not self.args.serializer and self.args.alignments_path:
            ext = os.path.splitext(self.args.alignments_path)[-1]
            serializer = Serializer.get_serializer_from_ext(ext)
            print("Alignments Output: {}".format(self.args.alignments_path))
        else:
            serializer = Serializer.get_serializer(self.args.serializer)
        print("Using {} serializer".format(serializer.ext))
        return serializer
 </s> add         filter_files = [self.set_face_filter(key, val)
                        for key, val in filter_lists.items()] </s> remove             input_images = get_image_paths(self.args.input_dir)
 </s> add             alignfile = os.path.join(
                str(self.args.input_dir),
                "alignments.{}".format(self.serializer.ext))
        print("Alignments filepath: %s" % alignfile)
        return alignfile </s> remove         if hasattr(self.args, 'skip_existing') and self.args.skip_existing:
            input_images = get_image_paths(self.args.input_dir,
                                           self.already_processed)
            print("Excluding %s files" % len(self.already_processed))
 </s> add     def get_location(self):
        """ Return the path to alignments file """
        if self.args.alignments_path:
            alignfile = self.args.alignments_path </s> remove     def get_input_images(self):
        """ Return the list of images that are to be processed """
        if not os.path.exists(self.args.input_dir):
            print("Input directory {} not found.".format(self.args.input_dir))
            exit(1)

        print("Input Directory: {}".format(self.args.input_dir))
 </s> add     def get_serializer(self):
        """ Set the serializer to be used for loading and
            saving alignments """
        if (not hasattr(self.args, "serializer")
                or not self.args.serializer):
            if self.args.alignments_path:
                ext = os.path.splitext(self.args.alignments_path)[-1]
            else:
                ext = "json"
            serializer = Serializer.get_serializer_from_ext(ext)
        else:
            serializer = Serializer.get_serializer(self.args.serializer)
        print("Using {} serializer".format(serializer.ext))
        return serializer
        if any(filters for filters in filter_files):
            facefilter = FilterFunc(filter_files[0],
                                    filter_files[1],
                                    ref_threshold)
        return facefilter
              serializer = Serializer.get_serializer(self.args.serializer)
          print("Using {} serializer".format(serializer.ext))
          return serializer
  
        if any(filters for filters in filter_files):
            facefilter = FilterFunc(filter_files[0],
                                    filter_files[1],
                                    ref_threshold)
        return facefilter
        if any(filters for filters in filter_files):
            facefilter = FilterFunc(filter_files[0],
                                    filter_files[1],
                                    ref_threshold)
        return facefilter
        if any(filters for filters in filter_files):
            facefilter = FilterFunc(filter_files[0],
                                    filter_files[1],
                                    ref_threshold)
        return facefilter
        if any(filters for filters in filter_files):
            facefilter = FilterFunc(filter_files[0],
                                    filter_files[1],
                                    ref_threshold)
        return facefilter
        if any(filters for filters in filter_files):
            facefilter = FilterFunc(filter_files[0],
                                    filter_files[1],
                                    ref_threshold)
        return facefilter
        if any(filters for filters in filter_files):
            facefilter = FilterFunc(filter_files[0],
                                    filter_files[1],
                                    ref_threshold)
        return facefilter
        if any(filters for filters in filter_files):
            facefilter = FilterFunc(filter_files[0],
                                    filter_files[1],
                                    ref_threshold)
        return facefilter
        if any(filters for filters in filter_files):
            facefilter = FilterFunc(filter_files[0],
                                    filter_files[1],
                                    ref_threshold)
        return facefilter
        if any(filters for filters in filter_files):
            facefilter = FilterFunc(filter_files[0],
                                    filter_files[1],
                                    ref_threshold)
        return facefilter
        if any(filters for filters in filter_files):
            facefilter = FilterFunc(filter_files[0],
                                    filter_files[1],
                                    ref_threshold)
        return facefilter
  
      def read_alignments(self):
          """ Read the serialized alignments file """
          try:
              with open(self.alignments_path, self.serializer.roptions) as align:
keep keep keep keep replace replace replace replace replace replace replace replace replace replace keep 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