          argument_list.append({"opts": ("-aca", "--avg-color-adjust"),
                                "action": "store_true",
                                "dest": "avg_color_adjust",
                                "default": False,
                                "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."})
          return argument_list
  
  
  class TrainArgs(FaceSwapArgs):
      """ Class to parse the command line arguments for training """
 
</s> remove                               "dest": "avg_color_adjust",
 </s> add  </s> remove         argument_list.append({"opts": ("-S", "--seamless"),
                              "action": "store_true",
                              "dest": "seamless_clone",
                              "default": False,
                              "help": "Use cv2's seamless clone function to "
                                      "remove extreme gradients at the mask "
                                      "seam by smoothing colors."})
        argument_list.append({"opts": ("-mh", "--match-histogram"),
                              "action": "store_true",
                              "dest": "match_histogram",
                              "default": False,
                              "help": "Adjust the histogram of each color "
                                      "channel in the swapped reconstruction "
                                      "to equal the histogram of the masked "
                                      "area in the orginal image"})
        argument_list.append({"opts": ("-aca", "--avg-color-adjust"),
 </s> add         argument_list.append({"opts": ("-sp", "--singleprocess"), </s> remove         argument_list.append({"opts": ("-t", "--trainer"),
                              "action": Radio,
                              "type": str.lower,
                              "choices": PluginLoader.get_available_models(),
                              "default": PluginLoader.get_default_model(),
                              "help": "Select the trainer that was used to "
                                      "create the model"})
        argument_list.append({"opts": ("-c", "--converter"),
                              "action": Radio,
                              "type": str.lower,
                              "choices": PluginLoader.get_available_converters(),
                              "default": "masked",
                              "help": "Converter to use"})
 </s> add         argument_list.append({"opts": ("-ref", "--reference-video"),
                              "action": FileFullPaths,
                              "dest": "reference_video",
                              "filetypes": "video",
                              "type": str,
                              "help": "Only required if converting from images to video. Provide "
                                      "The original video that the source frames were extracted "
                                      "from (for extracting the fps and audio)."})
        argument_list.append({
            "opts": ("-c", "--color-adjustment"),
            "action": Radio,
            "type": str.lower,
            "dest": "color_adjustment",
            "choices": PluginLoader.get_available_convert_plugins("color", True),
            "default": "avg-color",
            "help": "R|Performs color adjustment to the swapped face. Some of these options have "
                    "configurable settings in '/config/convert.ini' or 'Edit > Configure "
                    "Convert Plugins':"
                    "\nL|avg-color: Adjust the mean of each color channel in the swapped "
                    "reconstruction to equal the mean of the masked area in the orginal image."
                    "\nL|color-transfer: Transfers the color distribution from the source to the "
                    "target image using the mean and standard deviations of the L*a*b* "
                    "color space."
                    "\nL|match-hist: Adjust the histogram of each color channel in the swapped "
                    "reconstruction to equal the histogram of the masked area in the orginal "
                    "image."
                    "\nL|seamless-clone: Use cv2's seamless clone function to remove extreme "
                    "gradients at the mask seam by smoothing colors. Generally does not give "
                    "very satisfactory results."
                    "\nL|none: Don't perform color adjustment."})
        argument_list.append({
            "opts": ("-sc", "--scaling"),
            "action": Radio,
            "type": str.lower,
            "choices": PluginLoader.get_available_convert_plugins("scaling", True),
            "default": "none",
            "help": "R|Performs a scaling process to attempt to get better definition on the "
                    "final swap. Some of these options have configurable settings in "
                    "'/config/convert.ini' or 'Edit > Configure Convert Plugins':"
                    "\nL|sharpen: Perform sharpening on the final face."
                    "\nL|none: Don't perform any scaling operations."}) </s> remove                               "help": "When used with --frame-ranges discards "
                                      "frames that are not processed instead "
                                      "of writing them out unchanged"})
 </s> add                               "help": "When used with --frame-ranges outputs the unchanged frames "
                                      "that are not processed instead of discarding them."}) </s> remove                               "dest": "discard_frames",
 </s> add                               "dest": "keep_unchanged",
                              "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"})

          argument_list.append({"opts": ("-aca", "--avg-color-adjust"),
                                "action": "store_true",
                                "dest": "avg_color_adjust",
                                "default": False,
                              "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"})

                              "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"})

                              "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"})

                              "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"})

                              "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"})

                              "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"})

                              "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"})

                              "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"})

                              "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"})

                              "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"})

                              "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"})

                              "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"})

                              "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"})

                              "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"})

                              "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"})

                              "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"})

                              "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"})

                              "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"})

          return argument_list
  
  
  class TrainArgs(FaceSwapArgs):
      """ Class to parse the command line arguments for training """
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace 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 
lib/cli.py