Skip to content

indra057/SmartVision-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ” Real-Time Object Detection App

Real-Time Object Detection App Icon

๐Ÿค– AI-Powered Mobile Object Detection

A powerful Android application that provides real-time object detection using state-of-the-art AI models. The app combines SSD MobileNet v1 for live camera detection and YOLOv5s for high-accuracy image analysis, delivering professional-grade object detection capabilities on mobile devices.

Android Version TensorFlow Lite License Version

๐Ÿ“ฑ Features

๐ŸŽฏ Core Capabilities

  • Real-time Object Detection: Live camera feed with instant object recognition
  • Dual AI Models:
    • SSD MobileNet v1 (TensorFlow Lite) for live camera detection
    • YOLOv5s (TensorFlow Lite) for uploaded image analysis
  • 80 COCO Object Classes: Detects people, vehicles, animals, household items, and more
  • High Performance: Optimized for mobile devices with GPU acceleration support

๐ŸŽฎ User Interface

  • Full-Screen Immersive Mode: Distraction-free detection experience
  • Live Camera Preview: Real-time video feed with overlay detection boxes
  • FPS Counter: Performance monitoring with frames-per-second display
  • Status Indicators: Visual feedback for detection state
  • Smooth Animations: Professional splash screen with elegant transitions

๐Ÿ“ท Camera Features

  • Front/Back Camera Switching: Toggle between cameras with one tap
  • Flash Control: Toggle camera flash for better visibility
  • Auto-Focus: Automatic focus adjustment for optimal detection
  • Aspect Ratio Handling: Proper scaling and cropping for different screen sizes

๐Ÿ–ผ๏ธ Image Analysis

  • Image Upload: Select and analyze photos from gallery
  • Batch Processing: Process multiple images with detailed results
  • Confidence Scoring: Percentage-based confidence indicators
  • Bounding Box Visualization: Clear object location highlighting

๐Ÿš€ Installation

Prerequisites

  • Android 7.0 (API 24) or higher
  • Camera permission (automatically requested)
  • Storage permission (for image uploads)
  • Minimum 2GB RAM recommended for optimal performance

Build from Source

Requirements

  • Android Studio (latest version)
  • Android SDK (API 24+)
  • Gradle 8.1.4+
  • Kotlin 1.9.10+

Build Steps

  1. Clone the Repository:

    git clone https://github.com/indra057/realtime_object_detection.git
    cd realtime_object_detection-main
  2. Open in Android Studio:

    • Launch Android Studio
    • Select Open an existing project
    • Navigate to the cloned folder and open it
  3. Sync Dependencies:

    • Android Studio will automatically sync Gradle dependencies
    • Wait for the sync to complete
  4. Build the Project:

    ./gradlew assembleDebug

    Or use Android Studio's Build โ†’ Build Bundle(s) / APK(s) โ†’ Build APK(s)

  5. Install on Device:

    • Connect your Android device via USB
    • Enable Developer Options and USB Debugging
    • Run ./gradlew installDebug or use Android Studio's run button
  6. Launch and Enjoy:

    • Open the app from your device
    • Allow camera permissions
    • Start detecting objects!

๐Ÿ“‹ Technical Specifications

AI Models

  • SSD MobileNet v1: 300x300 input, optimized for real-time detection
  • YOLOv5s: 320x320 input, high-accuracy detection for static images
  • TensorFlow Lite: Mobile-optimized inference engine
  • GPU Acceleration: Automatic GPU delegate when available

Performance

  • Detection Speed: 15-30 FPS on modern devices
  • Model Size: ~14MB total (both models)
  • Memory Usage: ~100-200MB during operation
  • Battery Impact: Optimized for minimal battery drain

Supported Objects (80 Classes)

People & Animals: person, cat, dog, horse, cow, sheep, bird, etc. Vehicles: car, truck, bus, motorcycle, bicycle, airplane, boat, etc. Household Items: chair, couch, bed, table, tv, laptop, phone, etc. Food & Drinks: apple, banana, pizza, cake, bottle, cup, etc. Sports & Recreation: sports ball, tennis racket, skateboard, etc.

๐ŸŽฏ How to Use

Live Camera Detection

  1. Launch the app - Grant camera permissions
  2. Point camera at objects you want to detect
  3. View results - Objects are highlighted with colored boxes
  4. Check confidence - Percentage scores show detection accuracy
  5. Switch cameras - Use the camera switch button for front/back
  6. Toggle flash - Use flash button for better lighting

Image Upload Analysis

  1. Tap upload button - Select image from gallery
  2. Wait for processing - YOLOv5s analyzes the image
  3. View results - Detailed detection with bounding boxes
  4. Tap image - Return to camera view

Controls Reference

  • ๐Ÿ”ฆ Flash Button: Toggle camera flash on/off
  • ๐Ÿ“ท Camera Switch: Switch between front and back cameras
  • ๐Ÿ“ค Upload Button: Select image for analysis
  • โ„น๏ธ Info Button: View app information and features

