          if (not hasattr(self.args, 'skip_existing')
                  or not self.args.skip_existing):
              return None
  
          return get_image_paths(self.args.output_dir)
  
      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))
 
</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 </s> remove             yield faces_count, face
            self.num_faces_detected += 1
            faces_count += 1
        if faces_count > 1 and self.args.verbose:
            print("Note: Found more than one face in "
                  "an image! File: {}".format(filename))
            self.verify_output = True

    def draw_landmarks_on_face(self, face, image):
        """ Draw debug landmarks on extracted face """
        if (not hasattr(self.args, 'debug_landmarks')
                or not self.args.debug_landmarks):
            return
 </s> add     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) </s> remove         self.rotation_width = 0
        self.rotation_height = 0

    def get_rotation_angles(self):
        """ Set the rotation angles. Includes backwards compatibility for the
            'on' and 'off' options:
                - 'on' - increment 90 degrees
                - 'off' - disable
                - 0 is prepended to the list, as whatever happens, we want to
                  scan the image in it's upright state """
        rotation_angles = [0]

        if (not hasattr(self.args, 'rotate_images')
                or not self.args.rotate_images
                or self.args.rotate_images == "off"):
            return rotation_angles

        if self.args.rotate_images == "on":
            rotation_angles.extend(range(90, 360, 90))
        else:
            passed_angles = [int(angle)
                             for angle in self.args.rotate_images.split(",")]
            if len(passed_angles) == 1:
                rotation_step_size = passed_angles[0]
                rotation_angles.extend(range(rotation_step_size,
                                             360,
                                             rotation_step_size))
            elif len(passed_angles) > 1:
                rotation_angles.extend(passed_angles)

        return rotation_angles

    def get_already_processed(self):
        """ Return the images that already exist in the output directory """
        print("Output Directory: {}".format(self.args.output_dir))

        if (not hasattr(self.args, 'skip_existing')
                or not self.args.skip_existing):
            return None
 </s> add     def frames_count(self):
        """ Return current frames count """
        return len(self.data) </s> remove         for (pos_x, pos_y) in face.landmarks_as_xy():
            cv2.circle(image, (pos_x, pos_y), 2, (0, 0, 255), -1)
 </s> add         print("Input Directory: {}".format(self.args.input_dir))
        input_images = get_image_paths(self.args.input_dir) </s> remove     exclude_names = [basename(Path(x).stem[:Path(x).stem.rfind('_')] +
                              Path(x).suffix) for x in exclude]
 </s> add     exclude_names = [os.path.basename(Path(x).stem[:Path(x).stem.rfind('_')] +
                                      Path(x).suffix) for x in exclude]
    def faces_count(self):
        """ Return current faces count """
        return sum(len(faces) for faces in self.data.values())
          if (not hasattr(self.args, 'skip_existing')
                  or not self.args.skip_existing):
              return None
  
    def faces_count(self):
        """ Return current faces count """
        return sum(len(faces) for faces in self.data.values())
  
      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))
keep keep keep keep 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