Skip to main content

warmup

Warms up an Upscaler instance. For more info, see the guide on warming up.

Example

const upscaler = new Upscaler();
upscaler.warmup([{
patchSize: 64,
padding: 2,
}]).then(() => {
console.log('All warmed up!');
});
Defined in upscaler.ts:195

Parameters

  • warmupSizes: WarmupSizes - Denotes how to warm the model up.
  • options?: - A set of warm up arguments.
    • signal?: AbortSignal - Provides a mechanism to abort the warmup process. For more, see the guides on cancelling requests.
    • awaitNextFrame?: boolean - If provided, upscaler will await tf.nextFrame() on each cycle. This allows enhancement operations to more often release the UI thread, and can make enhancement operations more responsive to abort signals or.

WarmupSizes

  • number - a number representing both the size (width and height) of the patch.
  • {patchSize: number; padding?: number} - an object with the patchSize and optional padding properties.
  • number[] - an array of numbers representing the size (width and height) of the patch.
  • {patchSize: number; padding?: number}[] - an array of objects with the patchSize and optional padding properties.

Returns

Promise<void>