ISD: industry safety detection, Purpose is creating a detection system using Computer vision and Machine Learning to monitor, track and enforce employees/workers to wear necessary safety gears. ISD is designed and modelled to take a real-time image of the personnel as input and determining if five segments - helmet, gloves, jacket, goggles and footwear are worn before entering the workplace, and record the procedure as well. If ISD doesn't find any of the five safety gears, the worker will not be allowed to proceed and prohibition alarm in the system will alert the security authorities.
Since real time image used for object detection, inference time is higher, so use YOLO series (since its state of the art model and, model size is also less)
-
Data Ingestion: We annotated, labelled images using Roboflow. Annotated data is downloaded as .zip file from AWS s3 bucket, unzip images
-
Data Validation: We added data validation component in this project since it relies on multiple folders, files that would be generated from data_ingestion component. This component would check if all the needed files exist or not, captured in validation status.
-
No data transformation needed in this case because we directly sending the image to model_training. No image preprocessing required.
-
Model Training: This component triggers if validation_status from data validation component is true. We trained with a pre-trained model, YOLOv7 to perform real-time object detection inference on images. - YOLOv7 performs faster with higher accuracy than previous models due to less number of parameters and higher computational efficiency
-
Model Pusher: Trained model is pushed to AWS s3
-
Deployed the pipeline to AWS EC2 using containers Docker, AWS ECR, CI/CD tool GitHub Actions
-
Built user application with Flask
- git add .
- git commit -m "Updated"
- git push origin main
- conda create -n isd python=3.8 -y
- conda activate isd
- pip install -r requirements.txt
- python app.py
#aws cli download link: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
aws configure
#with specific access
- EC2 access : It is virtual machine
- ECR: Elastic Container registry to save your docker image in aws
#Description: About the deployment
- Build docker image of the source code
- Push your docker image to ECR
- Launch Your EC2
- Pull Your image from ECR in EC2
- Lauch your docker image in EC2
#Policy:
- AmazonEC2ContainerRegistryFullAccess
- AmazonEC2FullAccess
- Save the URI: 637423357032.dkr.ecr.us-east-2.amazonaws.com/yolov7ecr
#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
- setting>actions>runner>new self hosted runner> choose os> then run command one by one
- AWS_ACCESS_KEY_ID=
- AWS_SECRET_ACCESS_KEY=
- AWS_REGION = us-east-2
- AWS_ECR_LOGIN_URI = demo>> 637423357032.dkr.ecr.us-east-2.amazonaws.com
- ECR_REPOSITORY_NAME = yolov7ecr