          if get_backend() == "amd":
              logger.debug("Parallel processing discabled by amd")
              return False
  
          vram_required = self._detector.vram + self._aligner.vram + self._vram_buffer
          stats = gpu_stats.get_card_most_free()
          vram_free = int(stats["free"])
          logger.verbose("%s - %sMB free of %sMB",
                         stats["device"],
                         vram_free,
 
</s> remove             vram_required = self._detector.vram + self._aligner.vram + self._vram_buffer
            batch_required = ((self._aligner.vram_per_batch * self._aligner.batchsize) +
                              (self._detector.vram_per_batch * self._detector.batchsize))
 </s> add             vram_required = (self._detector.vram + self._aligner.vram + self._masker.vram +
                             self._vram_buffer)
            batch_required = ((self._detector.vram_per_batch * self._detector.batchsize) +
                              (self._aligner.vram_per_batch * self._aligner.batchsize) +
                              (self._masker.vram_per_batch * self._masker.batchsize)) </s> remove         """ Sets the batchsize of the requested plugins based on their vram and
            vram_per_batch_requirements if the the configured batchsize requires more
            vram than is available. Nvidia only. """
        if (self._detector.vram == 0 and self._aligner.vram == 0) or get_backend() != "nvidia":
 </s> add         """ 
        Sets the batchsize of the requested plugins based on their vram and
        vram_per_batch_requirements if the the configured batchsize requires more
        vram than is available. Nvidia only.
        """
        if (self._detector.vram == 0 and self._aligner.vram == 0 and self._masker.vram == 0
            or get_backend() != "nvidia"): </s> remove         """ Set whether to run detect and align together or separately """
        if self._detector.vram == 0 or self._aligner.vram == 0:
            logger.debug("At least one of aligner or detector have no VRAM requirement. "
                         "Enabling parallel processing.")
            return True
 </s> add         """ Set whether to run detect, align, and mask together or separately """ </s> remove             for plugin in (self._aligner, self._detector):
 </s> add             for plugin in (self._detector, self._aligner, self._masker): </s> remove             # Hacky split across 2 plugins
            available_vram = (vram_free - vram_required) // 2
            for plugin in (self._aligner, self._detector):
 </s> add             # Hacky split across 3 plugins
            available_vram = (vram_free - vram_required) // 3
            for plugin in (self._detector, self._aligner, self._masker):
        vram_required = (self._detector.vram +
                         self._aligner.vram +
                         self._masker.vram +
                         self._vram_buffer)
          if get_backend() == "amd":
              logger.debug("Parallel processing discabled by amd")
              return False
  
        vram_required = (self._detector.vram +
                         self._aligner.vram +
                         self._masker.vram +
                         self._vram_buffer)
          stats = gpu_stats.get_card_most_free()
          vram_free = int(stats["free"])
          logger.verbose("%s - %sMB free of %sMB",
                         stats["device"],
                         vram_free,
keep keep keep keep replace keep keep keep keep keep
 Smart Mask Exposure for Extraction & Training (#831)

Smart Masks - Initial Commit 
plugins/extract/pipeline.py