  import argparse
  import sys
  
  from pathlib import Path
  from scandir import scandir
  
 
</s> remove         )
 </s> add             ) </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  </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)
from os.path import basename, exists
  import argparse
  import sys
from os.path import basename, exists
  
  from pathlib import Path
  from scandir import scandir
  
keep add 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/utils.py