Pretrained models for TensorFlow.js
Go to file
dbcp1 07ef0e7d5e
Update TFJS version for models handpose, posenet, qna. (#1307)
2023-12-06 18:53:53 +00:00
.tslint Add linting rules for tfjs-models. (#333) 2019-10-25 08:08:42 -07:00
.vscode Move pose-detection code needed in hand detection to a common folder (#830) 2021-09-14 16:26:55 -04:00
blazeface Update TFJS version for models blazeface, body-pix, face-detection, coco-ssd, gpt2, knn-classifier. (#1306) 2023-12-06 18:38:51 +00:00
body-pix Update TFJS version for models blazeface, body-pix, face-detection, coco-ssd, gpt2, knn-classifier. (#1306) 2023-12-06 18:38:51 +00:00
body-segmentation Update TFJS version for models mobilenet , depth-estimation, body-segmentation. (#1305) 2023-12-06 18:32:07 +00:00
coco-ssd Update TFJS version for models blazeface, body-pix, face-detection, coco-ssd, gpt2, knn-classifier. (#1306) 2023-12-06 18:38:51 +00:00
deeplab update deeplab model (#1179) 2023-08-07 10:13:34 -07:00
depth-estimation Update TFJS version for models mobilenet , depth-estimation, body-segmentation. (#1305) 2023-12-06 18:32:07 +00:00
face-detection Update TFJS version for models blazeface, body-pix, face-detection, coco-ssd, gpt2, knn-classifier. (#1306) 2023-12-06 18:38:51 +00:00
face-landmarks-detection Update TFJS version for face-landmarks-detection (#1283) 2023-11-30 00:35:56 +00:00
gpt2 Update TFJS version for models blazeface, body-pix, face-detection, coco-ssd, gpt2, knn-classifier. (#1306) 2023-12-06 18:38:51 +00:00
hand-pose-detection Update TFJS version for models hand-pose-detection,handpose,knn-classifier and mobilenet (#1279) 2023-11-30 20:54:02 +00:00
handpose Update TFJS version for models handpose, posenet, qna. (#1307) 2023-12-06 18:53:53 +00:00
knn-classifier Update TFJS version for models blazeface, body-pix, face-detection, coco-ssd, gpt2, knn-classifier. (#1306) 2023-12-06 18:38:51 +00:00
mobilenet Update TFJS version for models mobilenet , depth-estimation, body-segmentation. (#1305) 2023-12-06 18:32:07 +00:00
model-playground Bump ua-parser-js from 0.7.28 to 0.7.34 in /model-playground (#1130) 2023-04-04 15:52:40 -07:00
pose-detection fix (#1199) 2023-08-29 14:36:20 -07:00
posenet Update TFJS version for models handpose, posenet, qna. (#1307) 2023-12-06 18:53:53 +00:00
qna Update TFJS version for models handpose, posenet, qna. (#1307) 2023-12-06 18:53:53 +00:00
scripts [handpose] Add model. (#414) 2020-03-07 13:05:33 -05:00
shared Pose-detection version update (#1197) 2023-08-24 14:36:28 -07:00
speech-commands Update TFJS version speech-commands,tasks,toxicity and universal-sentence-encoder (#1281) 2023-12-06 00:08:29 +00:00
tasks Update TFJS version speech-commands,tasks,toxicity and universal-sentence-encoder (#1281) 2023-12-06 00:08:29 +00:00
tools Standardize rollup configs with a central config generator (#1102) 2023-02-21 09:44:26 -08:00
toxicity Update TFJS version speech-commands,tasks,toxicity and universal-sentence-encoder (#1281) 2023-12-06 00:08:29 +00:00
universal-sentence-encoder up stream the changes from g3 (#1128) 2023-03-03 16:21:22 -08:00
.gitignore [facemesh] Add model. (#413) 2020-03-07 09:24:47 -05:00
CONTRIBUTING.md Add license and contributing 2018-04-30 15:16:27 -04:00
LICENSE Add license and contributing 2018-04-30 15:16:27 -04:00
README.md Add depth estimation to readme (#1037) 2022-08-11 13:05:29 -07:00
cloudbuild.yml Standardize rollup configs with a central config generator (#1102) 2023-02-21 09:44:26 -08:00
package.json Standardize rollup configs with a central config generator (#1102) 2023-02-21 09:44:26 -08:00
presubmit.ts Add publish-npm, make-version, tag-version scripts to models. (#369) 2019-12-06 11:50:53 -05:00
run_python_tests.sh [SpeechCommands] Clean up training/browser-fft directory (#513) 2020-08-27 17:06:34 -04:00
test_util.ts Move pose-detection code needed in hand detection to a common folder (#830) 2021-09-14 16:26:55 -04:00
tsconfig.json Add 'skipLibCheck=true' to tsconfig (#1301) 2023-11-29 13:43:26 -08:00
tsconfig.test.json Create test tsconfig. (#522) 2020-09-16 19:18:18 -04:00
tslint.json Add linting rules for tfjs-models. (#333) 2019-10-25 08:08:42 -07:00
update_yarn_lock.sh fix security vulnerabilities (#620) 2021-03-29 10:48:33 -07:00
workspace.code-workspace Add base class and types. (#607) 2021-03-11 17:11:50 -08:00
yarn.lock Standardize rollup configs with a central config generator (#1102) 2023-02-21 09:44:26 -08:00

README.md

Pre-trained TensorFlow.js models

This repository hosts a set of pre-trained models that have been ported to TensorFlow.js.

The models are hosted on NPM and unpkg so they can be used in any project out of the box. They can be used directly or used in a transfer learning setting with TensorFlow.js.

To find out about APIs for models, look at the README in each of the respective directories. In general, we try to hide tensors so the API can be used by non-machine learning experts.

For those interested in contributing a model, please file a GitHub issue on tfjs to gauge interest. We are trying to add models that complement the existing set of models and can be used as building blocks in other apps.

Models

Type Model Demo Details Install
Images
MobileNet
live Classify images with labels from the ImageNet database. npm i @tensorflow-models/mobilenet
source
Hand
live Real-time hand pose detection in the browser using TensorFlow.js. npm i @tensorflow-models/hand-pose-detection
source
Pose
live An API for real-time human pose detection in the browser. npm i @tensorflow-models/pose-detection
source
Coco SSD
Object detection model that aims to localize and identify multiple objects in a single image. Based on the TensorFlow object detection API. npm i @tensorflow-models/coco-ssd
source
DeepLab v3
Semantic segmentation npm i @tensorflow-models/deeplab
source
Face Landmark Detection
live Real-time 3D facial landmarks detection to infer the approximate surface geometry of a human face npm i @tensorflow-models/face-landmarks-detection
source
Audio
Speech Commands
live Classify 1 second audio snippets from the speech commands dataset. npm i @tensorflow-models/speech-commands
source
Text
Universal Sentence Encoder
Encode text into a 512-dimensional embedding to be used as inputs to natural language processing tasks such as sentiment classification and textual similarity. npm i @tensorflow-models/universal-sentence-encoder
source
Text Toxicity
live Score the perceived impact a comment might have on a conversation, from "Very toxic" to "Very healthy". npm i @tensorflow-models/toxicity
source
Depth Estimation
Portrait Depth
live Estimate per-pixel depth (the distance to the camera center) for a single portrait image, which can be further used for creative applications such as 3D photo and relighting. npm i @tensorflow-models/depth-estimation
source
General Utilities
KNN Classifier
This package provides a utility for creating a classifier using the K-Nearest Neighbors algorithm. Can be used for transfer learning. npm i @tensorflow-models/knn-classifier
source

Development

You can run the unit tests for any of the models by running the following inside a directory:

yarn test

New models should have a test NPM script (see this package.json and run_tests.ts helper for reference).

To run all of the tests, you can run the following command from the root of this repo:

yarn presubmit