          # From there batches increase at ~680MB per item in the batch
  
          self.batch_size = int(((vram_free - self.vram) / 680) + 2)
  
          if self.batch_size < 1:
              raise ValueError("Insufficient VRAM available to continue "
                               "({}MB)".format(int(vram_free)))
  
          logger.verbose("Processing in batches of %s", self.batch_size)
  
          self.init.set()
          logger.info("Initialized Dlib-CNN Detector...")
 
</s> remove         self.batch_size = int(((vram_free - self.vram) / 680) + 2)
 </s> add             self.batch_size = int(((vram_free - self.vram) / 680) + 2) </s> remove         # Batch size of 2 actually uses about 338MB less than a single image??
        # From there batches increase at ~680MB per item in the batch
 </s> add             # Batch size of 2 actually uses about 338MB less than a single image??
            # From there batches increase at ~680MB per item in the batch </s> remove         super().initialize(*args, **kwargs)
        logger.verbose("Initializing Dlib-CNN Detector...")
        self.detector = dlib.cnn_face_detection_model_v1(  # pylint: disable=c-extension-no-member
            self.model_path)
        is_cuda = self.compiled_for_cuda()
        if is_cuda:
            logger.debug("Using GPU")
            _, vram_free, _ = self.get_vram_free()
        else:
            logger.verbose("Using CPU")
            vram_free = 2048
 </s> add         try:
            super().initialize(*args, **kwargs)
            logger.verbose("Initializing Dlib-CNN Detector...")
            self.detector = dlib.cnn_face_detection_model_v1(  # pylint: disable=c-extension-no-member
                self.model_path)
            is_cuda = self.compiled_for_cuda()
            if is_cuda:
                logger.debug("Using GPU")
                _, vram_free, _ = self.get_vram_free()
            else:
                logger.verbose("Using CPU")
                vram_free = 2048 </s> remove         logger.verbose("Processing in batches of %s", self.batch_size)
 </s> add             logger.verbose("Processing in batches of %s", self.batch_size) </s> remove         self.init.set()
        logger.info("Initialized Dlib-CNN Detector...")
 </s> add             self.init.set()
            logger.info("Initialized Dlib-CNN Detector...")
        except Exception as err:
            self.error.set()
            raise err
            if self.batch_size < 1:
                raise ValueError("Insufficient VRAM available to continue "
                                 "({}MB)".format(int(vram_free)))
          # From there batches increase at ~680MB per item in the batch
  
          self.batch_size = int(((vram_free - self.vram) / 680) + 2)
  
            if self.batch_size < 1:
                raise ValueError("Insufficient VRAM available to continue "
                                 "({}MB)".format(int(vram_free)))
            if self.batch_size < 1:
                raise ValueError("Insufficient VRAM available to continue "
                                 "({}MB)".format(int(vram_free)))
            if self.batch_size < 1:
                raise ValueError("Insufficient VRAM available to continue "
                                 "({}MB)".format(int(vram_free)))
  
          logger.verbose("Processing in batches of %s", self.batch_size)
  
          self.init.set()
          logger.info("Initialized Dlib-CNN Detector...")
keep keep keep keep replace replace replace keep keep keep keep keep
 Better extractor error handling on initialization 
plugins/extract/detect/dlib_cnn.py