Loader

class scripts.extract.Loader(pipeline: ExtractRunner, input_path: str, input_is_file: bool, extract_every: int, skip_existing_frames: bool, skip_existing_faces: bool, is_final: bool)

Bases: object

Loads images/video frames from disks and puts to queue for feeding the extraction pipeline

Parameters:
  • pipeline (ExtractRunner) – The final plugin in the extraction pipeline

  • input_path (str) – Full path to a folder of images or a video file

  • input_is_file (bool) – True if the input plugin to the pipeline is an alignments file (fsa or json) so detected faces should be loaded from the file and passed into the pipeline

  • extract_every (int) – The number of frames to extract from the source. 1 will extract every frame, 5 every 5th frame etc

  • skip_existing_frames (bool) – True if existing extracted frames should be skipped

  • skip_existing_faces (bool) – True if frames with existing face detections should be skipped

  • is_final (bool) – True if this loader is for the final batch being processed

Attributes Summary

count

The number of frames to be processed

error_state

The global FSThread error state object

is_video

True if the input location is a video file, False for folder of images

Methods Summary

join()

Join the image loading thread and monitor for keyboard interrupts

start(alignments)

Set the skip list and start loading images from disk

Attributes Documentation

count

The number of frames to be processed

error_state

The global FSThread error state object

is_video

True if the input location is a video file, False for folder of images

Methods Documentation

join() None

Join the image loading thread and monitor for keyboard interrupts

Return type:

None

start(alignments: dict[str, AlignmentsEntry]) None

Set the skip list and start loading images from disk

Parameters:

alignments (dict[str, AlignmentsEntry]) – Dictionary of existing alignments data for use when importing or skipping existing data

Return type:

None

property count: int

The number of frames to be processed

property error_state: ErrorState

The global FSThread error state object

existing_count

The number of frames that pre-exist within the alignments file that will be skipped because skip_existing/skip_existing_faces has been selected

property is_video: bool

True if the input location is a video file, False for folder of images

join() None

Join the image loading thread and monitor for keyboard interrupts

Return type:

None

location

Full path to the input location for the loader

start(alignments: dict[str, AlignmentsEntry]) None

Set the skip list and start loading images from disk

Parameters:

alignments (dict[str, AlignmentsEntry]) – Dictionary of existing alignments data for use when importing or skipping existing data

Return type:

None