          print('Starting, this may take a while...')
  
          self.output_dir = get_folder(self.arguments.output_dir)
          try:
              self.input_dir = get_image_paths(self.arguments.input_dir)
          except:
              print('Input directory not found. Please ensure it exists.')
              exit(1)
  
          self.filter = self.load_filter()
 
</s> remove 
 </s> add         
        try:
            if self.arguments.skip_existing:
                self.already_processed = get_image_paths(self.arguments.output_dir)
        except AttributeError:
            pass
     </s> remove def get_image_paths(directory):
    return [x.path for x in scandir(directory) if
     any(map(lambda ext: x.name.lower().endswith(ext), image_extensions))]
 </s> add def get_image_paths(directory, exclude=[], debug=False):
    exclude_names = [basename(Path(x).stem[:-1] + Path(x).suffix) for x in exclude]
    dir_contents = []

    if not exists(directory):
        directory = get_folder(directory).path

    dir_scanned = list(scandir(directory))
    for x in dir_scanned:
        if any([x.name.lower().endswith(ext) for ext in image_extensions]):
            if x.name in exclude_names:
                if debug:
                    print("Already processed %s" % x.name)
                continue
            else:
                dir_contents.append(x.path)

    return dir_contents </s> remove             print('Note: Found more than one face in an image!')
 </s> add             print('Note: Found more than one face in an image! File: %s' % filename) </s> remove             print('Note: Found more than one face in an image!')
 </s> add 
            try:
                if self.arguments.skip_existing:
                    self.input_dir = get_image_paths(self.arguments.input_dir, self.already_processed)
                    print('Excluding %s files' % len(self.already_processed))
                else:
                    self.input_dir = get_image_paths(self.arguments.input_dir)
            except AttributeError:
                self.input_dir = get_image_paths(self.arguments.input_dir)
          print('Starting, this may take a while...')
  
          self.output_dir = get_folder(self.arguments.output_dir)
          try:
            try:
                if self.arguments.skip_existing:
                    self.input_dir = get_image_paths(self.arguments.input_dir, self.already_processed)
                    print('Excluding %s files' % len(self.already_processed))
                else:
                    self.input_dir = get_image_paths(self.arguments.input_dir)
            except AttributeError:
                self.input_dir = get_image_paths(self.arguments.input_dir)
          except:
              print('Input directory not found. Please ensure it exists.')
              exit(1)
  
          self.filter = self.load_filter()
keep keep keep keep replace keep keep keep keep keep
 Skip already extracted frames when using extract.py (#214)

* Pytorch and face-alignment

* Skip processed frames when extracting faces.

* Reset to master version

* Reset to master

* Added --skip-existing argument to Extract script. Default is to NOT skip already processed frames.
Added logic to write_alignments to append new alignments (and preserve existing ones)
to existing alignments file when the skip-existing option is used.

* Fixed exception for --skip-existing when using the convert script

* Sync with upstream

* Fixed error when using Convert script.

* Bug fix

* Merges alignments only if --skip-existing is used.

* Creates output dir when not found, even when using --skip-existing. 
lib/cli.py