This repository contains an object detection application built using OpenCV and TensorFlow's pre-trained SSD MobileNet model. The app allows users to detect objects in real-time using a webcam feed or to upload an image for detection. It also includes a streamlit app that does the same. Check out the hosted app here:
- Real-time Object Detection: Uses a webcam feed for live object detection.
- Image Upload Functionality: Detects objects in uploaded images.
- Customizable Confidence Threshold: Set the confidence level for object detection.
- Dark Mode GUI: Built with a dark-themed GUI using
customtkinter
. - Streamlit UI: Built a deployable web based GUI using
streamlit
.
main.py
: Contains the source code for the local GUI-based object detection application.app.py
: Contains the code for the Streamlit UI object detection application.coco.names
: Contains the list of object class labels used by the model.ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt
: Configuration file for the SSD MobileNet model.frozen_inference_graph.pb
: Pre-trained model file for SSD MobileNet.requirements.txt
: Lists Python dependencies for the application.LICENSE
: License information for the project.
- Python 3.8 or above.
- A working webcam for real-time detection (optional if using the image upload feature).
-
Clone the Repository:
git clone https://github.com/VanshajR/Object-Detection.git cd Object-Detection
-
Install Dependencies:
pip install -r requirements.txt
-
Run Locally:
python main.py
Or, to run the streamlit app:
streamlit run app.py
-
Usage:
- Click "Start Detection" to begin real-time object detection.
- Use "Upload Image" to upload an image and detect objects in it.
- Click "Stop Detection" to stop the live webcam feed.
- Ensure the
coco.names
,ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt
, andfrozen_inference_graph.pb
files are in the same directory asapp.py
. - For real-time detection, a webcam should be connected and accessible.
- As of the last update, the
streamlit_webrtc
library which streamlit itself uses for live feeds through webcams was not working, thus the streamlit app did not work for live feeds.
This project is licensed under the MIT License.