Cannot Extract any more: error: argument -M/--masker: invalid choice: 'none'

The Extraction process failing on you, and you aren't getting an error back with clear instructions? Tell us about it here


Forum rules

Read the FAQs and search the forum before posting a new topic.

This forum is for reporting errors with the Extraction process. If you want to get tips, or better understand the Extract process, then you should look in the Extract Discussion forum.

Please mark any answers that fixed your problems so others can find the solutions.

Locked
User avatar
Grassone
Posts: 45
Joined: Sun Apr 19, 2020 7:32 pm
Has thanked: 6 times
Been thanked: 2 times

Cannot Extract any more: error: argument -M/--masker: invalid choice: 'none'

Post by Grassone »

After the last update, the choice Masker "none" has gone away... and if no matter which masker I choose, the process halts.

Here is what comes out.

masker.JPG
masker.JPG (19.59 KiB) Viewed 4371 times

Loading...
Setting Faceswap backend to NVIDIA
usage: faceswap.py extract [-h] [-C CONFIGFILE]
[-L {INFO,VERBOSE,DEBUG,TRACE}] [-LF LOGFILE] -i
INPUT_DIR -o OUTPUT_DIR [-al ALIGNMENTS_PATH]
[-D {cv2-dnn,mtcnn,s3fd}] [-A {cv2-dnn,fan}]
[-M {unet-dfl,vgg-clear,vgg-obstructed} [{unet-dfl,vgg-clear,vgg-obstructed} ...]]
[-nm {none,clahe,hist,mean}] [-r ROTATE_IMAGES]
[-min MIN_SIZE] [-n NFILTER [NFILTER ...]]
Process exited.[-f FILTER [FILTER ...]] [-l REF_THRESHOLD]

[-een EXTRACT_EVERY_N] [-sz SIZE]
[-si SAVE_INTERVAL] [-dl] [-sp] [-s] [-sf]

Extract the faces from pictures

optional arguments:
-h, --help show this help message and exit
-C CONFIGFILE, --configfile CONFIGFILE
Optionally overide the saved config with the path to a
custom config file.
-L {INFO,VERBOSE,DEBUG,TRACE}, --loglevel {INFO,VERBOSE,DEBUG,TRACE}
Log level. Stick with INFO or VERBOSE unless you need
to file an error report. Be careful with TRACE as it
will generate a lot of data
-LF LOGFILE, --logfile LOGFILE
Path to store the logfile. Leave blank to store in the
faceswap folder
-i INPUT_DIR, --input-dir INPUT_DIR
Input directory or video. Either a directory
containing the image files you wish to process or path
to a video file. NB: This should be the source
video/frames NOT the source faces.
-o OUTPUT_DIR, --output-dir OUTPUT_DIR
Output directory. This is where the converted files
will be saved.
-al ALIGNMENTS_PATH, --alignments ALIGNMENTS_PATH
Optional path to an alignments file. Leave blank if
the alignments file is at the default location.
-D {cv2-dnn,mtcnn,s3fd}, --detector {cv2-dnn,mtcnn,s3fd}
Detector to use. Some of these have configurable
settings in '/config/extract.ini' or 'Settings >
Configure Extract 'Plugins':

  • cv2-dnn: A CPU only extractor which is the least
    reliable and least resource intensive. Use this if
    not using a GPU and time is important.
  • mtcnn: Good detector. Fast on CPU, faster on GPU.
    Uses fewer resources than other GPU detectors but
    can often return more false positives.
  • s3fd: Best detector. Fast on GPU, slow on CPU. Can
    detect more faces and fewer false positives than
    other GPU detectors, but is a lot more resource
    intensive.
    -A {cv2-dnn,fan}, --aligner {cv2-dnn,fan}
    Aligner to use.
  • cv2-dnn: A CPU only landmark detector. Faster,
    less resource intensive, but less accurate. Only
    use this if not using a GPU and time is important.
  • fan: Best aligner. Fast on GPU, slow on CPU.
    -M {unet-dfl,vgg-clear,vgg-obstructed} [{unet-dfl,vgg-clear,vgg-obstructed} ...], --masker {unet-dfl,vgg-clear,vgg-obstructed} [{unet-dfl,vgg-clear,vgg-obstructed} ...]
    Additional Masker(s) to use. The masks generated here
    will all take up GPU RAM. You can select none, one or
    multiple masks, but the extraction may take longer the
    more you select. NB: The Extended and Components
    (landmark based) masks are automatically generated on
    extraction.
  • vgg-clear: Mask designed to provide smart
    segmentation of mostly frontal faces clear of
    obstructions. Profile faces and obstructions may
    result in sub-par performance.
  • vgg-obstructed: Mask designed to provide smart
    segmentation of mostly frontal faces. The mask
    model has been specifically trained to recognize
    some facial obstructions (hands and eyeglasses).
    Profile faces may result in sub-par performance.
  • unet-dfl: Mask designed to provide smart
    segmentation of mostly frontal faces. The mask
    model has been trained by community members and
    will need testing for further description. Profile
    faces may result in sub-par performance.
    The auto generated masks are as follows:
  • components: Mask designed to provide facial
    segmentation based on the positioning of landmark
    locations. A convex hull is constructed around the
    exterior of the landmarks to create a mask.
  • extended: Mask designed to provide facial
    segmentation based on the positioning of landmark
    locations. A convex hull is constructed around the
    exterior of the landmarks and the mask is extended
    upwards onto the forehead.
    (eg: -M unet-dfl vgg-clear, --masker vgg-
    obstructed
    )
    -nm {none,clahe,hist,mean}, --normalization {none,clahe,hist,mean}
    Performing normalization can help the aligner better
    align faces with difficult lighting conditions at an
    extraction speed cost. Different methods will yield
    different results on different sets. NB: This does not
    impact the output face, just the input to the aligner.
  • none: Don't perform normalization on the face.
  • clahe: Perform Contrast Limited Adaptive Histogram
    Equalization on the face.
  • hist: Equalize the histograms on the RGB channels.
  • mean: Normalize the face colors to the mean.
    -r ROTATE_IMAGES, --rotate-images ROTATE_IMAGES
    If a face isn't found, rotate the images to try to
    find a face. Can find more faces at the cost of
    extraction speed. Pass in a single number to use
    increments of that size up to 360, or pass in a list
    of numbers to enumerate exactly what angles to check.
    -min MIN_SIZE, --min-size MIN_SIZE
    Filters out faces detected below this size. Length, in
    pixels across the diagonal of the bounding box. Set to
    0 for off
    -n NFILTER [NFILTER ...], --nfilter NFILTER [NFILTER ...]
    Optionally filter out people who you do not wish to
    process by passing in an image of that person. Should
    be a front portrait with a single person in the image.
    Multiple images can be added space separated. NB:
    Using face filter will significantly decrease
    extraction speed and its accuracy cannot be
    guaranteed.
    -f FILTER [FILTER ...], --filter FILTER [FILTER ...]
    Optionally select people you wish to process by
    passing in an image of that person. Should be a front
    portrait with a single person in the image. Multiple
    images can be added space separated. NB: Using face
    filter will significantly decrease extraction speed
    and its accuracy cannot be guaranteed.
    -l REF_THRESHOLD, --ref_threshold REF_THRESHOLD
    For use with the optional nfilter/filter files.
    Threshold for positive face recognition. Lower values
    are stricter. NB: Using face filter will significantly
    decrease extraction speed and its accuracy cannot be
    guaranteed.
    -een EXTRACT_EVERY_N, --extract-every-n EXTRACT_EVERY_N
    Extract every 'nth' frame. This option will skip
    frames when extracting faces. For example a value of 1
    will extract faces from every frame, a value of 10
    will extract faces from every 10th frame.
    -sz SIZE, --size SIZE
    The output size of extracted faces. Make sure that the
    model you intend to train supports your required size.
    This will only need to be changed for hi-res models.
    -si SAVE_INTERVAL, --save-interval SAVE_INTERVAL
    Automatically save the alignments file after a set
    amount of frames. By default the alignments file is
    only saved at the end of the extraction process. NB:
    If extracting in 2 passes then the alignments file
    will only start to be saved out during the second
    pass. WARNING: Don't interrupt the script when writing
    the file because it might get corrupted. Set to 0 to
    turn off
    -dl, --debug-landmarks
    Draw landmarks on the ouput faces for debugging
    purposes.
    -sp, --singleprocess Don't run extraction in parallel. Will run each part
    of the extraction process separately (one after the
    other) rather than all at the smae time. Useful if
    VRAM is at a premium.
    -s, --skip-existing Skips frames that have already been extracted and
    exist in the alignments file
    -sf, --skip-existing-faces
    Skip frames that already have detected faces in the
    alignments file

