react-native-tflite-classification
Version:
Run TensorFlow Lite models in React Native Android apps
27 lines (26 loc) • 720 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Tflite = void 0;
var _reactNative = require("react-native");
const {
TfLite
} = _reactNative.NativeModules;
class Tflite {
loadModel(args, callback) {
TfLite.loadModel(args['modelPath'], args['labelsPath'] || '', (error, response) => {
callback && callback(error, response);
});
}
runModelOnImage(args, callback) {
TfLite.runModelOnImage(args['path'], args['numResults'] || 5, args['threshold'] != null ? args['threshold'] : 0.1, (error, response) => {
callback && callback(error, response);
});
}
close() {
TfLite.close();
}
}
exports.Tflite = Tflite;
//# sourceMappingURL=index.js.map