              missing = [filenames[idx] for idx in indices]
              msg = ("Files missing alignments for this batch: {}"
                     "\nAt least one of your images does not have a matching entry in your "
                     "alignments file."
                     "\nIf you are training with a mask or using 'warp to landmarks' then every "
                     "face you intend to train on must exist within the alignments file."
                     "\nThe specific files that caused this failure are listed above."
                     "\nMost likely there will be more than just these files missing from the "
                     "alignments file. You can use the Alignments Tool to help identify missing "
                     "alignments".format(missing))
 
</s> remove             loss = self.model.predictors[self.side].train_on_batch(*batch)
 </s> add             loss = self.model.predictors[self.side].train_on_batch(x=model_inputs, y=model_targets) </s> remove         argument_list.append({
            "opts": ("-D", "--detector"),
            "action": Radio,
            "type": str.lower,
            "choices":  PluginLoader.get_available_extractors("detect"),
            "default": default_detector,
            "group": "Plugins",
            "help": "R|Detector to use. Some of these have configurable settings in "
                    "'/config/extract.ini' or 'Settings > Configure Extract Plugins':"
                    "\nL|cv2-dnn: A CPU only extractor, is the least reliable, but uses least "
                    "resources and runs fast on CPU. Use this if not using a GPU and time is "
                    "important."
                    "\nL|mtcnn: Fast on CPU, Faster on GPU. Uses far fewer resources than other "
                    "GPU detectors but can often return more false positives."
                    "\nL|s3fd: 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."})
        argument_list.append({
            "opts": ("-A", "--aligner"),
            "action": Radio,
            "type": str.lower,
            "choices": PluginLoader.get_available_extractors("align"),
            "default": default_aligner,
            "group": "Plugins",
            "help": "R|Aligner to use."
                    "\nL|cv2-dnn: A cpu only CNN based landmark detector. Faster, less "
                    "resource intensive, but less accurate. Only use this if not using a gpu "
                    " and time is important."
                    "\nL|fan: Face Alignment Network. Best aligner. GPU "
                    "heavy, slow when not running on GPU"})
 </s> add         argument_list.append({"opts": ("-D", "--detector"),
                              "action": Radio,
                              "type": str.lower,
                              "choices":  PluginLoader.get_available_extractors("detect"),
                              "default": default_detector,
                              "group": "Plugins",
                              "help": "R|Detector to use. Some of these have configurable "
                                      "settings in '/config/extract.ini' or 'Settings > Configure "
                                      "Extract 'Plugins':"
                                      "\nL|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."
                                      "\nL|mtcnn: Good detector. Fast on CPU, faster on GPU. Uses "
                                      "fewer resources than other GPU detectors but can often "
                                      "return more false positives."
                                      "\nL|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."})
        argument_list.append({"opts": ("-A", "--aligner"),
                              "action": Radio,
                              "type": str.lower,
                              "choices": PluginLoader.get_available_extractors("align"),
                              "default": default_aligner,
                              "group": "Plugins",
                              "help": "R|Aligner to use."
                                      "\nL|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."
                                      "\nL|fan: Best aligner. Fast on GPU, slow on CPU."})
        argument_list.append({"opts": ("-M", "--masker"),
                              "action": Radio,
                              "type": str.lower,
                              "choices": PluginLoader.get_available_extractors("mask"),
                              "default": "components",
                              "group": "Plugins",
                              "help": "R|Masker to use."
                                      "\nL|none: An array of all ones is created to provide a 4th "
                                      "channel that will not mask any portion of the image."
                                      "\nL|components: Mask designed to provide facial "
                                      "segmentation based on the positioning of landmark "
                                      "locations. A convenx hull is constructed around the "
                                      "exterior of the landmarks to create a mask."
                                      "\nL|extended: Mask designed to provide facial segmentation "
                                      "based on the positioning of landmark locations. A convenx "
                                      "hull is constructed around the exterior of the landmarks "
                                      "and the mask is extended upwards onto the forehead."
                                      "\nL|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."
                                      "\nL|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."
                                      "\nL|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."}) </s> remove                     "not trained with a mask then this will fallback to "
                    "'{}'".format(get_default_mask()) +
 </s> add                     "not trained with a mask then this will fallback to components." </s> remove         batch = self.get_next(do_preview)
 </s> add         model_inputs, model_targets = self.get_next() </s> remove             section=section, title="mask_type", datatype=str, default="none",
            choices=get_available_masks(), group="mask",
            info="The mask to be used for training:"
                 "\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 extended: Based on components mask. Extends the eyebrow points to further "
                 "up the forehead. May perform badly on difficult angles."
                 "\n\t facehull: Face cutout based on landmarks")
 </s> add             section=section, title="replicate_input_mask", datatype=bool,
            default=False, group="mask",
            info="Dedicate portions of the model to learning how to duplicate the input "
                 "mask. Increases VRAM usage in exchange for a learning a quick ability "
                 "to try to replicate more complex mask models.")
                   "\nIf you are using 'warp to landmarks' then every "
              missing = [filenames[idx] for idx in indices]
              msg = ("Files missing alignments for this batch: {}"
                     "\nAt least one of your images does not have a matching entry in your "
                     "alignments file."
                   "\nIf you are using 'warp to landmarks' then every "
                     "face you intend to train on must exist within the alignments file."
                     "\nThe specific files that caused this failure are listed above."
                     "\nMost likely there will be more than just these files missing from the "
                     "alignments file. You can use the Alignments Tool to help identify missing "
                     "alignments".format(missing))
keep keep keep keep replace keep keep keep keep keep
 Smart Mask Exposure for Extraction & Training (#831)

Smart Masks - Initial Commit 
lib/training_data.py