Loader

class tools.mask.loader.Loader(location: str, is_faces: bool)

Bases: object

Loader for reading source data from disk, and yielding the output paired with alignment information

Parameters:
  • location (str) – Full path to the source files location

  • is_faces (bool) – True if the source is a folder of faceswap extracted faces

Attributes Summary

file_list

Full file list of source files to be loaded

is_video

True if the source is a video file otherwise False

location

Full path to the source folder/video file location

skip_count

The number of faces/frames that have been skipped due to no match in alignments file

Methods Summary

add_alignments(alignments_object)

Add the loaded alignments to _alignments for content matching

load()

Load content from source and pair with corresponding alignment data

Attributes Documentation

file_list

Full file list of source files to be loaded

is_video

True if the source is a video file otherwise False

location

Full path to the source folder/video file location

skip_count

The number of faces/frames that have been skipped due to no match in alignments file

Methods Documentation

add_alignments(alignments_object: Alignments | None) None

Add the loaded alignments to _alignments for content matching

Parameters:

alignments_object (Alignments | None) – The alignments file object or None if not provided

Return type:

None

load() Generator[FrameFaces, None, None]

Load content from source and pair with corresponding alignment data

Yields:

The extract media object for the processed face

Return type:

Generator[FrameFaces, None, None]

add_alignments(alignments_object: Alignments | None) None

Add the loaded alignments to _alignments for content matching

Parameters:

alignments_object (Alignments | None) – The alignments file object or None if not provided

Return type:

None

property file_list: list[str]

Full file list of source files to be loaded

property is_video: bool

True if the source is a video file otherwise False

load() Generator[FrameFaces, None, None]

Load content from source and pair with corresponding alignment data

Yields:

The extract media object for the processed face

Return type:

Generator[FrameFaces, None, None]

property location: str

Full path to the source folder/video file location

property skip_count: int

The number of faces/frames that have been skipped due to no match in alignments file