Pretrained models for TensorFlow.js
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
ahmedsabie 118d472719
Add FaceDetection MediaPipe implementation (#897)
2 days ago
.tslint Add linting rules for tfjs-models. (#333) 2 years ago
.vscode Move pose-detection code needed in hand detection to a common folder (#830) 4 months ago
blazeface [blazeface] Add missing esbuild dependency (#852) 3 months ago
body-pix Bump ansi-regex from 5.0.0 to 5.0.1 in /body-pix (#838) 3 months ago
body-segmentation Add body segmentation upload video demo (#896) 6 days ago
coco-ssd Update to easier to use demo that is live (#885) 1 month ago
deeplab Bump ansi-regex from 5.0.0 to 5.0.1 in /deeplab (#882) 1 month ago
face-landmarks-detection Add FaceDetection MediaPipe implementation (#897) 2 days ago
hand-pose-detection Add BodyPix Body Segmentation implementation (#891) 1 week ago
handpose Bump path-parse from 1.0.6 to 1.0.7 in /handpose (#881) 1 month ago
knn-classifier Delete invalid symbols (#832) 4 months ago
mobilenet Bump path-parse from 1.0.6 to 1.0.7 in /mobilenet (#796) 5 months ago
model-playground Model playground initial checkin (#759) 5 months ago
pose-detection Add body segmentation live video demo (#894) 1 week ago
posenet [posenet]Deprecate. (#849) 3 months ago
qna fix: improve check for accessing token map in qna model (#888) 1 month ago
scripts [handpose] Add model. (#414) 2 years ago
shared Add segmentation render utility (#889) 4 weeks ago
speech-commands Bump tar from 4.4.17 to 4.4.19 in /speech-commands (#831) 5 months ago
tasks [task] Enable cloudbulid, fix lint errors, and add tests (#738) 8 months ago
toxicity Bump path-parse from 1.0.6 to 1.0.7 in /toxicity (#785) 5 months ago
universal-sentence-encoder [use-qna] use tf.matmul for dot product computation (#886) 1 month ago
.gitignore [facemesh] Add model. (#413) 2 years ago
CONTRIBUTING.md Add license and contributing 4 years ago
LICENSE Add license and contributing 4 years ago
README.md Update model list, remove handpose, add hand-pose-detection (#863) 2 months ago
cloudbuild.yml Add FaceDetection MediaPipe implementation (#897) 2 days ago
package.json fix security vulnerabilities (#620) 10 months ago
presubmit.ts Add publish-npm, make-version, tag-version scripts to models. (#369) 2 years ago
run_python_tests.sh [SpeechCommands] Clean up training/browser-fft directory (#513) 1 year ago
test_util.ts Move pose-detection code needed in hand detection to a common folder (#830) 4 months ago
tsconfig.json Create test tsconfig. (#522) 1 year ago
tsconfig.test.json Create test tsconfig. (#522) 1 year ago
tslint.json Add linting rules for tfjs-models. (#333) 2 years ago
update_yarn_lock.sh fix security vulnerabilities (#620) 10 months ago
workspace.code-workspace Add base class and types. (#607) 10 months ago
yarn.lock Bump ansi-regex from 5.0.0 to 5.0.1 (#878) 1 month ago

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
BodyPix
live Real-time person and body part segmentation in the browser using TensorFlow.js. npm i @tensorflow-models/body-pix
source
BlazeFace
live Real-time rapid Face detection in the browser using TensorFlow.js. npm i @tensorflow-models/blazeface
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
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