      _actions_have_vid_input = ["extract", "get_fps", "get_info", "rescale",
                                 "rotate", "slice"]
  
      # Class variable that stores the target executable (ffmpeg or ffplay)
      _executable = 'ffmpeg'
  
      # Class variable that stores the common ffmpeg arguments based on verbosity
      __common_ffmpeg_args_dict = {"normal": "-hide_banner ",
                                   "quiet": "-loglevel panic -hide_banner ",
                                   "verbose": ''}
 
</s> remove         frames_dir = "\n\tMust Pass in a frames folder/source video file (-fr)."
        faces_dir = "\n\tMust Pass in a faces folder (-fc)."
        frames_or_faces_dir = ("\n\tMust Pass in either a frames folder/source video file OR a"
                               "\n\tfaces folder (-fr or -fc).")
        frames_and_faces_dir = ("\n\tMust Pass in a frames folder/source video file AND a faces "
                                "\n\tfolder (-fr and -fc).")
        output_opts = "\n\tUse the output option (-o) to process results."
        align_eyes = "\n\tCan optionally use the align-eyes switch (-ae)."
 </s> add         frames_dir = " Must Pass in a frames folder/source video file (-fr)."
        faces_dir = " Must Pass in a faces folder (-fc)."
        frames_or_faces_dir = (" Must Pass in either a frames folder/source video file OR a"
                               "faces folder (-fr or -fc).")
        frames_and_faces_dir = (" Must Pass in a frames folder/source video file AND a faces "
                                "folder (-fr and -fc).")
        output_opts = " Use the output option (-o) to process results."
        align_eyes = " Can optionally use the align-eyes switch (-ae)." </s> remove                               "help": "Choose which action you want ffmpeg "
                                      "ffmpeg to do.\n"
                                      "'slice' cuts a portion of the video "
                                      "into a separate video file.\n"
                                      "'get-fps' returns the chosen video's "
 </s> add                               "help": "R|Choose which action you want ffmpeg "
                                      "ffmpeg to do."
                                      "\nL|'slice' cuts a portion of the video "
                                      "into a separate video file."
                                      "\nL|'get-fps' returns the chosen video's " </s> remove                               "help": "Adjust the mean of each color channel "
                                      " in the swapped reconstruction to "
                                      "equal the mean of the masked area in "
                                      "the orginal image"})
        argument_list.append({"opts": ("-sb", "--smooth-box"),
                              "action": "store_true",
                              "dest": "smooth_box",
                              "default": False,
                              "help": "Perform a Gaussian blur on the edges of the face box "
                                      "received from the model. Helps reduce pronounced edges "
                                      "of the swap area"})
        argument_list.append({"opts": ("-dt", "--draw-transparent"),
                              "action": "store_true",
                              "dest": "draw_transparent",
                              "default": False,
                              "help": "Place the swapped face on a "
                                      "transparent layer rather than the "
                                      "original frame."})
 </s> add                               "help": "Disable multiprocessing. Slower but less resource "
                                      "intensive."})
        argument_list.append({"opts": ("-t", "--trainer"),
                              "type": str.lower,
                              "choices": PluginLoader.get_available_models(),
                              "help": "[LEGACY] This only needs to be selected if a legacy "
                                      "model is being loaded or if there are multiple models in "
                                      "the  model folder"})
 </s> remove def dfaker(landmarks, face, channels=4):
    """ Dfaker model mask
        Embeds the mask into the face alpha channel

        channels: 1, 3 or 4:
                1 - Return a single channel mask
                3 - Return a 3 channel mask
                4 - Return the original image with the mask in the alpha channel
        """
    padding = int(face.shape[0] * 0.1875)
    coverage = face.shape[0] - (padding * 2)
    logger.trace("face_shape: %s, coverage: %s, landmarks: %s", face.shape, coverage, landmarks)

    mat = umeyama(landmarks[17:], True)[0:2]
    mat = mat.reshape(-1).reshape(2, 3)
    mat = mat * coverage
    mat[:, 2] += padding

    mask = np.zeros(face.shape[0:2] + (1, ), dtype=np.float32)
    hull = cv2.convexHull(landmarks).reshape(1, -1, 2)  # pylint: disable=no-member
    hull = cv2.transform(hull, mat).reshape(-1, 2)  # pylint: disable=no-member
    cv2.fillConvexPoly(mask, hull, 255.)  # pylint: disable=no-member

    kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (15, 15))  # pylint: disable=no-member
    mask = cv2.dilate(mask, kernel, borderType=cv2.BORDER_REFLECT)  # pylint: disable=no-member
    mask = np.expand_dims(mask, axis=-1)

    return merge_mask(face, mask, channels)


