Add yolov5 as submodule and place to put trained files

This commit is contained in:
Matt McWilliams 2023-06-29 00:17:03 -04:00
parent a7e9c5cbf3
commit 559e0777cf
5 changed files with 28 additions and 1 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "yolov5"]
path = yolov5
url = https://github.com/ultralytics/yolov5.git

3
models/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*
!.gitignore

View File

@ -0,0 +1,6 @@
#!/bin/bash
cd yolov5
python -m venv env
source env/bin/activate
python -m pip install -r requirements.txt

View File

@ -46,5 +46,19 @@ if [ ! -f "${UNZIPPED}/data.yaml" ]; then
exit 1
fi
FULLDEST=$(realpath "${DEST}")
FULLDEST=$(realpath "${UNZIPPED}")
python scripts/data.py "${FULLDEST}/data.yaml"
cd yolov5
source env/bin/activate
WEIGHTS="yolov5s.pt"
if [[ "${MODEL}" == "yolov5m_onnx" ]]; then
WEIGHTS="yolov5m.pt"
else if [[ "${MODEL}" == "yolov5l_onnx" ]]; then
WEIGHTS="yolov5l.pt"
fi
python train.py --img 640 --batch 16 --epochs 300 --data "${FULLDEST}/data.yaml" --weights "${WEIGHTS}" --cache --project ../models/ --name "${ID}"

1
yolov5 Submodule

@ -0,0 +1 @@
Subproject commit 0004c745daeebb0eb6455b90c3e8abb308e61320