Questions and feedback: https://faceswap.dev/forum
faceswap.py extract: error: argument -M/--masker: invalid choice: 'none' (choose from 'unet-dfl', 'vgg-clear', 'vgg-obstructed')

by torzdf » Sun Apr 26, 2020 1:43 pm

I have pushed a fix that should reset any invalid choices to default when loading from a .fsw file if the command line options have changed.

Go to full post
User avatar
torzdf
Posts: 2671
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 131 times
Been thanked: 625 times

Re: Cannot Extract any more:

Post by torzdf »

Huh? I'll need to look into that....

In the meantime, I assume you opened a .fsw file? If so, then you can manually open that file and delete the masker option, re-open the file in faceswap and you should then be able to select a masker

My word is final

User avatar
Grassone
Posts: 45
Joined: Sun Apr 19, 2020 7:32 pm
Has thanked: 6 times
Been thanked: 2 times

Re: Cannot Extract any more:

Post by Grassone »

UPDATE:

Apparently it depends on some info in the project file:

I had been able to extract again in a "blank" project. This is what came out:

1) Stopped the training, try to extract new faces from a new clip ---> Cannot do that
2)Ok... then... exit the original project, create a new one... training works again.
3) Sort, clean and merge (always from the new project)
4) Reopen the old project, update the merged file into the trainer...

It works!

User avatar
torzdf
Posts: 2671
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 131 times
Been thanked: 625 times

Re: Cannot Extract any more:

Post by torzdf »

I will push a fix at some point today which fixes this

My word is final

User avatar
torzdf
Posts: 2671
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 131 times
Been thanked: 625 times

Re: Cannot Extract any more: error: argument -M/--masker: invalid choice: 'none'

Post by torzdf »

I have pushed a fix that should reset any invalid choices to default when loading from a .fsw file if the command line options have changed.

My word is final

User avatar
Grassone
Posts: 45
Joined: Sun Apr 19, 2020 7:32 pm
Has thanked: 6 times
Been thanked: 2 times

Re: Cannot Extract any more: error: argument -M/--masker: invalid choice: 'none'

Post by Grassone »

Tried it... now It works!

THNX

Locked