A real-time object detection app built with React Native using VisionCamera and TensorFlow Lite. Detect 80+ objects in real-time with bounding boxes and confidence scores.
- 📱 Real-time object detection with live camera feed
- 🎯 Bounding boxes with confidence percentages
- 📷 Front/back camera switching
- ⚡ FPS monitoring and performance stats
- 🎚️ Adjustable confidence threshold (10-90%)
- 🏷️ 80+ object classes from COCO dataset
Real-time object detection with bounding boxes and confidence scores
-
Clone the repository
git clone https://github.com/yourusername/react-native-object-detection.git cd react-native-object-detection
-
Install dependencies
npm install
-
Run the app
# iOS npx expo run:ios # Android npx expo run:android
- React Native 0.79.3 - Cross-platform mobile framework
- Expo - Development platform with prebuild workflow
- VisionCamera - Camera access and frame processing
- TensorFlow Lite - On-device ML inference
- SSD MobileNet v1 - Pre-trained object detection model
- Camera Feed: Captures live video frames at 30 FPS
- Preprocessing: Resizes frames to 300x300 pixels
- Inference: Runs TensorFlow Lite model on each frame
- Postprocessing: Filters detections by confidence threshold
- Rendering: Draws bounding boxes with labels on screen
- Confidence Threshold: Use the slider in the app (10-90%)
- Frame Processing: Modify frame processor in
App.js
- Model Quality: Replace with different TensorFlow Lite models
- Replace
models/ssd_mobilenet_v1.tflite
with your model - Update
models/labels.json
with corresponding class labels - Adjust input dimensions in the resize plugin if needed
- FPS: Real-time processing at 15-30 FPS (device dependent)
- Latency: ~50-100ms inference time on modern devices
- Memory: Optimized for mobile with worklet-based processing
iOS build fails:
npx expo prebuild --clean
npx expo run:ios
Metro bundler issues:
npx expo start --clear
Low performance:
- Reduce confidence threshold
- Lower camera quality preset
- Increase frame skip interval
This project is licensed under the MIT License - see the LICENSE file for details.
- VisionCamera for excellent camera integration
- TensorFlow Lite for mobile ML capabilities
- COCO Dataset for training data
⭐ Star this repo if you found it helpful!