-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
183 lines (159 loc) · 6.21 KB
/
Makefile
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
.PHONY: data_download data_mismatch_label data_yolov8_pytorch_txt_format
data_model_input data finetune_xlarge finetune_nano finetune_small
finetune_medium finetune_large finetune_baseline finetune_all finetune_regions
evaluate_all_on_common_validation_set evaluate_all_on_their_own_validation_set
evaluate_all hyperparameters_search all
setup: requirements.txt
pip install -r requirements.txt
data_download:
python src/data/download.py --to ./data/01_raw
data_mismatch_label:
python src/data/mismatch_labels.py \
--from data/09_external/label_mismatch/data.csv \
--to data/04_feature/label_mismatch/data.csv
data_model_input:
python src/data/yolov8/build_model_input.py \
--to data/05_model_input/yolov8/ \
--raw-root-rs-labelled data/01_raw/rs_storage_open/benthic_datasets/mask_labels/rs_labelled \
--yolov8-pytorch-txt-format-root data/04_feature/yolov8/benthic_datasets/mask_labels/rs_labelled \
--csv-label-mismatch-file data/04_feature/label_mismatch/data.csv \
--loglevel info
data_yolov8_pytorch_txt_format:
python src/data/yolov8/pytorch_txt_format.py \
--from data/01_raw \
--to data/04_feature
data: data_download data_mismatch_label data_yolov8_pytorch_txt_format data_model_input
finetune_baseline:
python src/train/yolov8/cli.py \
--experiment-name current_baseline \
--epochs 5 \
--model yolov8m-seg.pt \
--data data/05_model_input/yolov8/v2/SEAFLOWER_BOLIVAR_and_SEAFLOWER_COURTOWN_and_SEAVIEW_ATL_and_SEAVIEW_IDN_PHL_and_SEAVIEW_PAC_AUS_and_TETES_PROVIDENCIA/data.yaml
finetune_regions:
python src/train/yolov8/cli.py \
--experiment-name current_best_xlarge \
--epochs 100 \
--model yolov8x-seg.pt \
--imgsz 1024 \
--close_mosaic 35 \
--degrees 45 \
--flipud 0.5 \
--translate 0.2 \
--data-list \
data/05_model_input/yolov8/v2/SEAFLOWER_BOLIVAR/data.yaml \
data/05_model_input/yolov8/v2/SEAFLOWER_COURTOWN/data.yaml \
data/05_model_input/yolov8/v2/SEAVIEW_ATL/data.yaml \
data/05_model_input/yolov8/v2/SEAVIEW_IDN_PHL/data.yaml \
data/05_model_input/yolov8/v2/SEAVIEW_PAC_AUS/data.yaml \
data/05_model_input/yolov8/v2/TETES_PROVIDENCIA/data.yaml \
--loglevel info
finetune_nano:
python src/train/yolov8/cli.py \
--experiment-name current_best_nano \
--epochs 100 \
--model yolov8n-seg.pt \
--imgsz 1024 \
--close_mosaic 35 \
--degrees 45 \
--flipud 0.5 \
--translate 0.2 \
--data data/05_model_input/yolov8/v2/SEAFLOWER_BOLIVAR_and_SEAFLOWER_COURTOWN_and_SEAVIEW_ATL_and_SEAVIEW_IDN_PHL_and_SEAVIEW_PAC_AUS_and_TETES_PROVIDENCIA/data.yaml \
--loglevel info
finetune_small:
python src/train/yolov8/cli.py \
--experiment-name current_best_small \
--epochs 100 \
--model yolov8s-seg.pt \
--imgsz 1024 \
--close_mosaic 35 \
--degrees 45 \
--flipud 0.5 \
--translate 0.2 \
--data data/05_model_input/yolov8/v2/SEAFLOWER_BOLIVAR_and_SEAFLOWER_COURTOWN_and_SEAVIEW_ATL_and_SEAVIEW_IDN_PHL_and_SEAVIEW_PAC_AUS_and_TETES_PROVIDENCIA/data.yaml \
--loglevel info
finetune_medium:
python src/train/yolov8/cli.py \
--experiment-name current_best_medium \
--epochs 100 \
--model yolov8m-seg.pt \
--imgsz 1024 \
--close_mosaic 35 \
--degrees 45 \
--flipud 0.5 \
--translate 0.2 \
--data data/05_model_input/yolov8/v2/SEAFLOWER_BOLIVAR_and_SEAFLOWER_COURTOWN_and_SEAVIEW_ATL_and_SEAVIEW_IDN_PHL_and_SEAVIEW_PAC_AUS_and_TETES_PROVIDENCIA/data.yaml \
--loglevel info
finetune_large:
python src/train/yolov8/cli.py \
--experiment-name current_best_large \
--epochs 120 \
--model yolov8l-seg.pt \
--imgsz 1024 \
--close_mosaic 35 \
--degrees 45 \
--flipud 0.5 \
--translate 0.2 \
--data data/05_model_input/yolov8/v2/SEAFLOWER_BOLIVAR_and_SEAFLOWER_COURTOWN_and_SEAVIEW_ATL_and_SEAVIEW_IDN_PHL_and_SEAVIEW_PAC_AUS_and_TETES_PROVIDENCIA/data.yaml \
--loglevel info
finetune_xlarge:
python src/train/yolov8/cli.py \
--experiment-name current_best_xlarge \
--epochs 140 \
--model yolov8x-seg.pt \
--imgsz 1024 \
--close_mosaic 35 \
--degrees 45 \
--flipud 0.5 \
--translate 0.2 \
--data data/05_model_input/yolov8/v2/SEAFLOWER_BOLIVAR_and_SEAFLOWER_COURTOWN_and_SEAVIEW_ATL_and_SEAVIEW_IDN_PHL_and_SEAVIEW_PAC_AUS_and_TETES_PROVIDENCIA/data.yaml \
--loglevel info
finetune_all: finetune_baseline finetune_regions finetune_xlarge finetune_large finetune_medium finetune_small finetune_nano
evaluate_all_on_their_own_validation_set:
python src/evaluate/yolov8/cli2.py \
--to data/08_reporting/yolov8/evaluation/ \
--model-root-path data/06_models/yolov8/segment/ \
--batch-size 16 \
--save-predictions-path data/07_model_output/yolov8/evaluation/ \
--data-split test \
--random-seed 0 \
--n-samples 10 \
--loglevel info
evaluate_all_on_common_set:
python src/evaluate/yolov8/cli2.py \
--to data/08_reporting/yolov8/evaluation/ \
--model-root-path data/06_models/yolov8/segment/ \
--batch-size 16 \
--data-root-path data/05_model_input/yolov8/v2/SEAFLOWER_BOLIVAR_and_SEAFLOWER_COURTOWN_and_SEAVIEW_ATL_and_SEAVIEW_IDN_PHL_and_SEAVIEW_PAC_AUS_and_TETES_PROVIDENCIA/ \
--save-predictions-path data/07_model_output/yolov8/evaluation/ \
--data-split test \
--random-seed 0 \
--n-samples 10 \
--loglevel info
evaluate_best_large_on_all_datasets:
python src/evaluate/yolov8/cli2.py \
--to data/08_reporting/yolov8/evaluation/ \
--model-root-path data/06_models/yolov8/segment/current_best_large \
--batch-size 16 \
--data-root-path data/05_model_input/yolov8/v2/ \
--save-predictions-path data/07_model_output/yolov8/evaluation/ \
--data-split test \
--random-seed 0 \
--n-samples 10 \
--loglevel info
evaluate_region_seaview_atl_on_all_datasets:
python src/evaluate/yolov8/cli2.py \
--to data/08_reporting/yolov8/evaluation/ \
--model-root-path data/06_models/yolov8/segment/current_best_xlarge_region_seaview_atl \
--batch-size 16 \
--data-root-path data/05_model_input/yolov8/v2/ \
--save-predictions-path data/07_model_output/yolov8/evaluation/ \
--data-split test \
--random-seed 0 \
--n-samples 10 \
--loglevel info
evaluate_all: evaluate_all_on_their_own_validation_set evaluate_all_on_common_set
hyperparameters_search:
python src/train/yolov8/hyperparameters_search.py
build_report:
cd reports/yolov8/ ; pandoc report.md -V geometry:margin=0.8in --toc -o report.pdf
all: setup data finetune_all evaluate_all