Skip to content

Latest commit

 

History

History
138 lines (90 loc) · 3.47 KB

File metadata and controls

138 lines (90 loc) · 3.47 KB

DatasetSampler

Waifu2x Index / Waifu2x / DatasetSampler

Auto-generated documentation for waifu2x.dataset_sampler module.

DatasetSampler

Show source in dataset_sampler.py:31

Class for sampling datasets for training or testing purposes.

Arguments


  • filelist list[str] - List of file paths.
  • config argparse.Namespace - Configuration settings.

Attributes


  • filelist list[str] - List of file paths.
  • config argparse.Namespace - Configuration settings.
  • worker multiprocessing.Process - Worker process.
  • dataset tuple - Dataset containing input and output arrays.
  • cache_name str - Name of the cached file.
  • _queue multiprocessing.Queue - Communication queue.
  • _finalized multiprocessing.Event - Event for finalizing the process.
  • _init bool - Flag indicating initialization status.
  • _reload bool - Flag indicating whether to reload the dataset.
  • _running bool - Flag indicating whether the process is running.

Methods


  • finalize() - Finalizes the dataset sampling process.
  • reload_switch(init - bool = True): Switches the reload state.
  • _init_process() - Initializes the sampling process.
  • wait() - Waits for the process to complete.
  • get() - Retrieves the dataset.

Signature

class DatasetSampler:
    def __init__(self, filelist: list[str], config: argparse.Namespace) -> None: ...

DatasetSampler()._init_process

Show source in dataset_sampler.py:103

Initialize the sampling process.

Signature

def _init_process(self) -> None: ...

DatasetSampler().finalize

Show source in dataset_sampler.py:90

Finalize the dataset sampling process.

Signature

def finalize(self) -> None: ...

DatasetSampler().get

Show source in dataset_sampler.py:120

Retrieve the dataset.

Signature

def get(self): ...

DatasetSampler().reload_switch

Show source in dataset_sampler.py:98

Switches the reload state.

Signature

def reload_switch(self, init: bool = True) -> None: ...

DatasetSampler().wait

Show source in dataset_sampler.py:113

Wait for the process to complete.

Signature

def wait(self) -> None: ...

_worker

Show source in dataset_sampler.py:137

Worker function for dataset sampling.

Arguments


  • filelist list[str] - List of file paths.
  • args argparse.Namespace - Command-line arguments.
  • queue multiprocessing.Queue - Communication queue.
  • finalized multiprocessing.Event - Event for finalizing the process.

Signature

def _worker(filelist: list[str], args: argparse.Namespace, queue, finalized) -> None: ...