libtf
This library performs non-blocking inference on tensorflow frozen model. Based on the Tensorflow C API.
Dependency
Install libtensorflow from https://www.tensorflow.org/install/lang_c
Install
npm i libtf
Usage
var TFModel = var model = // To be called for each desired Tensorflow Session // With options:// var model = TFModel({// 'allow_growth': false, // If true, overrides gpu_memory_fraction// 'gpu_memory_fraction': 1.0,// }) ;async { await model // Session is created and model loaded var input = "isTrainingflag": false // Boolean "dropout_keep_prob": // Scalar "dim": 1 "data": 1 "inputs/enc_in": // Tensor, data must be of type Float32Array or UInt8Array "dim": 132 "data": 1*32 var result = await model // arg1 is input, arg2 is an array of output names console // Output:// { 'dense_1/Softmax': // Output name// { dim: [ 1, 62 ],// data:// Float32Array [ ... ] // } // } }