Research Demo
Image Object Detector
Upload an image and a pre-trained COCO-SSD model finds the objects in it — drawing a bounding box around each one and listing its label with a confidence score. Detection runs entirely in your browser; the image is never uploaded.
Interactive demo
Drag and drop an image here
JPEG, PNG, WebP or GIF · up to 10 MB · processed on your device, never uploaded
No image to hand? Use a photo of a developer workspace.
Pipeline
How it works
Upload Image
Choose or drop a JPEG, PNG, WebP or GIF. It is read locally as an object URL and never sent to a server.
Process Image
The image is decoded and, if very large, scaled to 1600 px on its longest side. TensorFlow.js prepares its WebGL backend.
Detect Objects
COCO-SSD — a Single Shot MultiBox Detector on a lite MobileNet v2 base — returns up to 20 boxes scoring 50% or higher.
Display Results
Each prediction's class, confidence score and bounding box is drawn over the image and listed beside it.
Under the hood
Technology
- Computer Vision
- Object Detection
- On-device Inference
Inference runtime
TensorFlow.js
Runs the model inside the browser, so detection needs no server and the image stays on the device.
Pre-trained model
COCO-SSD
Object detector trained on the COCO dataset's 80 everyday classes, loaded with its default lite_mobilenet_v2 base.
Acceleration
WebGL
The TensorFlow.js backend the demo selects, running the model's maths on the GPU where the browser supports it.
Interface
Next.js & React
Upload, states and the bounding-box overlay. The model is only downloaded once a visitor starts the demo.
Research
Write-up & links
Research write-upClient-Side Object Detection and Matching Using face-api.js and TensorFlow.js in a Next.js ApplicationCovers face matching with face-api.js as well as general objects; the live demo above uses COCO-SSD.
Abstract
The shift toward client-side machine learning has enabled the development of privacy-preserving, real-time applications directly in the browser. This write-up describes a client-side object detection and matching system built using TensorFlow.js and face-api.js, embedded in a Next.js application. The system detects human faces and general objects and extracts feature embeddings for similarity-based matching. Because inference runs on the device, no image is sent to a server, which keeps uploads private and removes server load. Observations from informal testing are summarised below.
1. Introduction
Object detection and recognition have become essential in security, automation, healthcare, and consumer applications. However, traditional server-side solutions often raise concerns around scalability, latency, and user data privacy. With the advent of TensorFlow.js, developers can now build powerful machine learning tools that operate fully within the browser. This project implements client-side of object (primarily human face) detection and similarity matching using face-api.js, a wrapper built on top of TensorFlow.js. The solution is developed in a Next.js environment, allowing seamless SSR/CSR integration and optimized React component architecture.
2. System Overview
2.1 Tools and Technologies
| Technology | Purpose |
|---|---|
| Next.js | React-based full-stack framework |
| TensorFlow.js | Browser-based ML library |
| face-api.js | Pretrained face/object detection & recognition |
| HTML Canvas | Image visualization and overlay |
| JavaScript | Client logic and event handling |
2.2 Architecture Diagram
[User Uploads Image]
↓
[face-api.js Loads Models]
↓
[Detect Object(s)]
↓
[Extract Feature Embeddings]
↓
[Compare with Stored Embeddings]
↓
[Display Matching Result]3. Object Detection Methodology
3.1 Detection Pipeline
- Load pre-trained models:
- tinyFaceDetector or ssdMobilenetv1 (for faces)
- Can extend with COCO-SSD for generic objects
- Run detection on input image using:
const detections = await faceapi.detectAllFaces(image).withFaceLandmarks().withFaceDescriptors();
- Use descriptors (128D embeddings) to compare with known embeddings using L2 distance.
4. Observations
These are qualitative observations from informal testing, not a benchmark on a standard dataset.
| Scenario | Observed behaviour |
|---|---|
| Well-lit, front-facing faces | Detected and matched most reliably |
| Blurred images | Noticeably less reliable detection |
| Partial occlusion | Faces are often missed or matched poorly |
| Non-human objects | Limited with face-api.js alone; needs COCO-SSD |
4.1 Performance
Speed depends heavily on the device. Model loading adds a noticeable delay on first use, and older or low-end phones are clearly slower than laptops.
5. Applications
- Smart ID Verification: Match user-uploaded photo with ID database.
- Security Surveillance: Detect and recognize faces in real-time.
- Personalized User Experience: Tailor content based on recognized users.
- Augmented Reality: Overlay user-specific data in AR applications.
6. Limitations
- Limited to human faces and objects (until COCO-SSD is integrated)
- Not ideal for large datasets due to memory constraints.
- No direct support for detecting arbitrary objects (e.g., cars, animals) without COCO-SSD or YOLO integration.
- Performance varies significantly across devices, especially low-end smartphones.
- Slower on older devices due to model loading and processing.
7. Future Work
- Add support for COCO-SSD or YOLOv5 via ONNX in the browser.
- Introduce multi-object classification beyond face recognition.
- Build a face/object dataset manager in-browser.
- Implement live webcam feed analysis with bounding box tracking.
Conclusion
Client-side object detection and face recognition is no longer a theoretical concept. Using libraries like face-api.js and TensorFlow.js in a Next.js framework enables developers to deliver fast, private, and scalable solutions without relying on backend inference. With continuous advancements in web ML, the boundary between desktop-class and in-browser ML continues to blur.
References
- face-api.js
- TensorFlow.js
- COCO-SSD Model
- Schroff et al., FaceNet: A Unified Embedding for Face Recognition and Clustering, CVPR 2015.
- Next.js Documentation: https://nextjs.org/docs