๐Ÿ“ธ Screenshots & Demo

App Screenshots

๐Ÿš€ Splash Screen

App Splash Screen

Professional splash screen with smooth animations

๐Ÿ“ท Object Detection Examples

Example 1 - Street Scene Detection:

Original Street Scene
Original Image
Detected Objects in Street Scene
With Object Detection

Detecting cars, people, and traffic elements with confidence scores

Example 2 - Outdoor Scene Detection:

Original Indoor Scene
Original Image
Detected Objects in Indoor Scene
With Object Detection

Detecting furniture, electronics, and household items

๐ŸŽฎ App Features

  • Live Camera Detection: Real-time bounding boxes with confidence scores
  • FPS Counter: Performance monitoring during detection
  • Status Indicators: Visual feedback for detection state
  • Control Buttons: Flash, camera switch, upload, and settings
  • Full-Screen Mode: Immersive detection experience

๐ŸŽฌ Live Demo

Real-Time Object Detection Demo

Live demonstration of the app's object detection capabilities

Demo Features:

  • App launch and splash screen animation
  • Live camera detection demonstration
  • Image upload and analysis process
  • Camera switching and flash control
  • Performance metrics and FPS display
  • Real-time bounding box detection

๐Ÿ”ง Troubleshooting

Common Issues

Camera Not Working:

  • Ensure camera permissions are granted
  • Restart the app if camera fails to initialize
  • Check if another app is using the camera

Slow Performance:

  • Close other apps to free up memory
  • Ensure device has sufficient RAM (2GB+)
  • Try restarting the device

Detection Accuracy Issues:

  • Ensure good lighting conditions
  • Hold device steady for better results
  • Clean camera lens for clearer images

App Crashes:

  • Check Android version compatibility (7.0+)
  • Clear app data and restart
  • Reinstall the app if issues persist

Performance Optimization

For Better FPS:

  • Close background applications
  • Enable GPU acceleration in device settings
  • Use release build for production

For Better Accuracy:

  • Ensure good lighting
  • Hold device steady
  • Use back camera for better quality

๐Ÿ› ๏ธ Development

Project Structure

app/
โ”œโ”€โ”€ src/main/
โ”‚   โ”œโ”€โ”€ java/com/programminghut/realtime_object/
โ”‚   โ”‚   โ”œโ”€โ”€ MainActivity.kt          # Main detection logic
โ”‚   โ”‚   โ”œโ”€โ”€ SplashActivity.kt        # Splash screen
โ”‚   โ”‚   โ”œโ”€โ”€ Yolov5TFLiteDetector.java # YOLOv5 implementation
โ”‚   โ”‚   โ””โ”€โ”€ Recognition.java         # Detection result model
โ”‚   โ”œโ”€โ”€ ml/                          # AI models
โ”‚   โ”‚   โ”œโ”€โ”€ ssd_mobilenet_v1_1_metadata_1.tflite
โ”‚   โ”‚   โ””โ”€โ”€ yolov5s-fp16.tflite
โ”‚   โ””โ”€โ”€ assets/                      # Labels and resources
โ”‚       โ”œโ”€โ”€ labels.txt               # SSD MobileNet labels
โ”‚       โ””โ”€โ”€ coco_label.txt           # YOLOv5 COCO labels

Key Dependencies

  • TensorFlow Lite: org.tensorflow:tensorflow-lite-support:0.4.4
  • TensorFlow Lite GPU: org.tensorflow:tensorflow-lite-gpu:2.13.0
  • AndroidX: Core Android libraries
  • Material Design: UI components

Building Custom Models

๐Ÿ“š Training Documentation: For detailed model training guides, see MODEL_TRAINING.md

Quick Steps:

  1. Train your model using TensorFlow/PyTorch
  2. Convert to TensorFlow Lite format
  3. Replace model files in app/src/main/ml/
  4. Update labels in app/src/main/assets/
  5. Rebuild the app

Note: Custom model training documentation is currently under development. The app works with pre-trained models out of the box.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

How to Contribute

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“ž Support

If you encounter any issues or have questions:

  1. Check the troubleshooting section above
  2. Search existing issues in the repository
  3. Create a new issue with detailed information
  4. Include device information and error logs

๐Ÿ™ Acknowledgments

  • TensorFlow Team for the amazing TensorFlow Lite framework
  • COCO Dataset for object detection labels
  • YOLOv5 Community for the detection model
  • Android Community for development resources

๐Ÿ“š Tutorial References

This project was built with help from following tutorials:

Special thanks to the tutorial creators for their comprehensive guides that made this project possible!

๐Ÿ“Š Version History

Version 1.0 (Current)

  • Initial release
  • Real-time camera detection with SSD MobileNet v1
  • Image upload analysis with YOLOv5s
  • Full-screen immersive interface
  • Camera switching and flash control
  • FPS monitoring and performance optimization

Made with โค๏ธ for the Android community

Transform your device into a powerful object detection tool with this professional-grade application!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published