async evaluateSingleFrame()

in src/inference.ts [92:106]


  async evaluateSingleFrame(
    reshapedInput: tf.Tensor3D,
    batchNumber: number,
  ): Promise<[tf.Tensor3D, tf.Tensor3D, tf.Tensor3D]> {
    const model = await this.model;
    const singleBatch = tf.slice(reshapedInput, batchNumber, 1);

    const results = model.execute(singleBatch, [
      OUTPUT_TO_TENSOR_NAME.frames,
      OUTPUT_TO_TENSOR_NAME.onsets,
      OUTPUT_TO_TENSOR_NAME.contours,
    ]) as tf.Tensor3D[];

    return [results[0], results[1], results[2]];
  }