Skip to content

VT-Collab/Ycb_Yolov5_Trainer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ycb_Yolov5_Trainer

Installation

Commands to be executed in order:

  1. git clone Ycb_Yolov5_Trainer (Clone to any folder other than your Ycb_Dataset_Generator folder)
  2. cd ./Ycb_Yolov5_Trainer
  3. Setup and install Python 3.7.12 or Python 3.8.0 using Pyenv. CREATE and ACTIVATE a new python environment named 'YCB_Trainer' running Python 3.7.12 or Python 3.8.0. (This step is required to successfully meet all the requirements)
    • pyenv virtualenv 3.7.12 YCB_Trainer (Install python and create python virtual environment)
    • (Only for the initial setup) pyenv local YCB_Trainer (Activate python virtual environment)
    • pyenv versions (Check if the correct virtual environment with intended python version is active)
  4. pip install -r ./Requirements/requirements.txt (Installs Ycb_Yolov5_Trainer's requirements)
  5. Move/copy your custom dataset generated from following the steps on Ycb_Dataset_Generator to the current directory.
    •  mv ../Ycb_Dataset_Generator/custom_dataset .
    OR
    •  cp ../Ycb_Dataset_Generator/custom_dataset .
  6. git clone yolov5 (Clones ultralytics's yolov5 repository)
  7. cd ./yolov5
  8. pip install -r requirements.txt (Installs ultralytics's yolov5's requirements)
  9. Training a model (Transfer learning with ultralytic's pretrained checkpoints - faster & accurate):
    •  python ./train.py --img 640 --batch 16 --epochs 500 --data ../custom_dataset/data.yaml --cfg ./models/custom_yolov5s6.yaml --weights 'yolov5s6.pt' --name yolov5s6_results --cache
    • pretrained weights (more checkpoints available on ultralytics/yolov5 repository): yolov5s6 image
    • epochs (more number of epochs possible): 500
    • batch (higher number is possible with better hardware)
  10. Deploying custom trained model (Real Time Detection):
    • Collab's implementation:
      python ../yolov5Deploy.py live -1 ./runs/train/yolov5s6_results/weights/best.pt --mode 1
    • Ultralytic's implementation:
      python ./detect.py --source -1 --weights ./runs/train/yolov5s6_results/weights/best.pt

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages