{"id":19025602,"url":"https://github.com/seanchas116/node-tflite","last_synced_at":"2025-04-23T12:49:22.259Z","repository":{"id":37191564,"uuid":"261345845","full_name":"seanchas116/node-tflite","owner":"seanchas116","description":"TensorFlow Lite bindings for Node.js","archived":false,"fork":false,"pushed_at":"2023-01-06T06:21:48.000Z","size":18316,"stargazers_count":15,"open_issues_count":18,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-18T00:10:39.384Z","etag":null,"topics":["deep-learning","electron","javascript","machine-learning","nodejs","tensorflow","tensorflow-lite","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/node-tflite","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seanchas116.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-05T02:40:53.000Z","updated_at":"2024-12-23T17:05:07.000Z","dependencies_parsed_at":"2023-02-05T12:45:16.974Z","dependency_job_id":null,"html_url":"https://github.com/seanchas116/node-tflite","commit_stats":{"total_commits":80,"total_committers":3,"mean_commits":"26.666666666666668","dds":0.09999999999999998,"last_synced_commit":"e957fd581f0112583f0f7dffd764a56a3109baa1"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanchas116%2Fnode-tflite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanchas116%2Fnode-tflite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanchas116%2Fnode-tflite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanchas116%2Fnode-tflite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seanchas116","download_url":"https://codeload.github.com/seanchas116/node-tflite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250437715,"owners_count":21430773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","electron","javascript","machine-learning","nodejs","tensorflow","tensorflow-lite","typescript"],"created_at":"2024-11-08T20:44:07.114Z","updated_at":"2025-04-23T12:49:22.236Z","avatar_url":"https://github.com/seanchas116.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-tflite\n\nnode-tflite is an unofficial TensorFlow Lite 2.2 bindings for Node.js.\n\nIt can run TensorFlow Lite models (`.tflite`) in Node.js environment (including Electron).\n\n## Differences to TensorFlow.js\n\n- node-tflite can run TensorFlow Lite models (`.tflite`) while TensorFlow.js cannot (you'll need a different way of model conversion in TensorFlow.js)\n- node-tflite may or may not be faster than TensorFlow.js\n  - I didn't run any benchmarks yet, but the example below runs faster than TF.js\n- node-tflite only supports model inference, not training\n- node-tflite doesn't support Web environments\n- node-tflite doesn't support GPU execution (now) while TensorFlow.js supports through WebGL or tfjs-node-gpu\n\n## Supported Platforms\n\n- [x] macOS\n- [x] Windows\n- [x] Linux\n\n## Install\n\n```\nnpm install node-tflite\n```\n\n## Use\n\n```js\nimport { Interpreter } from \"node-tflite\";\n\nconst modelData = fs.readFileSync(\"/path/to/model.tflite\");\nconst interpreter = new Interpreter(modelData);\n\ninterpreter.allocateTensors();\n\ninterpreter.inputs[0].copyFrom(inputData);\n\ninterpreter.invoke();\n\ninterpreter.outputs[0].copyTo(outputData);\n```\n\n## Examples\n\n- [BlazeFace face detection in Electron](https://github.com/seanchas116/node-tflite/tree/master/examples/electron-mediapipe-face)\n  - Uses the BlazeFace model from [MediaPipe](https://github.com/google/mediapipe)\n  - 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)\n\n## Benchmark\n\nTODO\n\n## Develop\n\n### Setup\n\n```\nnpm install\n```\n\n### Test\n\n```\nnpm test\n```\n\n### Build .js and .d.ts\n\n```\nnpm run dist\n```\n\n### How to build tensorflowlite_c library\n\n- [Configure tensorflow](https://www.tensorflow.org/install/source)\n- `bazel build //tensorflow/lite/c:tensorflowlite_c`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseanchas116%2Fnode-tflite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseanchas116%2Fnode-tflite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseanchas116%2Fnode-tflite/lists"}