Skip to main content

execute

Processes a given image through a specified neural network.

Alias for upscale.

Example

[object Object]

Defined in upscaler.ts:117

Parameters

  • image: Input - The image to upscale.
  • options: - A set of upscaling 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.
    • output?: base64 | tensor - Denotes the kind of response UpscalerJS returns - a base64 string representation of the image, or the tensor. In the browser, this defaults to "base64" and in Node.js, to "tensor".
    • patchSize?: number - Optionally specify an image patch size to operate on. For more, see the guide on patch sizes.
    • padding?: number - Optionally specify a patch size padding. For more, see the guide on patch sizes.
    • progress?: Progress - An optional progress callback if upscale is called with a patchSize argument. For more, see the guide on progress callbacks.
    • progressOutput?: base64 | tensor - Denotes the kind of response UpscalerJS returns within a progress callback.

Returns

Promise<Tensor3D | string> - an upscaled image.