Are you sure you want to delete this access key?
Legend |
---|
DVC Managed File |
Git Managed File |
Metric |
Stage File |
External File |
Legend |
---|
DVC Managed File |
Git Managed File |
Metric |
Stage File |
External File |
Fine Tuning the YOLO v5 and YOLO v8 algorithm on custom missile dataset with the custom labels for detecting missiles in images and video and deploying it in aws as an end to end project and performing modular coding.detection
1.Clone the repository
https://github.com/veera776127/YOLO-missile-detection-capstone-project.git
2.create a template.py file where it is used to create our folder structure and commit as per your requirement
3. In requirements.txt define all the required libraries to be installed in the environment
4. In setup.py give all details of the project
After opening the repository can give specific version of python or just give python so it will take latest version for downloading
conda create -n capstone python -y
conda activate capstone
pip install -r requirements.txt
created a logging code inside the init.py of src and then created common.py inside the utils where we use this as common code. Used configbox as exception handler insted of writing custom exception module
Refer below wesite for python sdk boto3 documentation for downloading data from AWS s3 bucket.
https://docs.aws.amazon.com/pythonsdk/
https://docs.aws.amazon.com/amazonglacier/latest/dev/sdk-general-information-section.html #for any other launguage
Refer this ultralytics documentation for full details on training
https://docs.ultralytics.com/modes/train/
Refer this ultralytics documentation for full details on validation
https://docs.ultralytics.com/modes/val/
Refer this ultralytics documentation for full details on validation
https://docs.ultralytics.com/modes/predict/#probs
#Check for existing running containers use -a for all including stopped
docker ps
#Check for existing docker images
docker images
# Build the docker
docker build -t missile-app .
#Run the docker (before pushing to docker hub in local)
#Docker maps this port to port 5000 on your host machine. This means you should be able to access your Flask application by visiting http://localhost:5000 in your web browser.
docker run -p 5000:5000 missile-app
#eg:(After pulling from docker hub)
docker run -d -p 5000:5000 thulasiram6787/capstone-yolo_missile_detection_001:latest
#Pushing the docker to docker hub
docker push thulasiram6787/capstone-yolo_missile_detection_001:latest
#Login to docker hub (give username and password)
docker login
#Create repository and tag it
docker tag missile-detection:latest yourusername/missile-detection:latest
#Push the docker image to the docker hub
docker push yourusername/missile-detection:latest
#Pull the docker image from the repository
docker pull thulasiram6787/capstone-yolo_missile_detection_001:latest
#Stop the running docker
docker stop
#Remove the existing image
docker rmi missile-app:latest
#Remove the Docker
docker rm
#Tranfering image from repository to repository
docker tag existing-image:tag new-repository:new-tag
(docker tag vishwas304/missile-detection:latest thulasiram6787/capstone-yolo_missile_detection_001:latest)
docker login
(docker push thulasiram6787/capstone-yolo_missile_detection_001:latest)
#Editing inside the docker shell
docker exec -it <container_name_or_id> cmd
docker exec -it <container_id_or_name> /bin/bash
docker cp /path/to/local/file <container_id_or_name>:/path/inside/container
Login to AWS console.
Create IAM user for deployment #with specific access
Configure EC2 machine with proper setup using VPC,security group,region take below as reference
EC2 access : It is virtual machine
ECR: Elastic Container registry to save your docker image in aws
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
AmazonEC2ContainerRegistryFullAccess
AmazonEC2FullAccess
Create ECR repo to store/save docker image
#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 6. Configure EC2 as self-hosted runner: 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-1
AWS_ECR_LOGIN_URI = 905418478717.dkr.ecr.us-east-1.amazonaws.com/missile (Thulasi aws ecr repository)
ECR_REPOSITORY_NAME = missile
set these keys in python environment where your project is been developed so that you can access the s3 bucket without mentioning the credentials in code.
set AWS_ACCESS_KEY_ID= (contact owner for AWS_ACCESS_KEY_ID)
set AWS_SECRET_ACCESS_KEY= (contact owner for AWS_SECRET_ACCESS_KEY)
set AWS_REGION=us-east-1
owner - veeramangalamthulasiram@gmail.com
set these keys in python environment where your project is been developed so that you can access the MLFLOW and track experiment.
export MLFLOW_TRACKING_URI=(contact owner for MLFLOW_TRACKING_URI)
export MLFLOW_TRACKING_USERNAME=veera776127
export MLFLOW_TRACKING_PASSWORD= (contact owner for MLFLOW_TRACKING_PASSWORD)
set MLFLOW_TRACKING_URI=(contact owner for MLFLOW_TRACKING_URI)
set MLFLOW_TRACKING_USERNAME=veera776127
set MLFLOW_TRACKING_PASSWORD=(contact owner for MLFLOW_TRACKING_PASSWORD)
os.environ["MLFLOW_TRACKING_URI"]=(contact owner for MLFLOW_TRACKING_URI)
os.environ["MLFLOW_TRACKING_USERNAME"]="veera776127"
os.environ["MLFLOW_TRACKING_PASSWORD"]=(contact owner for MLFLOW_TRACKING_PASSWORD)
Press p or to see the previous file or, n or to see the next file
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?