def process(self): """ Perform the extraction process """ logger.info('Starting, this may take a while...') # queue_manager.debug_monitor(3) self.threaded_io("load") save_thread = self.threaded_io("save") self.run_extraction() save_thread.join() self.alignments.save() Utils.finalize(self.images.images_found // self.skip_num, self.alignments.faces_count, self.verify_output)
def process(self): """ Perform the extraction process """ print('Starting, this may take a while...') Utils.set_verbosity(self.args.verbose) # queue_manager.debug_monitor(1) self.threaded_io("load") save_thread = self.threaded_io("save") self.run_extraction(save_thread) self.alignments.save() Utils.finalize(self.images.images_found, self.alignments.faces_count(), self.verify_output)
def process(self): """ Process the conversion """ logger.debug("Starting Conversion") # queue_manager.debug_monitor(3) self.convert_images() self.disk_io.save_thread.join() queue_manager.terminate_queues() Utils.finalize(self.images.images_found, self.predictor.faces_count, self.predictor.verify_output) logger.debug("Completed Conversion")
def process(self): """ Process the conversion """ logger.debug("Starting Conversion") # queue_manager.debug_monitor(2) self.convert_images() self.disk_io.save_thread.join() queue_manager.terminate_queues() Utils.finalize(self.images.images_found, self.predictor.faces_count, self.predictor.verify_output) logger.debug("Completed Conversion")
def process(self): """ The entry point for triggering the Extraction Process. Should only be called from :class:`lib.cli.ScriptExecutor` """ logger.info('Starting, this may take a while...') # from lib.queue_manager import queue_manager ; queue_manager.debug_monitor(3) self._threaded_redirector("load") self._run_extraction() for thread in self._threads: thread.join() self._alignments.save() Utils.finalize(self._images.process_count + self._existing_count, self._alignments.faces_count, self._verify_output)
def process(self): """ Process the conversion """ logger.debug("Starting Conversion") # queue_manager.debug_monitor(5) try: self.convert_images() self.disk_io.save_thread.join() queue_manager.terminate_queues() Utils.finalize(self.images.images_found, self.predictor.faces_count, self.predictor.verify_output) logger.debug("Completed Conversion") except MemoryError as err: msg = ("Faceswap ran out of RAM running convert. Conversion is very system RAM " "heavy, so this can happen in certain circumstances when you have a lot of " "cpus but not enough RAM to support them all." "\nYou should lower the number of processes in use by either setting the " "'singleprocess' flag (-sp) or lowering the number of parallel jobs (-j).") raise FaceswapError(msg) from err
def process(self): """ Original & LowMem models go with Adjust or Masked converter Note: GAN prediction outputs a mask + an image, while other predicts only an image """ Utils.set_verbosity(self.args.verbose) if not self.alignments.have_alignments_file: self.generate_alignments() self.faces.faces_detected = self.alignments.read_alignments() model = self.load_model() converter = self.load_converter(model) batch = BackgroundGenerator(self.prepare_images(), 1) for item in batch.iterator(): self.convert(converter, item) Utils.finalize(self.images.images_found, self.faces.num_faces_detected, self.faces.verify_output)
def process(self): """ Original & LowMem models go with Adjust or Masked converter Note: GAN prediction outputs a mask + an image, while other predicts only an image. """ Utils.set_verbosity(self.args.loglevel) if not self.alignments.have_alignments_file: self.load_extractor() model = self.load_model() converter = self.load_converter(model) batch = BackgroundGenerator(self.prepare_images(), 1) for item in batch.iterator(): self.convert(converter, item) if self.extract_faces: queue_manager.terminate_queues() Utils.finalize(self.images.images_found, self.faces_count, self.verify_output)
def process(self): """ Original & LowMem models go with Adjust or Masked converter Note: GAN prediction outputs a mask + an image, while other predicts only an image. """ Utils.set_verbosity(self.args.verbose) if not self.alignments.have_alignments_file: self.generate_alignments() self.faces.faces_detected = self.alignments.read_alignments() model = self.load_model() converter = self.load_converter(model) batch = BackgroundGenerator(self.prepare_images(), 1) for item in batch.iterator(): self.convert(converter, item) Utils.finalize(self.images.images_found, self.faces.num_faces_detected, self.faces.verify_output)
def process(self): """ Perform the extraction process """ print('Starting, this may take a while...') Utils.set_verbosity(self.args.verbose) if hasattr(self.args, 'processes') and self.args.processes > 1: self.extract_multi_process() else: self.extract_single_process() self.alignments.write_alignments(self.faces.faces_detected) images, faces = Utils.finalize(self.images.images_found, self.faces.num_faces_detected, self.faces.verify_output) self.images.images_found = images self.faces.num_faces_detected = faces
def process(self): """ Perform the extraction process """ print('Starting, this may take a while...') Utils.set_verbosity(self.args.verbose) if (hasattr(self.args, 'multiprocess') and self.args.multiprocess and GPUStats().device_count == 0): # TODO Checking that there is no available GPU is not # necessarily an indicator of whether the user is actually # using the CPU. Maybe look to implement further checks on # dlib/tensorflow compilations self.extract_multi_process() else: self.extract_single_process() self.write_alignments() images, faces = Utils.finalize(self.images.images_found, self.faces.num_faces_detected, self.faces.verify_output) self.images.images_found = images self.faces.num_faces_detected = faces