Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aghabeiki/keras-predict
A Node.JS Native add-ons to run Keras trained model.
https://github.com/aghabeiki/keras-predict
cpp17 keras ml napi nodejs prediction
Last synced: 5 days ago
JSON representation
A Node.JS Native add-ons to run Keras trained model.
- Host: GitHub
- URL: https://github.com/aghabeiki/keras-predict
- Owner: Aghabeiki
- License: mit
- Created: 2018-07-07T04:01:29.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-14T09:16:39.000Z (almost 6 years ago)
- Last Synced: 2024-10-10T08:23:46.476Z (29 days ago)
- Topics: cpp17, keras, ml, napi, nodejs, prediction
- Language: C++
- Homepage:
- Size: 121 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# keras-predict
A Nodejs Native addons to run Keras ML model.Run Keras ML model via [frugally-deep](https://github.com/Dobiasd/frugally-deep) as a native Nodejs Addons.
Usage:
* first [install](https://github.com/Dobiasd/frugally-deep/blob/master/INSTALL.md) frugally-deep.
* compile your keras model :
```
python3 frugally-deep/keras_export/convert_model.py keras_model.h5 fdeep_model.json
```
* path the size of your ML input and converted ML path to predict function.
```
const predict = require('keras-predict')
const path = require('path');
const mlModelPath = path.resolve(__dirname, "fdeep_model.json");
const testCase = [...];
predict.predict(120, mlModelPath, testCase, (err, predict) => {
if (err) {
console.error(err)
} else {
console.dir(predict.map(Math.round))
}
})
}
```
* A working example avialable at example folder.
* This module tested only on ArchLinux.Amin Aghabeiki.