도커 컨테이너와 연결시킬 datasets안에 생성
mkdir yolo_tstl yolo_tstl/images yolo_tstl/labels
touch yolo_tstl/train.txt yolo_tstl/test.txt yolo_tstl/tstl.yaml
train: /tstl/datasets/train.txt
val: /tstl/datasets/test.txt
nc: 8 # number of classes
names:
0: left
1: right
2: stop
3: crosswalk
4: uturn
5: traffic_light
6: xycar
7: ignore
yolov5를 가동시킬 도커 컨테이너
docker pull ultralytics/yolov5:latest
런
docker run \
--ipc=host \
--name bert_tstl \
--gpus 2 \
-it \
-v ${PWD}/yolov5_tstl:/tstl \
-v ${PWD}/datasets/yolo_tstl:/tstl/datasets \
ultralytics/yolov5:latest
재진입
docker start bert_tstl \
&& docker exec -it bert_tstl /bin/bash
python benchmarks.py \
--weights yolov5s.pt \
--imgsz 640 \
--device 0
models/yolov5s.yaml
nc: 8
로 수정
python3 \
train.py \
--img 640 \
--batch 16 \
--epochs 100 \
--data /tstl/datasets/tstl.yaml \
--cfg models/yolov5s.yaml \
--weights yolov5s.pt \
--name tstl
python export.py \
--weights runs/train/tstl/weights/best.pt \
--include onnx
snap install netron
best.onnx
python detect.py --weights runs/train/tstl/weights/best.onnx
cp runs/detect /tstl/ -r