new EssentiaTensorflowJSModel()

Description

Base class for loading a pre-trained Essentia-Tensorflow.js model for inference using TensorFlow.js.

Methods


<async> initialize()

Description

Promise for loading & initialise an Essentia.js-TensorFlow.js model.


arrayToTensorAsBatches( inputFeatureArray, inputShape, patchSize [, zeroPadding ] ) → {tf.Tensor3D}

Description

Converts an input 1D or 2D array into a 3D tensor (tfjs) given it's shape and required patchSize. If padding=true, this method will zero-pad the input feature.

Parameters
Name Type Attributes Default Description
inputFeatureArray Float32Array | Array.<any>

input feature array as either 1D or 2D array

inputShape Array.<any>

shape of the input feature array in 2D.

patchSize number

required patchSize to dynamically make batches of feature

zeroPadding boolean <optional>
false

whether to enable zero-padding if less frames found for a batch.

Returns

returns the computed frame-wise feature for the given audio signal.