JavaScript computer vision libraries

Updated Nov 2026

JavaScript computer vision libraries analyze images and video frames to find faces, objects, poses, and regions. Detection runs a pretrained model in the browser or in Node.js after the library loads its weight files. These libraries add face filters, background removal, document scanning, and camera-based input to web apps.

Popularity

MediaPipe Tasks Vision has the most monthly downloads in this comparison, at 31.4M.

LibraryMonthly downloadsStarsLast releaseLicense
@mediapipe/tasks-vision
31.4M
37.7KNov 2026Apache-2.0
@huggingface/transformers
19.1M
16.4KOct 2026Apache-2.0
@tensorflow/tfjs
2.4M
19.2KOct 2024Apache-2.0
@techstark/opencv-js
1.5M
790Jun 2026Apache-2.0
@vladmandic/face-api
669.7K
1.1KFeb 2025MIT
@vladmandic/human
430.3K
3.4KAug 2025MIT
@tensorflow-models/blazeface
305.0K
14.8KAug 2023Apache-2.0
@tensorflow-models/face-detection
287.3K
14.8KOct 2024Apache-2.0
Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Features compared

LibraryFace keypoint taskImage segmentation APIFace descriptor pipeline
@mediapipe/tasks-visionBuilt-inBuilt-inUnsupported
@huggingface/transformersUnsupportedBuilt-inUnsupported
@tensorflow/tfjsUnsupportedUnsupportedUnsupported
@techstark/opencv-jsBuilt-inBuilt-inUnsupported
@vladmandic/face-apiBuilt-inUnsupportedBuilt-in
@vladmandic/humanBuilt-inBuilt-inBuilt-in
@tensorflow-models/blazefaceBuilt-inUnsupportedUnsupported
@tensorflow-models/face-detectionBuilt-inUnsupportedUnsupported
Built-inNot supported

Libraries and code examples

@mediapipe/tasks-vision

Provides JavaScript vision tasks for MediaPipe.

Downloads / mo
31.4M
Stars
37.7K
Last release
1.2.3
License
Apache-2.0

Strengths

  • Locates facial keypoints. Use FaceLandmarker on images or decoded video frames.
  • Returns segmentation masks. Choose ImageSegmenter for labeled regions instead of detection boxes.

Limitations

  • Inference can block the interface. Move detection into a Web Worker to keep the interface responsive.
  • Face smoothing requires one face. Set FaceLandmarker's numFaces to one to enable smoothing.
$ npm install @mediapipe/tasks-vision
import { FaceLandmarker, FilesetResolver } from '@mediapipe/tasks-vision';

const vision = await FilesetResolver.forVisionTasks('/mediapipe/wasm');
const detector = await FaceLandmarker.createFromOptions(vision, {
  baseOptions: { modelAssetPath: '/models/face_landmarker.task' },
  runningMode: 'IMAGE'
});
const image = document.getElementById('image');
await image.decode();
const result = detector.detect(image);
detector.close();

@mediapipe/tasks-vision examples

From open-source projects on GitHub

@huggingface/transformers

Runs pretrained Hugging Face models in the browser with an API close to the Python transformers library.

Downloads / mo
19.1M
Stars
16.4K
Last release
4.3.2
License
Apache-2.0

Strengths

  • Covers common vision tasks. Pipelines handle image classification, object detection, segmentation, and depth estimation.
  • Runs models through ONNX Runtime. PyTorch, TensorFlow, and JAX models convert to ONNX before they run.

Quickstart

From depth-estimation.d.ts
$ npm install @huggingface/transformers
import { pipeline } from '@huggingface/transformers';

const estimateDepth = await pipeline(
  'depth-estimation', 'onnx-community/depth-anything-v2-small'
);
const { depth } = await estimateDepth('/input.jpg');

@huggingface/transformers examples

From open-source projects on GitHub

@tensorflow/tfjs

Trains and deploys machine learning models in JavaScript with hardware acceleration.

Downloads / mo
2.4M
Stars
19.2K
Last release
4.22.0
License
Apache-2.0

Strengths

  • Runs converted TensorFlow models. Model converters bring existing TensorFlow models into the browser.
  • Same API in Node.js. Server code runs native TensorFlow through the same API.

Quickstart

From resize_bilinear.d.ts
$ npm install @tensorflow/tfjs
import * as tf from '@tensorflow/tfjs';

const image = tf.zeros([2, 2, 3]);
const resized = tf.image.resizeBilinear(image, [4, 4]);
console.log(resized.shape);
image.dispose();
resized.dispose();

@tensorflow/tfjs examples

From open-source projects on GitHub

@techstark/opencv-js

Packages OpenCV.js for Node.js and browser applications.

Downloads / mo
1.5M
Stars
790
Last release
5.0.0-release.1
License
Apache-2.0

Strengths

  • Directly converts image colors. Use cvtColor before a later detection or measurement step.
  • Supports Node and browser hosts. Load the packaged runtime in Node or a browser.

Limitations

  • Native matrices need cleanup. Delete Mat objects after processing to release their native memory.
  • Types can differ from runtime. Check cvKeys.json before relying on a declared method.

Quickstart

