Skip to content

prithvii9/Real-Time-Image-Classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 

Repository files navigation

Real-time Image Classification with MobileNetV2

This project demonstrates real-time image classification using a webcam feed and the pre-trained MobileNetV2 model from TensorFlow Keras.

πŸ“Œ Features

  • Loads MobileNetV2 pre-trained on ImageNet.
  • Captures live video from webcam.
  • Classifies each frame in real-time.
  • Displays predicted label and confidence score on screen.
  • Press 'q' to quit.

πŸ› οΈ Requirements

Install dependencies before running the program:

pip install opencv-python tensorflow numpy

▢️ Usage

Run the script:

python RealTimeImageClassification.py

Press 'q' to exit the window.

πŸ“‚ File Structure

.
β”œβ”€β”€ RealTimeImageClassification.py  # Main script
└── README.md                                # This documentation

βš™οΈ How It Works

  1. Loads MobileNetV2 with pre-trained ImageNet weights.
  2. Captures video from the webcam.
  3. Preprocesses each frame:
    • Converts BGR β†’ RGB
    • Resizes to 224Γ—224
    • Applies MobileNetV2 preprocessing
  4. Passes the frame through the model.
  5. Displays the top predicted class with confidence score.

🧠 Model

  • MobileNetV2 -- Lightweight convolutional neural network optimized for real-time applications.
  • Pre-trained on ImageNet (1,000 classes).

πŸ–ΌοΈ Output Example

When you point the webcam at an object, you'll see:

Laptop : 95.2%

overlayed on the live feed.

πŸ”‘ Notes

  • Ensure your webcam is accessible.
  • First prediction might be slightly slower due to model loading.
  • Works best in good lighting conditions.

πŸ‘€ Author

Developed by Prithviraj Chavan.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages