DiskIO

class scripts.convert.DiskIO(alignments: fs_media.Alignments, images: ImagesLoader, predictor: Predict, arguments: Namespace)

Bases: object

Disk Input/Output for the converter process.

Background threads to:
  • Load images from disk and get the detected faces

  • Save images back to disk

Parameters:
  • alignments (fs_media.Alignments) – The alignments for the input video

  • images (ImagesLoader) – The input images

  • predictor (Predict) – The object for generating predictions from the model

  • arguments (Namespace) – The arguments that were passed to the convert process as generated from Faceswap’s command line arguments

Attributes Summary

completion_event

Event is set when the DiskIO Save task is complete

draw_transparent

True if the selected writer can output transparent and it's Draw_transparent configuration item is set otherwise False

load_queue

The queue that images and detected faces are loaded into.

load_thread

The thread that is running the image loading operation.

pre_encode

Selected writer's pre-encode function, if it has one, otherwise None

save_thread

The thread that is running the image writing operation.

Attributes Documentation

completion_event

Event is set when the DiskIO Save task is complete

draw_transparent

True if the selected writer can output transparent and it’s Draw_transparent configuration item is set otherwise False

load_queue

The queue that images and detected faces are loaded into.

load_thread

The thread that is running the image loading operation.

pre_encode

Selected writer’s pre-encode function, if it has one, otherwise None

Type:

python function

save_thread

The thread that is running the image writing operation.

property completion_event: Event

Event is set when the DiskIO Save task is complete

property draw_transparent: bool

True if the selected writer can output transparent and it’s Draw_transparent configuration item is set otherwise False

property load_queue: EventQueue

The queue that images and detected faces are loaded into.

property load_thread: MultiThread

The thread that is running the image loading operation.

property pre_encode: Callable[[np.ndarray, T.Any], list[bytes]] | None

Selected writer’s pre-encode function, if it has one, otherwise None

Type:

python function

property save_thread: MultiThread

The thread that is running the image writing operation.