      def add_comboboxes(self, parent, defaults):
          """ Add the comboboxes to the Action Frame """
          for opt in self.options:
              if opt == "mask_type":
                  choices = get_available_masks() + ["predicted"]
              else:
                  choices = PluginLoader.get_available_convert_plugins(opt, True)
              choices = [self.format_to_display(choice) for choice in choices]
              ctl = ControlBuilder(parent,
                                   opt,
 
</s> remove         for task in ("extract_detect_in", "extract_align_in", "extract_align_out"):
 </s> add         tasks = ["extract_detect_in", "extract_align_in", "extract_mask_in", "extract_mask_out"]
        for task in tasks: </s> remove         if self.use_mask:
            batch = [[batch["feed"], batch["masks"]], batch["targets"] + [batch["masks"]]]
        else:
            batch = [batch["feed"], batch["targets"]]
        self.generate_preview(do_preview)
        return batch
 </s> add         targets_use_mask = self.model.training_opts["replicate_input_mask"]
        model_inputs = batch["feed"] + batch["masks"] if self.use_mask else batch["feed"]
        model_targets = batch["targets"] + batch["masks"] if targets_use_mask else batch["targets"]
        return model_inputs, model_targets </s> remove         mask_idx = [idx for idx, name in enumerate(output_network.output_names)
                    if name.startswith("mask")]
        if mask_idx:
            # Add the final mask shape as input
            mask_shape = output_network.output_shapes[mask_idx[0]]
            inputs.append(Input(shape=mask_shape[1:], name="mask_in"))
 </s> add         if self.config["replicate_input_mask"] or self.config["penalized_mask_loss"]:
            # penalized mask doesn't have a mask ouput, so we can't use output shapes
            # mask should always be last output..this needs to be a rule
            mask_shape = output_network.output_shapes[-1]
            inputs.append(Input(shape=(mask_shape[1:-1] + (1,)), name="mask_in")) </s> remove             logger.debug("Switching to align phase")
            self.phase = "align"
 </s> add             self.phase = "align" if self.phase == "detect" else "mask"
            logger.debug("Switching to %s phase", self.phase)
                choices = ["dfl_full", "components", "extended", "predicted"]
      def add_comboboxes(self, parent, defaults):
          """ Add the comboboxes to the Action Frame """
          for opt in self.options:
              if opt == "mask_type":
                choices = ["dfl_full", "components", "extended", "predicted"]
              else:
                  choices = PluginLoader.get_available_convert_plugins(opt, True)
              choices = [self.format_to_display(choice) for choice in choices]
              ctl = ControlBuilder(parent,
                                   opt,
keep keep keep keep replace keep keep keep keep keep
 Smart Mask Exposure for Extraction & Training (#831)

Smart Masks - Initial Commit 
tools/preview.py