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('I am all warmed up!');
});
Defined in upscaler.ts:163

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 can be helpful if you need to release for the UI thread or wish to be more responsive to abort signals.

WarmupSizes

  • [number, number] - an array of two numbers representing width and height.
  • {patchSize: number; padding?: number} - an object with the patchSize and optional padding properties.
  • [number, number][] - an array of arrays of two numbers representing width and height.
  • {patchSize: number; padding?: number}[] - an array of objects with the patchSize and optional padding properties.

Returns

Promise<void>