Skip to content

Waste detection using YOLOv5 presents a promising approach for automating waste identification, classification, and localization. Its real-time capabilities, high accuracy, and adaptability make it a valuable tool for waste management, environmental monitoring, and robotic applications.

License

Notifications You must be signed in to change notification settings

utpalpaul108/waste-detection-using-yoloV5

Repository files navigation

Waste Detection Using YOLOv5 🚀

Examples

    

Workflows

  1. Update config.yaml
  2. Update secrets.yaml [Optional]
  3. Update params.yaml
  4. Update the entity
  5. Update the configuration manager in src config
  6. Update the components
  7. Update the pipeline

Dataset

  • Here, I have used this waste detection dataset. You can use your own dataset. Just place the URL of the dataset in config/config.yaml/data_ingestion/source_URL

Steps to run

STEP 00 : Clone the repository
https://github.com/utpal108/waste-detection-using-yoloV5
STEP 01 : Create a virtial environment after opening the repository

Using Anaconda Virtual Environments

conda create -n venv python=3.10 -y
conda activate venv

Or for Linux operating system, you can use that

python3.10 -m venv venv
source venv/bin/activate
STEP 02 : Install the requirements
pip install -r requirements.txt

Finally, run the following command to run your application:

python app.py
STEP 03 : Run the application

Now,open up your local host with a port like that on your web browser.

http://localhost:8080
STEP 04 : Train the model

Before predicting, you have to train your model with your own dataset.

http://localhost:8080/train

After completing the training, you can now detect waste from any image or live video.

STEP 05 : Live Prediction

To detect waste from any live video, you have to follow this URL

http://localhost:8080/live

AWS CICD Deployment With Github Actions

STEP 00 : Login to AWS console.

STEP 01 : Create IAM user for deployment

#with specific access

1. EC2 access : It is virtual machine

2. ECR: Elastic Container registry to save your docker image in aws


#Description: About the deployment

1. Build docker image of the source code

2. Push your docker image to ECR

3. Launch Your EC2 

4. Pull Your image from ECR in EC2

5. Lauch your docker image in EC2

#Policy:

1. AmazonEC2ContainerRegistryFullAccess

2. AmazonEC2FullAccess

STEP 02 : Create ECR repo to store/save docker image

- Save the URI: 681776806933.dkr.ecr.us-east-2.amazonaws.com/waste-detection

STEP 03 : Create EC2 machine (Ubuntu)

STEP 04 : Open EC2 and Install docker in EC2 Machine:

#optinal

sudo apt-get update -y

sudo apt-get upgrade

#required

curl -fsSL https://get.docker.com -o get-docker.sh

sudo sh get-docker.sh

sudo usermod -aG docker ubuntu

newgrp docker

STEP 05 : Configure EC2 as self-hosted runner: setting>actions>runner>new self hosted runner> choose os> then run command one by one

STEP 06 : Setup github secrets:

AWS_ACCESS_KEY_ID=

AWS_SECRET_ACCESS_KEY=

AWS_REGION = us-east-2

AWS_ECR_LOGIN_URI = demo>>  681776806933.dkr.ecr.us-east-2.amazonaws.com

ECR_REPOSITORY_NAME = waste-detection

About

Waste detection using YOLOv5 presents a promising approach for automating waste identification, classification, and localization. Its real-time capabilities, high accuracy, and adaptability make it a valuable tool for waste management, environmental monitoring, and robotic applications.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published