          """ Set the system output verbosity """
          lvl = '0' if verbose else '2'
          set_system_verbosity(lvl)
  
      @staticmethod
      def cv2_read_write(action, filename, image=None):
          """ Read or write an image using cv2 """
          if action == 'read':
              image = cv2.imread(filename)
          if action == 'write':
              cv2.imwrite(filename, image)
          return image
  
      @staticmethod
      def finalize(images_found, num_faces_detected, verify_output):
          """ Finalize the image processing """
          print("-------------------------")
          print("Images found:        {}".format(images_found))
 
</s> remove     def read_input_images(self, input_dir):
 </s> add     @staticmethod
    def read_input_images(input_dir):
        """ Get the image paths """ </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
          """ Set the system output verbosity """
          lvl = '0' if verbose else '2'
          set_system_verbosity(lvl)
  









      @staticmethod
      def finalize(images_found, num_faces_detected, verify_output):
          """ Finalize the image processing """
          print("-------------------------")
          print("Images found:        {}".format(images_found))
keep keep keep keep 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