Waifu2x Index / Waifu2x / DatasetSampler
Auto-generated documentation for waifu2x.dataset_sampler module.
Show source in dataset_sampler.py:31
Class for sampling datasets for training or testing purposes.
filelistlist[str] - List of file paths.configargparse.Namespace - Configuration settings.
filelistlist[str] - List of file paths.configargparse.Namespace - Configuration settings.workermultiprocessing.Process - Worker process.datasettuple - Dataset containing input and output arrays.cache_namestr - Name of the cached file._queuemultiprocessing.Queue - Communication queue._finalizedmultiprocessing.Event - Event for finalizing the process._initbool - Flag indicating initialization status._reloadbool - Flag indicating whether to reload the dataset._runningbool - Flag indicating whether the process is running.
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.
class DatasetSampler:
def __init__(self, filelist: list[str], config: argparse.Namespace) -> None: ...Show source in dataset_sampler.py:103
Initialize the sampling process.
def _init_process(self) -> None: ...Show source in dataset_sampler.py:90
Finalize the dataset sampling process.
def finalize(self) -> None: ...Show source in dataset_sampler.py:120
Retrieve the dataset.
def get(self): ...Show source in dataset_sampler.py:98
Switches the reload state.
def reload_switch(self, init: bool = True) -> None: ...Show source in dataset_sampler.py:113
Wait for the process to complete.
def wait(self) -> None: ...Show source in dataset_sampler.py:137
Worker function for dataset sampling.
filelistlist[str] - List of file paths.argsargparse.Namespace - Command-line arguments.queuemultiprocessing.Queue - Communication queue.finalizedmultiprocessing.Event - Event for finalizing the process.
def _worker(filelist: list[str], args: argparse.Namespace, queue, finalized) -> None: ...