Hello,
I use the standard code :
const _tf = require('@tensorflow/tfjs');
const _tfnode = require('@tensorflow/tfjs-node');
const _mobilenet = require('@tensorflow-models/mobilenet');
const _knnClassifier = require('@tensorflow-models/knn-classifier');
var_myNet = await _mobilenet.load();
var _myClassifier = _knnClassifier.create();
// load saved model
await _myNet.model.load(`file://${folder}`);
// load dataset of classifier
let savedDataSet = getSavedClassifier( modelName);
_myClassifier.setClassifierDataset( savedDataSet);
...
// after some learning
if (_myClassifier.getNumClasses() > 0) {
const activation = _myNet.infer( img, true);
const result = await _myClassifier.predictClass( activation, 3);
for my classification program in nodejs.
As you see, the initial model is lost ,and is substituded by my classifier.
But naturly, this doesn’t start when access to Internet is offline.
How to work full offline, since the beginning (for example with a Raspeberry on a robot) ?
Best regards.