          self._detector.start()
          logger.debug("Launched Detector")
  
      def _set_extractor_batchsize(self):
          """ 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":
              logger.debug("Either detector and aligner have no VRAM requirements or not running "
                           "on Nvidia. Not updating batchsize requirements.")
              return
          stats = GPUStats().get_card_most_free()
          vram_free = int(stats["free"])
 
</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         vram_required = self._detector.vram + self._aligner.vram + self._vram_buffer
 </s> add         vram_required = (self._detector.vram +
                         self._aligner.vram +
                         self._masker.vram +
                         self._vram_buffer) </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         retval = self._is_parallel or self.phase == "align"
 </s> add         retval = self._is_parallel or self.phase == "mask" </s> remove             retval = [self._detector, self._aligner]
        elif self.passes == 2 and not self.final_pass:
 </s> add             retval = [self._detector, self._aligner, self._masker]
        elif self.passes == 3 and self.phase == 'detect':
        """ 
        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"):
          self._detector.start()
          logger.debug("Launched Detector")
  
      def _set_extractor_batchsize(self):
        """ 
        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"):
        """ 
        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"):
        """ 
        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"):
        """ 
        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"):
              logger.debug("Either detector and aligner have no VRAM requirements or not running "
                           "on Nvidia. Not updating batchsize requirements.")
              return
          stats = GPUStats().get_card_most_free()
          vram_free = int(stats["free"])
keep keep keep keep replace replace replace replace keep keep keep keep keep
 Smart Mask Exposure for Extraction & Training (#831)

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