def dfl_full(landmarks, face, channels=4):
    """ DFL facial mask

        channels: 1, 3 or 4:
            1 - Return a single channel mask
            3 - Return a 3 channel mask
            4 - Return the original image with the mask in the alpha channel
        """
    logger.trace("face_shape: %s, landmarks: %s", face.shape, landmarks)
    mask = np.zeros(face.shape[0:2] + (1, ), dtype=np.float32)

    nose_ridge = (landmarks[27:31], landmarks[33:34])
    jaw = (landmarks[0:17], landmarks[48:68], landmarks[0:1],
           landmarks[8:9], landmarks[16:17])
    eyes = (landmarks[17:27], landmarks[0:1], landmarks[27:28],
            landmarks[16:17], landmarks[33:34])
    parts = [jaw, nose_ridge, eyes]
 </s> add def get_available_masks():
    """ Return a list of the available masks for cli """
    masks = sorted([name for name, obj in inspect.getmembers(sys.modules[__name__])
                    if inspect.isclass(obj) and name != "Mask"])
    masks.append("none")
    logger.debug(masks)
    return masks </s> remove                     "\n'extract-large' - Extract all faces that have not been upscaled. Useful"
                    "\n\tfor excluding low-res images from a training set." +
 </s> add                     "\nL|'extract-large' - Extract all faces that have not been upscaled. Useful "
                    "for excluding low-res images from a training set." +
    _executable = im_ffm.get_ffmpeg_exe()
      _actions_have_vid_input = ["extract", "get_fps", "get_info", "rescale",
                                 "rotate", "slice"]
  
      # Class variable that stores the target executable (ffmpeg or ffplay)
    _executable = im_ffm.get_ffmpeg_exe()
  
      # Class variable that stores the common ffmpeg arguments based on verbosity
      __common_ffmpeg_args_dict = {"normal": "-hide_banner ",
                                   "quiet": "-loglevel panic -hide_banner ",
                                   "verbose": ''}
keep keep keep keep replace keep keep keep keep keep
 Convert refactor (#703)

* Separate predict and implement pool

* Add check and raise error to multithreading

Box functions to config. Add crop box option.

* All masks to mask module. Refactor convert masks

Predicted mask passed from model. Cli update

* Intesect box with mask and fixes

* Use raw NN output for convert

Use raw mask for face adjustments. Split adjustments to pre and post warp

* Separate out adjustments. Add unmask sharpen

* Set sensible defaults. Pre PR Testing

* Fix queue sizes. Move masked.py to lib

* Fix Skip Frames. Fix GUI Config popup

* Sensible queue limits. Add a less resource intensive single processing mode

* Fix predicted mask. Amend smooth box defaults

* Deterministic ordering for video output

* Video to Video convert implemented

* Fixups

- Remove defaults from folders across all stages
- Move match-hist and aca into color adjustments selectable
- Handle crashes properly for pooled processes
- Fix output directory does not exist error when creating a new output folder
- Force output to frames if input is not a video

* Add Color Transfer adjustment method

Wrap info text in GUI plugin configure popup

* Refactor image adjustments. Easier to create plugins

Start implementing config options for video encoding

* Add video encoding config options

Allow video encoding for frames input (must pass in a reference video)
Move video and image output writers to plugins

* Image writers config options

Move scaling to cli
Move draw_transparent to images config
Add config options for cv2 writer
Add Pillow image writer

* Add gif filetype to Pillow. Fix draw transparent for Pillow

* Add Animated GIF writer

standardize opencv/pillow defaults

* [speedup] Pre-encode supported writers in the convert pool (opencv, pillow)

Move scaling to convert pool
Remove dfaker mask

* Fix default writer

* Bugfixes

* Better custom argparse formatting 
tools/effmpeg.py