# oxyzen_node

> oxyzen bindings for Node.js

Latest version **0.0.7** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install oxyzen_node
pnpm add oxyzen_node
yarn add oxyzen_node
bun add oxyzen_node
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; large bundle; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2023-11-07 |
| First published | 2023-06-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 17.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Maintainers | yongle_work |

## Links

- npm: https://www.npmjs.com/package/oxyzen_node
- Repository: https://github.com/BrainCoTech/zenlite_sdk
- Homepage: https://github.com/BrainCoTech/zenlite_sdk#readme
- Issues: https://github.com/BrainCoTech/zenlite_sdk/issues
- npm.io page: https://npm.io/package/oxyzen_node

## Dependencies (3)

- [node-gyp](https://npm.io/package/node-gyp.md) ^10.0.1
- [node-addon-api](https://npm.io/package/node-addon-api.md) ^7.0.0
- [node-gyp-build](https://npm.io/package/node-gyp-build.md) ^4.6.1

## Recent versions

- 0.0.7 (latest) — 2023-11-07
- 0.0.6 — 2023-11-07
- 0.0.5 — 2023-11-07
- 0.0.4 — 2023-11-07
- 0.0.3 — 2023-11-07
- 0.0.2 — 2023-06-16
- 0.0.1 — 2023-06-14

## README

# node-tflite

node-tflite is an unofficial TensorFlow Lite 2.2 bindings for Node.js.

It can run TensorFlow Lite models (`.tflite`) in Node.js environment (including Electron).

## Differences to TensorFlow.js

- node-tflite can run TensorFlow Lite models (`.tflite`) while TensorFlow.js cannot (you'll need a different way of model conversion in TensorFlow.js)
- node-tflite may or may not be faster than TensorFlow.js
  - I didn't run any benchmarks yet, but the example below runs faster than TF.js
- node-tflite only supports model inference, not training
- node-tflite doesn't support Web environments
- node-tflite doesn't support GPU execution (now) while TensorFlow.js supports through WebGL or tfjs-node-gpu

## Supported Platforms

- [x] macOS
- [x] Windows
- [x] Linux

## Install

```
npm install node-tflite
```

## Use

```js
import { Interpreter } from "node-tflite";

const modelData = fs.readFileSync("/path/to/model.tflite");
const interpreter = new Interpreter(modelData);

interpreter.allocateTensors();

interpreter.inputs[0].copyFrom(inputData);

interpreter.invoke();

interpreter.outputs[0].copyTo(outputData);
```

## Examples

- [BlazeFace face detection in Electron](https://github.com/BrainCoTech/zenlite_sdk/tree/master/examples/electron-mediapipe-face)
  - Uses the BlazeFace model from [MediaPipe](https://github.com/google/mediapipe)
  - It runs in 60 FPS in MacBook Pro 16'' 2019, which is faster than [BlazeFace TF.js demo](https://storage.googleapis.com/tfjs-models/demos/blazeface/index.html) (around 40 FPS in both wasm and WebGL)

## Benchmark

TODO

## Develop

### Setup

```
npm install
```

### Test

```
npm test
```

### Build .js and .d.ts

```shell
cd node/node-bindings 
yarn 
yarn dist
```

### How to build tensorflowlite_c library

- [Configure tensorflow](https://www.tensorflow.org/install/source)
- `bazel build //tensorflow/lite/c:tensorflowlite_c`

---
_Source: https://npm.io/package/oxyzen_node · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
