Output

class tools.mask.mask_output.Output(arguments: Namespace, alignments: align.alignments.Alignments | None, file_list: list[str])

Bases: object

Handles outputting of masks for preview/editing to disk

Parameters:
  • arguments (Namespace) – The command line arguments that the mask tool was called with

  • alignments (align.alignments.Alignments | None) – The alignments file object (or None if not provided and input is faces)

  • file_list (list[str]) – Full file list for the loader. Used for extracting alignments from faces

Attributes Summary

should_save

True if mask images should be output otherwise False

Methods Summary

close()

Shut down the image saver if it is open

save(frame, idx, detected_face[, frame_dims])

Build the mask preview image and save

Attributes Documentation

should_save

True if mask images should be output otherwise False

Methods Documentation

close() None

Shut down the image saver if it is open

Return type:

None

save(frame: str, idx: int, detected_face: DetectedFace, frame_dims: tuple[int, int] | None = None) None

Build the mask preview image and save

Parameters:
  • frame (str) – The frame name in the alignments file

  • idx (int) – The index of the face for this frame in the alignments file

  • detected_face (DetectedFace) – A detected_face object for a face

  • frame_dims (tuple[int, int] | None) – The size of the original frame, if input is faces otherwise None. Default: None

Return type:

None

close() None

Shut down the image saver if it is open

Return type:

None

save(frame: str, idx: int, detected_face: DetectedFace, frame_dims: tuple[int, int] | None = None) None

Build the mask preview image and save

Parameters:
  • frame (str) – The frame name in the alignments file

  • idx (int) – The index of the face for this frame in the alignments file

  • detected_face (DetectedFace) – A detected_face object for a face

  • frame_dims (tuple[int, int] | None) – The size of the original frame, if input is faces otherwise None. Default: None

Return type:

None

property should_save: bool

True if mask images should be output otherwise False