MCPcopy
hub / github.com/tensorflow/tfjs-models

github.com/tensorflow/tfjs-models @coco-ssd-v2.2.3 sqlite

repository ↗ · DeepWiki ↗ · release coco-ssd-v2.2.3 ↗
2,372 symbols 5,268 edges 582 files 350 documented · 15%
README

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

Extension points exported contracts — how you extend this code

BodySegmenter (Interface)
(no doc) [6 implementers]
body-segmentation/src/body_segmenter.ts
FaceDetector (Interface)
(no doc) [6 implementers]
face-detection/src/face_detector.ts
Mask (Interface)
(no doc) [14 implementers]
shared/calculators/interfaces/common_interfaces.ts
TaskModel (Interface)
(no doc) [7 implementers]
tasks/src/task_model.ts
PoseDetector (Interface)
(no doc) [8 implementers]
pose-detection/src/pose_detector.ts
FaceLandmarksDetector (Interface)
(no doc) [6 implementers]
face-landmarks-detection/src/face_landmarks_detector.ts
HandDetector (Interface)
(no doc) [4 implementers]
hand-pose-detection/src/hand_detector.ts
SpeechCommandRecognizer (Interface)
(no doc) [2 implementers]
speech-commands/src/types.ts

Core symbols most depended-on inside this repo

dispose
called by 98
body-segmentation/src/body_segmenter.ts
addExample
called by 87
speech-commands/src/dataset.ts
dispose
called by 78
pose-detection/src/pose_detector.ts
collectExample
called by 76
speech-commands/src/types.ts
dispose
called by 65
face-detection/src/face_detector.ts
setUpFakes
called by 64
speech-commands/src/browser_fft_recognizer_test.ts
apply
called by 63
shared/calculators/interfaces/common_interfaces.ts
createTransfer
called by 58
speech-commands/src/types.ts

Shape

Function 1,116
Method 711
Class 318
Interface 216
Enum 11

Languages

TypeScript100%

Modules by API surface

speech-commands/src/browser_fft_recognizer.ts51 symbols
speech-commands/src/types.ts43 symbols
speech-commands/src/dataset.ts28 symbols
depth-estimation/demos/relighting/js/gl-class.js28 symbols
depth-estimation/demos/depth_map/js/gl-class.js28 symbols
shared/calculators/render_util.ts26 symbols
body-pix/demo/index.js26 symbols
pose-detection/src/blazepose_tfjs/detector.ts23 symbols
depth-estimation/demos/3d_photo/js/gif.worker.js23 symbols
body-segmentation/src/body_pix/impl/body_pix_model.ts23 symbols
body-pix/src/body_pix_model.ts23 symbols
qna/src/bert_tokenizer.ts21 symbols

Dependencies from manifests, versioned

@angular-devkit/build-angular12.0.4 · 1×
@angular/animations12.0.4 · 1×
@angular/cdk12.0.4 · 1×
@angular/cli12.0.4 · 1×
@angular/common12.0.4 · 1×
@angular/compiler12.0.4 · 1×
@angular/compiler-cli12.0.4 · 1×
@angular/core12.0.4 · 1×
@angular/forms12.0.4 · 1×
@angular/material12.0.4 · 1×
@angular/platform-browser12.0.4 · 1×
@angular/platform-browser-dynamic12.0.4 · 1×

For agents

$ claude mcp add tfjs-models \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact