Example

// or use require
import AiMR_GAN from "@aimr/asmr-gan-lib";

// import some version of tensorflow in any way you'd like
import * as tf from "@tensorflow/tfjs";

// load the model and/or cache it for subsequent reloads.
await AiMR_GAN.load(tf);

// generate some fake Asmr Images
console.log(await AiMR_GAN.generateChunks(1));

Constructors

Properties

Methods

Constructors

Properties

cached: boolean = false
loaded: boolean = false
model: LayersModel
tf: __module

Methods

  • Cache the loaded pre-trained model for later use.

    Returns Promise<void>

    Note

    Cached differently depending on the execution context.

    Throws

    When called before model is loaded.

    Throws

    When called after model is already cached before.

  • This function will generate chunk(s) of images

    Parameters

    • Optional chunks: number = 1

      Integer >= 1. How many chunks to generate.

    Returns Uint8Array[]

    Array with length of chunks where each element is a Uint8Array of image data.

  • Call this to load the pre-trained model into the library.

    Parameters

    • _tf: __module

      Dependency injection tensorflow instance.

    Returns Promise<void>

    Note

    This function will try to load a cached version before fetching the last public version.

Generated using TypeDoc