Detect objects in images
Identify objects in your image
Count objects in an image by drawing a region of interest
Cutting edge open-vocabulary object detection app
Detect objects in your images
Detect marine vessels in images
Identify objects in images with high accuracy
Upload an image to detect objects
Run object detection on videos
Identify objects in an image with bounding boxes
Detect objects in uploaded images
Analyze images to count and classify mosquito species
Detect objects in images and videos
Transformers.js is a JavaScript library designed for object detection in images. It leverages modern JavaScript frameworks and APIs to provide a powerful, browser-based solution for detecting objects within visual content. The library is optimized for performance and ease of use, making it accessible to both developers and non-experts.
• Object Detection: Identify and locate objects within images using pre-trained models.
• Real-Time Processing: Enable real-time object detection in web applications.
• High Accuracy: Pre-trained models ensure accurate detection across various object types.
• Customizable Models: Supports popular models like YOLO, SSD, and others.
• Threshold Adjustment: Configure confidence thresholds for detection accuracy.
• Lightweight: Built for performance in web environments.
npm install transformers.js
const { ObjectDetector } = require('transformers.js');
const detector = new ObjectDetector('yolo');
const results = await detector.detect(imageElement);
results.forEach(object => {
console.log)object.label, object.x, object.y);
});
1. What browsers are supported by Transformers.js?
Transformers.js is designed to work with modern browsers supporting WebGL and WebAssembly for optimal performance.
2. Can I use custom models with Transformers.js?
Yes, Transformers.js allows integration with custom models as long as they are compatible with its architecture and formatting requirements.
3. How do I handle video streams?
For video streams, use the detect()
method iteratively on each frame or use a Web Workers pattern to maintain smooth performance.