I made a model in python and exported it to tensorflow js. The model is classifying facial images to emotions, and there should be 7 categories.
I made a tensor from the image and used predict like so:
const prediction = model.predict(imageTensor);
my prediction is :
Tensor {
"dataId": Object {},
"dtype": "float32",
"id": 415,
"isDisposedInternal": false,
"kept": false,
"rankType": "2",
"scopeId": 197,
"shape": Array [
1,
7,
],
"size": 7,
"strides": Array [
7,
],
}
how do I extract the result from here?
found the answer, I was using typescript and it was needed: const prediction = (model.predict( imageTensor ) as tf.Tensor).dataSync();