                                              model_output_size,
                                              training_opts.get("coverage_ratio", 0.625))
          logger.debug("Initialized %s", self.__class__.__name__)
  
      def set_mask_function(self):
          """ Set the mask function to use if using mask """
          mask_type = self.training_opts.get("mask_type", None)
          if mask_type:
              logger.debug("Mask type: '%s'", mask_type)
              mask_func = getattr(masks, mask_type)
 
</s> remove             mask_func = getattr(masks, mask_type)
 </s> add             mask_class = getattr(masks, mask_type) </s> remove             mask_func = None
        logger.debug("Mask function: %s", mask_func)
        return mask_func
 </s> add             mask_class = None
        logger.debug("Mask class: %s", mask_class)
        return mask_class </s> remove         self.mask_function = self.set_mask_function()
 </s> add         self.mask_class = self.set_mask_class() </s> remove              "\n\tnone: Doesn't use any mask."
             "\n\tdfaker: A basic face hull mask using a facehull of all 68 landmarks."
             "\n\tdfl_full: An improved face hull mask using a facehull of 3 facial parts"
             "\n\tcomponents: An improved face hull mask using a facehull of 8 facial parts")
 </s> add              "\n\t none: Doesn't use any mask."
             "\n\t components: An improved face hull mask using a facehull of 8 facial parts"
             "\n\t dfl_full: An improved face hull mask using a facehull of 3 facial parts"
             "\n\t facehull: Face cutout based on landmarks") </s> remove MASK_TYPES = ["none", "dfaker", "dfl_full", "components"]
 </s> add MASK_TYPES = get_available_masks()
    def set_mask_class(self):
                                              model_output_size,
                                              training_opts.get("coverage_ratio", 0.625))
          logger.debug("Initialized %s", self.__class__.__name__)
  
    def set_mask_class(self):
          """ Set the mask function to use if using mask """
          mask_type = self.training_opts.get("mask_type", None)
          if mask_type:
              logger.debug("Mask type: '%s'", mask_type)
              mask_func = getattr(masks, mask_type)
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 
lib/training_data.py