A powerful object detection application capable of identifying objects in uploaded images using the YOLOv8 model. This project features a Flask backend and a user-friendly frontend interface.
Object Detection In Images/
├── static/
│ ├── index.html # Frontend interface
│ ├── script.js # Frontend logic
│ └── style.css # Styling
├── templates/ # Flask templates
├── uploads/ # Directory for uploaded images
├── app.py # Flask application entry point
├── detector.py # Object detection logic using YOLO
├── requirements.txt # Project dependencies
├── yolov8n.pt # YOLOv8 nano model weights
├── yolov8m.pt # YOLOv8 medium model weights
├── .gitignore
└── README.md
- Python - for compiling the code
- Git - for downloading this project
- Git LFS - Enable Git LFS for downloading YOLOv8 models
-
Clone the repository:
git clone https://github.com/Maheswara660/Object-Detection-In-Images.git cd Object-Detection-In-Images git lfs install git lfs pull -
Set up the Virtual Environment:
Navigate to the project root and create a virtual environment.
-
macOS/Linux:
python3 -m venv venv source venv/bin/activate -
Windows (Command Prompt):
python -m venv venv venv\Scripts\activate.bat
-
Windows (PowerShell):
python -m venv venv venv\Scripts\Activate.ps1
-
-
Install Dependencies: Install the required packages from
requirements.txt.pip install -r requirements.txt
Ensure your virtual environment is activated and you are in the project root directory.
# Set Flask app environment variable (optional but recommended)
export FLASK_APP=app.py
export FLASK_ENV=development
# Run the application
flask runOr simply run:
python app.pyThe application will start at http://127.0.0.1:5000/.
- Open your web browser and navigate to
http://localhost:5000. - Upload an image using the upload button.
- Adjust the confidence threshold if needed.
- View the detected objects and their bounding boxes on the processed image.
Contributions are welcome! Please feel free to submit a Pull Request.