-
Objective: Develop an object detection system using the YOLOv5s pretrained model.
-
Dataset:
- Total Images: 2,086 images
- Training Images: 1,461
- Validation Images: 417
- Testing Images: 208
- Annotation Tool: Data was annotated using Roboflow for efficient labeling.
-
Model Training:
- Framework: Utilized the YOLOv5s model, known for its speed and accuracy.
- Environment: Training conducted on Google Colab with GPU support.
- Epochs: The model was trained for 250 epochs, resulting in significant improvements in detection accuracy.
- Performance: The trained model demonstrated great accuracy on the validation and testing datasets.
-
Additional Information: Further details, including setup instructions and usage, can be found in the project repository.
Object_Detection-End-to-End-project/
βββ .github/
β βββ workflows/
β βββ main.yaml
βββ .jenkins/
β βββ Jenkinsfile
βββ artifact/
β βββ 10_05_2024_03_23_14 (or time Stamp)/
β βββ data_ingestion/
β β βββ feature_store/
β β β βββ test
β β β βββ train
β β β βββ valid
β β β βββ data.yaml
β βββ SignLangData.Zip
β βββ data_validation/
β β βββ status.txt
β βββ model_trainer/
β βββ best.pt
βββ data/
β βββ .gitkeep
β βββ inputImage.jpg
βββ flowchart/
βββ logs/
βββ notebook/
β βββ Object_Detection_with_Yolov5.ipynb
β βββ test.ipynb
βββ scripts/
β βββ ec2_setup.sh
β βββ jenkins.sh
βββ SignLanguage or src/
β βββ components/
β β βββ __pycache__/
β β βββ __init__.py
β β βββ data_ingestion.py
β β βββ data_validation.py
β β βββ model_pusher.py
β β βββ model_trainer.py
β βββ configuration/
β β βββ __pycache__/
β β βββ logs/
β β βββ __init__.py
β β βββ gdown_connection.py
β β βββ s3_operations.py
β βββ constants/
β β βββ __pycache__/
β β βββ __init__.py
β β βββ training_pipeline/
β βββ entity/
β βββ __pycache__/
β βββ __init__.py
β βββ artifact_entity.py
β βββ config_entity.py
βββ templates/
β βββ index.html
βββ yolov5/
βββ app.py
βββ data_collector.py
βββ docker_compose.yml
βββ Dockerfile
βββ README.md
βββ requirements.txt
βββ setup.py
βββ template.py
- Clone the repository:
git clone https://github.com/shaheennabi/Object_detection-End-to-End-project.git cd Object_detection-End-to-End-project
- Create a new conda environment and activate it:
conda create -n signLanguage python=3.10 -y
conda activate signlanguage
- Install the required dependencies:
pip install -r requirements.txt
set DATA_DOWNLOAD_URL=https://drive.google.com/uc?/export=download&id= your file_id goes here"
export DATA_DOWNLOAD_URL="https://drive.google.com/file/d/ your file_id goes here"
After creating the project template:
- π Update constants π
- π Update Entity modules π
- π Update respective component π
- π Update pipeline π
- π Endpoint - (app.py) π
-
Ensure the dataset is properly loaded in the
data/
folder. -
Run the training script:
python cd yolov5/ && python train.py --img 416 --batch 16 --epochs 300 --data '../data.yaml' --cfg ./models/custom_yolov5s.yaml --weights 'yolov5s.pt' --name yolov5s_results --cache
To use the trained model for inference on new images, run:
python cd yolov5/ && python detect.py --weights /content/runs/train/yolov5s_results/weights/best.pt --img 416 --conf 0.5 --source /content/test/images
To deploy the application locally:
- Install the dependencies in
requirements.txt
. - Run the Flask app:
python app.py
- Update package lists
sudo apt update
- Update package lists (alternate command)
sudo apt-get update
- Upgrade the system
sudo apt upgrade -y
- Download Docker installation script
curl -fsSL https://get.docker.com -o get-docker.sh
- Run the Docker installation script
sudo sh get-docker.sh
- Add current user to the Docker group (run both lines)
sudo usermod -aG docker $USER
sudo usermod -aG docker $USER
- Install AWS CLI
sudo apt install awscli -y (if not worked- install with curl -check doc)
- AWS Configuration
aws configure
- Update package lists
sudo apt update
- Install OpenJDK 8
sudo apt install openjdk-8-jdk -y
# Jenkins repository (links for reference)
# https://pkg.jenkins.io/
# https://pkg.jenkins.io/debian-stable/
- Start Jenkins service
sudo systemctl start jenkins
- Enable Jenkins to start on boot
sudo systemctl enable jenkins
- Check the status of Jenkins service
sudo systemctl status jenkins
- Download Docker installation script
curl -fsSL https://get.docker.com -o get-docker.sh
- Run the Docker installation script
sudo sh get-docker.sh
- Add current user to Docker group
sudo usermod -aG docker $USER
- Add Jenkins user to Docker group
sudo usermod -aG docker jenkins
- Activate Docker group changes
newgrp docker
- Install AWS CLI
sudo apt install awscli -y
- Add Jenkins to Docker group again to ensure it has access
sudo usermod -a -G docker jenkins
- Download Docker installation script
curl -fsSL https://get.docker.com -o get-docker.sh
- Run the Docker installation script
sudo sh get-docker.sh
- Add current user to Docker group
sudo usermod -aG docker $USER
- Add Jenkins user to Docker group
sudo usermod -aG docker jenkins
- Activate Docker group changes
newgrp docker
- Install AWS CLI
sudo apt install awscli -y
- Add Jenkins to Docker group again to ensure it has access
sudo usermod -a -G docker jenkins
- Retrieve the initial Jenkins admin passwo
sudo cat /var/lib/jenkins/secrets/initialAdminPassword