-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·45 lines (36 loc) · 1.13 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
path="$(pwd)/dataset"
echo "path: $path"
rm -rf venv dataset yolov5
DRIVE_ID="1J79VQQolr-KMhWg5cYk0pjp3K9uIowkV"
python3 -m venv ./venv
source ./venv/bin/activate
pip3 install gdown
mkdir dataset
cd dataset
gdown "https://drive.google.com/uc?id=$DRIVE_ID"
unzip -Bj *.zip -d training_images/
git clone https://github.com/CraigWang1/custom-dataset-tools.git
pip3 install -r custom-dataset-tools/requirements.txt
python ./custom-dataset-tools/dataset/YOLO_format.py \
--image_dir $path/training_images \
--annot_dir $path/training_images \
--save_dir $path/training_dset \
--ext png \
--train_test_split 0.7
cd ..
git clone https://github.com/ultralytics/yolov5
pip3 install -r yolov5/requirements.txt
#python3 -c 'import torch; print("Setup complete. Using torch %s %s" % (torch.__version__, torch.cuda.get_device_properties(0) if torch.cuda.is_available() else "CPU"))'
pwd
python3 write_yaml.py
cd yolov5
python3 train.py \
--img 640 \
--batch 16 \
--epochs 200 \
--data '../dataset/data.yaml' \
--cfg ./models/yolov5s.yaml \
--weights yolov5s.pt \
--name botz_yolov5s_results \
--cache