This project is a web application that performs real-time object detection using the YOLO (You Only Look Once) model, integrated with Flask and OpenCV. The app allows users to upload an image or use their webcam for detecting various objects in real-time.
- Python 3.x
- Flask
- OpenCV (cv2)
- YOLOv3 weights, configuration file, and class names file
- A modern web browser (Chrome, Firefox, etc.)
-
Clone the repository:
-
Install the required Python dependencies:
-
Download the following YOLOv3 files:
- yolov3.weights
- yolov3.cfg
- coco.names
Place these files in the
yolo_web_appdirectory.
-
Run the Flask app:
-
Open a web browser and navigate to:
-
Image Upload for Object Detection: Allows users to upload an image file for object detection. The detected objects will be highlighted with bounding boxes and labeled with their names and confidence scores.
-
Webcam Real-Time Detection: Users can start the webcam and perform real-time object detection. Detected objects will be continuously updated on the screen.
-
Dark Mode Toggle: The app supports both light and dark modes. Users can toggle between the modes for a better viewing experience.
-
Detected Items: The app displays a list of detected objects with their confidence scores after each detection.
- Navigate to the app's main page.
- Upload an image using the file input or start the webcam detection by clicking on the "Start Webcam Detection" button.
- The app will display the uploaded or detected image with bounding boxes around the detected objects. It will also list the objects detected with their confidence scores.
yolo_web_app/app.py: The main Flask application file.yolov3.weights: The pre-trained YOLOv3 weights file.yolov3.cfg: The YOLOv3 configuration file.coco.names: The file containing the class labels for YOLO.templates/index.html: The HTML template for the main page of the web app.webcam.html: A dedicated page for webcam object detection.requirements.txt: A file listing Python dependencies.
- No webcam detection: Ensure your browser has permissions to access the webcam.
- Error loading YOLO files: Verify that the
yolov3.weights,yolov3.cfg, andcoco.namesfiles are located in theyolo_web_appdirectory.
Feel free to fork this repository and contribute by submitting pull requests or creating issues if you encounter bugs or have feature suggestions.
This project is licensed under the MIT License.
Syed Abdul Qadeer
You will need to download the weights file (yolov3.weights) and place it inside the same folder from https://github.com/patrick013/Object-Detection---Yolov3/blob/master/model/yolov3.weights
contact me if need any help : +918074697012