Documentation Index
Fetch the complete documentation index at: https://mintlify.com/xinntao/Real-ESRGAN/llms.txt
Use this file to discover all available pages before exploring further.
PrefetchReader
A threaded image prefetch reader for efficient batch processing.Parameters
A list of image file paths to be read
Number of images to prefetch in the queue
Methods
run()
Starts the prefetch thread. Reads images from the list and puts them in the queue.next()
Returns the next prefetched image from the queue. Returns:numpy.ndarray - The next image in BGR format
Raises: StopIteration when no more images are available
iter()
Returns the iterator object (self).Usage Example
The PrefetchReader uses threading to read images asynchronously, which can significantly improve performance when processing large batches of images by overlapping I/O and computation.
IOConsumer
A threaded consumer for asynchronous image writing operations.Parameters
Options object containing configuration parameters
Queue object for receiving write tasks
Worker ID for the consumer thread
Methods
run()
Runs the consumer loop. Continuously reads messages from the queue and writes images to disk. Message format:'quit' to the queue.
Usage Example
The IOConsumer allows you to offload disk I/O operations to a separate thread, preventing write operations from blocking your main processing pipeline. This is especially useful when processing large batches of high-resolution images.
Constants
ROOT_DIR
The root directory of the Real-ESRGAN package.str
Value: The directory containing the Real-ESRGAN package (parent directory of realesrgan/)