              filename, output_file, resized_face, idx = item
              out_filename = "{}_{}{}".format(str(output_file),
                                              str(idx),
                                              Path(filename).suffix)
              # pylint: disable=no-member
              cv2.imwrite(out_filename, resized_face)
  
      def run_extraction(self, save_thread):
          """ Run Face Detection """
          to_process = self.process_item_count()
          frame_no = 0
 
</s> remove             yield filename, cv2.imread(filename)  # pylint: disable=no-member
 </s> add             logger.trace("Loading image: '%s'", filename)
            try:
                image = cv2.imread(filename)  # pylint: disable=no-member
            except Exception as err:  # pylint: disable=broad-except
                logger.error("Failed to load image '%s'. Original Error: %s", filename, err)
                continue
            yield filename, image </s> remove                 filename, image = item
                detect_image = self.compile_detection_image(image, False, False)

                for angle in self.rotation:
                    current_image, rotmat = self.rotate_image(detect_image, angle)
                    faces, points = detect_face(current_image, **self.kwargs)
                    if self.verbose and angle != 0 and faces.any():
                        print("found face(s) by rotating image {} degrees".format(
                            angle))
                    if faces.any():
                        break

                detected_faces = self.process_output(faces, points, rotmat)
                retval = {
                    "filename": filename,
                    "image": image,
                    "detected_faces": detected_faces}
                self.finalize(retval)
        except:
            retval = {"exception": True}
            self.queues["out"].put(retval)
            raise
 </s> add             detected_faces = self.process_output(faces, points, rotmat)
            item["detected_faces"] = detected_faces
            self.finalize(item)

        logger.debug("Thread Completed Detect") </s> remove         try:
            while True:
                item = self.queues["in"].get()
                if item == "EOF":
                    self.queues["in"].put(item)
 </s> add         logger.debug("Launching Detect")
        while True:
            item = self.get_item()
            if item == "EOF":
                break
            logger.trace("Detecting faces: '%s'", item["filename"])
            detect_image = self.compile_detection_image(item["image"], False, False)

            for angle in self.rotation:
                current_image, rotmat = self.rotate_image(detect_image, angle)
                faces, points = detect_face(current_image, **self.kwargs)
                if angle != 0 and faces.any():
                    logger.verbose("found face(s) by rotating image %s degrees", angle)
                if faces.any():
            logger.trace("Saving face: '%s'", out_filename)
            try:
                cv2.imwrite(out_filename, resized_face)  # pylint: disable=no-member
            except Exception as err:  # pylint: disable=broad-except
                logger.error("Failed to save image '%s'. Original Error: %s", out_filename, err)
                continue
        logger.debug("Save Faces: Complete")
              filename, output_file, resized_face, idx = item
              out_filename = "{}_{}{}".format(str(output_file),
                                              str(idx),
                                              Path(filename).suffix)
            logger.trace("Saving face: '%s'", out_filename)
            try:
                cv2.imwrite(out_filename, resized_face)  # pylint: disable=no-member
            except Exception as err:  # pylint: disable=broad-except
                logger.error("Failed to save image '%s'. Original Error: %s", out_filename, err)
                continue
        logger.debug("Save Faces: Complete")
            logger.trace("Saving face: '%s'", out_filename)
            try:
                cv2.imwrite(out_filename, resized_face)  # pylint: disable=no-member
            except Exception as err:  # pylint: disable=broad-except
                logger.error("Failed to save image '%s'. Original Error: %s", out_filename, err)
                continue
        logger.debug("Save Faces: Complete")
  
      def run_extraction(self, save_thread):
          """ Run Face Detection """
          to_process = self.process_item_count()
          frame_no = 0
keep keep keep keep replace replace keep keep keep keep keep
 Logging (#541)

* Convert prints to logger. Further logging improvements. Tidy  up

* Fix system verbosity. Allow SystemExit

* Fix reload extract bug

* Child Traceback handling

* Safer shutdown procedure

* Add shutdown event to queue manager

* landmarks_as_xy > property. GUI notes + linting. Aligner bugfix

* fix FaceFilter. Enable nFilter when no Filter is supplied

* Fix blurry face filter

* Continue on IO error. Better error handling

* Explicitly print stack trace tocrash log

* Windows Multiprocessing bugfix

* Add git info and conda version to crash log

* Windows/Anaconda mp bugfix

* Logging fixes for training 
scripts/extract.py