best smart application πΌοΈ Object Detection Image
An end-to-end web application that allows users to upload images and receive annotated results with detected objects using a YOLOv5 model. The system comprises a React frontend and a Flask backend, facilitating seamless object detection and visualization. πΈ Demo
Replace with an actual image or GIF showcasing your project's functionality. π Features
Image Upload: Users can upload images through the web interface.
Object Detection: Utilizes a YOLOv5 model to detect and classify objects within the uploaded images.
Annotated Results: Returns images with bounding boxes and labels indicating detected objects.
Responsive Frontend: Built with React and Tailwind CSS for a responsive and user-friendly interface.
Backend API: Flask-based API handles image processing and model inference.
π οΈ Tech Stack
Frontend: React, Vite, Tailwind CSS
Backend: Flask, PyTorch, YOLOv5
Model: Pre-trained YOLOv5 model (yolov5mu.pt)
Others: PostCSS, ESLint
π Project Structure
Object-Detection-Image/
βββ backend/
β βββ requirements.txt
β βββ server.py
β βββ uploads/
β β βββ annotated_image.jpg
β β βββ car.jpg
β β βββ cat.jpg
β β βββ dog.jpg
β βββ yolov5/
β βββ yolov5mu.pt
βββ frontend/
β βββ eslint.config.js
β βββ index.html
β βββ package.json
β βββ package-lock.json
β βββ postcss.config.js
β βββ public/
β β βββ vite.svg
β βββ src/
β β βββ App.css
β β βββ App.jsx
β β βββ assets/
β β β βββ react.svg
β β βββ components/
β β β βββ ObjectDetection.jsx
β β βββ index.css
β β βββ main.jsx
β βββ tailwind.config.js
β βββ vite.config.js
βββ README.md
βοΈ Installation Backend Setup
Navigate to the backend directory:
cd backend
Create and activate a virtual environment (optional but recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
Install dependencies:
pip install -r requirements.txt
Run the Flask server:
python server.py
The backend server will start on http://localhost:5000.
Frontend Setup
Navigate to the frontend directory:
cd frontend
Install dependencies:
npm install
Start the development server:
npm run dev
The frontend will be available at http://localhost:3000.
π§ͺ How It Works
Image Upload: Users upload an image through the React frontend.
API Request: The image is sent to the Flask backend via a POST request.
Object Detection: The backend processes the image using the YOLOv5 model and generates an annotated image with detected objects.
Response: The annotated image is sent back to the frontend and displayed to the user.
Include relevant screenshots here. π Future Enhancements
Real-Time Detection: Extend functionality to support real-time object detection via webcam.
Model Selection: Allow users to choose between different YOLO models or custom-trained models.
Performance Optimization: Implement caching and optimize model loading for faster inference.
π License
This project is licensed under the MIT License.