From README.md
$ npm install @techstark/opencv-js
import cvModule from '@techstark/opencv-js';

let cv = cvModule;
if (cvModule instanceof Promise) {
  cv = await cvModule;
} else if (!cvModule.Mat) {
  await new Promise(resolve => { cvModule.onRuntimeInitialized = resolve; });
}
const matrix = cv.imread(document.getElementById('image'));
console.log(matrix.rows, matrix.cols);
matrix.delete();

@techstark/opencv-js examples

From open-source projects on GitHub

@vladmandic/face-api

Provides face detection, landmark, and face-description APIs using TensorFlow.js.

Downloads / mo
669.7K
Stars
1.1K
Last release
1.7.15
License
MIT

Strengths

  • Extracts face landmarks and descriptors. Chain landmark and descriptor methods after detecting faces.
  • Chooses between face detectors. Select TinyFaceDetector or SSD Mobilenet through the detector options.

Limitations

  • Upstream repository is archived. The original repository is now read-only.
  • Recent Node releases are unsupported. Use Node 22 or an earlier supported release for server inference.
  • Models need manifest and weights. Serve each model manifest beside its weight shard files.

Quickstart

From node-simple.js
$ npm install @vladmandic/face-api @tensorflow/tfjs-node
const fs = require('node:fs');
const faceapi = require('@vladmandic/face-api');

(async () => {
  await faceapi.nets.ssdMobilenetv1.loadFromDisk('node_modules/@vladmandic/face-api/model');
  const image = faceapi.tf.node.decodeImage(fs.readFileSync('input.jpg'), 3);
  const faces = await faceapi.detectAllFaces(image);
  image.dispose();
})();

@vladmandic/face-api examples

From open-source projects on GitHub

@vladmandic/human

Detects faces and tracks their rotation, with face description for recognition.

Downloads / mo
430.3K
Stars
3.4K
Last release
3.3.6
License
MIT

Strengths

  • Runs only the models needed. Frame-change detection triggers only the models a frame needs.
  • Handles video and webcam input. Images, video, and webcam streams feed the pipeline directly.

Limitations

  • Chromium comes first. Firefox and Safari are secondary platforms.

Quickstart

From README.md
$ npm install @vladmandic/human
import { Human } from '@vladmandic/human';

const human = new Human({ modelBasePath: '/models/' });
const image = document.getElementById('image');
await image.decode();
const result = await human.detect(image);

@vladmandic/human examples

From open-source projects on GitHub

@tensorflow-models/blazeface

Detects faces with a pretrained model in TensorFlow.js.

Downloads / mo
305.0K
Stars
14.8K
Last release
0.1.0
License
Apache-2.0

Limitations

  • Deprecated. New code uses the face-detection package instead.

Quickstart

From index.d.ts
$ npm install @tensorflow-models/blazeface @tensorflow/tfjs
import '@tensorflow/tfjs';
import * as blazeface from '@tensorflow-models/blazeface';

const image = document.getElementById('image');
await image.decode();
const detector = await blazeface.load();
const faces = await detector.estimateFaces(image, false);
detector.dispose();

@tensorflow-models/face-detection

Provides models for running real-time face detection in JavaScript.

Downloads / mo
287.3K
Stars
14.8K
Last release
1.0.3
License
Apache-2.0

Strengths

  • Returns keypoints per face. Each detected face carries a bounding box and an array of keypoints.
  • Chooses its runtime. The detector config selects the MediaPipe or TensorFlow.js runtime.

Limitations

  • Offers a single model. MediaPipe FaceDetection is the only model the package provides.

Quickstart

From README.md
$ npm install @tensorflow-models/face-detection @tensorflow/tfjs-core @tensorflow/tfjs-converter @tensorflow/tfjs-backend-webgl
import '@tensorflow/tfjs-backend-webgl';
import * as faceDetection from '@tensorflow-models/face-detection';

const detector = await faceDetection.createDetector(
  faceDetection.SupportedModels.MediaPipeFaceDetector, { runtime: 'tfjs' }
);
const image = document.getElementById('image');
await image.decode();
const faces = await detector.estimateFaces(image);
detector.dispose();

@tensorflow-models/face-detection examples

From open-source projects on GitHub

FAQ

TensorFlow.js is a hardware-accelerated JavaScript library for training and deploying machine learning models in the browser and in Node.js. Its model converters run existing TensorFlow models in the browser.

Transformers.js runs pretrained Hugging Face models in the browser through ONNX Runtime. Its vision pipelines cover image classification, object detection, segmentation, and depth estimation.

FaceLandmarker is a task in MediaPipe Tasks Vision that locates facial keypoints in images and decoded video frames. The face-landmarker detect and detectForVideo methods run synchronously and block the interface thread; a worker can move that work away from it.

Yes. BlazeFace is deprecated in favor of the face-detection package from the same TensorFlow.js models repository.

MediaPipe Tasks Vision runs task-specific models for face landmarks, detection, and segmentation. OpenCV.js exposes OpenCV's matrix and image-processing operations through WebAssembly.

OpenCV's own image-processing example deletes each allocated matrix after use.

For coding agents

Found your computer vision library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official