          """
          if not hasattr(arguments, "output") or arguments.output is None or not arguments.output:
              if self._update_type == "output":
                  logger.error("Processing set as 'output' but no output folder provided.")
                  exit(0)
              logger.debug("No output provided. Not creating saver")
              return None
          output_dir = str(get_folder(arguments.output, make_folder=True))
          logger.info("Saving preview masks to: '%s'", output_dir)
          saver = ImagesSaver(output_dir)
 
</s> remove             logger.debug("Not updating existing mask for face: '%s' - %s", frame, idx)
 </s> add             logger.debug("Mask pre-exists for face: '%s' - %s", frame, idx) </s> remove             exit(0)
 </s> add             sys.exit(0) </s> remove             detected_faces = []
            for idx, alignment in enumerate(self._alignments.get_faces_in_frame(frame)):
                self._face_count += 1
                if self._check_for_missing(frame, idx, alignment):
                    continue
                detected_face = self._get_detected_face(alignment)
                if self._update_type == "output":
 </s> add             faces_in_frame = self._alignments.get_faces_in_frame(frame)
            self._face_count += len(faces_in_frame)

            # To keep face indexes correct/cover off where only one face in an image is missing a
            # mask where there are multiple faces we process all faces again for any frames which
            # have missing masks.
            if all(self._check_for_missing(frame, idx, alignment)
                   for idx, alignment in enumerate(faces_in_frame)):
                continue

            detected_faces = [self._get_detected_face(alignment) for alignment in faces_in_frame]
            if self._update_type == "output":
                for idx, detected_face in enumerate(detected_faces): </s> remove             exit(0)
 </s> add             sys.exit(0) </s> remove                 else:
                    detected_faces.append(detected_face)
                    self._update_count += 1
            if self._update_type != "output":
 </s> add             else:
                self._update_count += len(detected_faces)
                sys.exit(0)
          """
          if not hasattr(arguments, "output") or arguments.output is None or not arguments.output:
              if self._update_type == "output":
                  logger.error("Processing set as 'output' but no output folder provided.")
                sys.exit(0)
              logger.debug("No output provided. Not creating saver")
              return None
          output_dir = str(get_folder(arguments.output, make_folder=True))
          logger.info("Saving preview masks to: '%s'", output_dir)
          saver = ImagesSaver(output_dir)
keep keep keep keep replace keep keep keep keep keep
 tools.mask - Bugfixes
- Missing masks - fix memory leak
- Missing masks - Handle multiple faces in frames properly 
tools/mask.py