A web application built with Next.js for the frontend and Flask for the backend, enabling users to upload images for vehicle detection and counting.
- Vehicle Detection: Upload an image and detect vehicles using YOLO (You Only Look Once) object detection algorithm.
- Vehicle Counting: Count the number of cars, trucks, buses, and motorcycles detected in the image.
- Visual Results: View the original and processed images with vehicle counts displayed.
Before you begin, ensure you have met the following requirements:
- Python and pip installed on your machine for the backend.
- Docker installed on your machine for containerization.
cd vehicle-detection
- Navigate to the project directory:
cd vehicle-detection
- Install frontend dependencies:
cd frontend
npm install
- Install backend dependencies:
cd ../backend
pip install -r requirements.txt
- Start the backend Flask server:
cd ../backend
python app.py
The server will start running at `http://localhost:8080`.
- Start the frontend Next.js server:
cd ../frontend
npm run dev
The frontend server will start running at `http://localhost:3000`.
-
Open your web browser and go to
http://localhost:3000
to access the application. -
Upload an image and click "Detect Vehicles" to initiate the vehicle detection process.
You can also run the application using Docker. Follow these steps:
- Build the Docker image:
docker-compose build
- Start the Docker containers:
docker-compose up
The frontend will be accessible at `http://localhost:3000` and the backend at `http://localhost:8080`.
Contributions are welcome! Please feel free to submit a pull request or open an issue for any bugs, feature requests, or suggestions.
To contribute to this project, follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.