constructor()

in src/inference.ts [56:67]


  constructor(modelOrModelPath: string | Promise<tf.GraphModel>) {
    if (OVERLAP_LENGTH_FRAMES % 2 !== 0) {
      throw new Error(
        `OVERLAP_LENGTH_FRAMES is not divisible by 2! Is ${OVERLAP_LENGTH_FRAMES}`,
      );
    }

    this.model =
      typeof modelOrModelPath === 'string'
        ? tf.loadGraphModel(modelOrModelPath)
        : modelOrModelPath;
  }