Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kernelerr/paddlenode
A third-party node.js addon for Paddle Inference.
https://github.com/kernelerr/paddlenode
Last synced: 25 days ago
JSON representation
A third-party node.js addon for Paddle Inference.
- Host: GitHub
- URL: https://github.com/kernelerr/paddlenode
- Owner: KernelErr
- License: apache-2.0
- Created: 2020-07-05T15:03:12.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-22T06:29:30.000Z (over 3 years ago)
- Last Synced: 2023-03-08T23:54:12.890Z (over 1 year ago)
- Language: C++
- Homepage:
- Size: 1.09 MB
- Stars: 8
- Watchers: 2
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# paddle node
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FKernelErr%2Fpaddlenode.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FKernelErr%2Fpaddlenode?ref=badge_shield)A third-party node.js addon for Paddle Inference. The beginning two versions of paddle node are using Paddle Lite for backbone, but we use Paddle Inference instead as it is more compatible for x86_64 platform.
Tested on Windows 10, Node.js v12.16.3.
Current features:
- Import combined model.
- Infer from float array.
- Image classification from file.## Methods
#### set_combined_model
```javascript
paddlenode.set_combined_model(ModelDir)
```#### infer_float
```javascript
paddlenode.infer_float(Data, Size)
```#### image_file_classification
```javascript
paddlenode.image_file_classification(ImagePath, InputSize, Scalefactor, Mean, swapRB)
```## Example
### Image Classification
```javascript
var paddlenode = require('./paddlenode');
paddlenode.set_combined_model('./mobilenetv1');
var res = paddlenode.image_file_classfication("test.jpg",[1, 3, 224, 224],0.007843,[224,224],[0.485,0.456,0.406], false)
console.log('Result', res.indexOf(Math.max(...res)));
```### Sample Vector
```javascript
var paddlenode = require('./paddlenode');
paddlenode.set_combined_model('./mobilenetv1');
var arr = new Array(150528);
for(var i=0; i