Skip to content

Commit

Permalink
dvc.yaml update
Browse files Browse the repository at this point in the history
  • Loading branch information
RihabFekii committed Apr 5, 2023
1 parent 9c51511 commit 48805e1
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 16 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,6 @@ dmypy.json

#yolo training files
/runs
yolo*
yolo*

.DS_Store
20 changes: 10 additions & 10 deletions dvc.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ stages:
md5: ffe9083905cf64817ca61146b3356bb6.dir
size: 28867246
nfiles: 1482
- path: src/params.yaml
md5: a0c123b909925d3386149e8b024832a0
- path: params.yaml
md5: 54726043d2a91378df53a641d25d5dac
size: 215
- path: src/train.py
md5: d2675f1ccbf8af2b7c25485e47c4c783
size: 990
- path: src/utils.py
md5: e1585268f1a61213ac6e51f7abf0d47f
size: 1090
md5: 8cde4fe436744929ddbaeaadb37aad71
size: 986
outs:
- path: models/model.pt
md5: 8198bbc4220f971f09595a135320f968
size: 6226104
md5: 63fce0b37345cecfc51b75a871d46560
size: 22495096
- path: reports/train_metrics.csv
md5: fb687ccb189b9b1fe433eac7c2b4304f
md5: d3ee99e7a651b8b69535c7dcff8ea64d
size: 672
- path: reports/train_params.yaml
md5: a13c7b98780812835f127700894323c7
size: 1501
5 changes: 3 additions & 2 deletions dvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ stages:
deps:
- data/raw/wildfire-raw-yolov8
- src/train.py
- src/params.yaml
params:
- params.yaml
outs:
- models/
- models/model.pt
- reports/train_params.yaml:
cache: false
metrics:
Expand Down
1 change: 1 addition & 0 deletions models/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/model.pt
File renamed without changes.
Binary file added reports/train_confusion_matrix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions reports/train_metrics.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
epoch, train/box_loss, train/cls_loss, train/dfl_loss, metrics/precision(B), metrics/recall(B), metrics/mAP50(B), metrics/mAP50-95(B), val/box_loss, val/cls_loss, val/dfl_loss, lr/pg0, lr/pg1, lr/pg2
0, 2.074, 3.6688, 1.7378, 0.29774, 0.32591, 0.23183, 0.08104, 2.2504, 2.6345, 1.8202, 0.070462, 0.0032821, 0.0032821
95 changes: 95 additions & 0 deletions reports/train_params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
task: detect
mode: train
model: yolov8s.pt
data: /Users/rihabfeki/Desktop/wildfire-smoke-detector/data/raw/wildfire-raw-yolov8/data.yaml
epochs: 1
patience: 50
batch: 8
imgsz: 640
save: true
save_period: -1
cache: false
device: null
workers: 8
project: null
name: yolov8s_exp_v0
exist_ok: false
pretrained: true
optimizer: SGD
verbose: true
seed: 0
deterministic: true
single_cls: false
image_weights: false
rect: false
cos_lr: false
close_mosaic: 10
resume: false
amp: true
overlap_mask: true
mask_ratio: 4
dropout: 0.0
val: true
split: val
save_json: false
save_hybrid: false
conf: null
iou: 0.7
max_det: 300
half: false
dnn: false
plots: true
source: null
show: false
save_txt: false
save_conf: false
save_crop: false
hide_labels: false
hide_conf: false
vid_stride: 1
line_thickness: 3
visualize: false
augment: false
agnostic_nms: false
classes: null
retina_masks: false
boxes: true
format: torchscript
keras: false
optimize: false
int8: false
dynamic: false
simplify: false
opset: null
workspace: 4
nms: false
lr0: 0.01
lrf: 0.01
momentum: 0.937
weight_decay: 0.0005
warmup_epochs: 3.0
warmup_momentum: 0.8
warmup_bias_lr: 0.1
box: 7.5
cls: 0.5
dfl: 1.5
fl_gamma: 0.0
label_smoothing: 0.0
nbs: 64
hsv_h: 0.015
hsv_s: 0.7
hsv_v: 0.4
degrees: 0.0
translate: 0.1
scale: 0.5
shear: 0.0
perspective: 0.0
flipud: 0.0
fliplr: 0.5
mosaic: 1.0
mixup: 0.0
copy_paste: 0.0
cfg: null
v5loader: false
tracker: botsort.yaml
save_dir: /Users/rihabfeki/Desktop/wildfire-smoke-detector/runs/detect/yolov8s_exp_v0
2 changes: 1 addition & 1 deletion src/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

if __name__ == '__main__':

with open(r"src/params.yaml") as f:
with open(r"params.yaml") as f:
params = yaml.safe_load(f)

# load a pre-trained model
Expand Down
5 changes: 3 additions & 2 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ def save_metrics(experiment_name: str) -> None:
shutil.copy(src=f'{path_metrics}/results.csv', dst=f'{ROOT_DIR}/reports/train_metrics.csv')

# save the confusion matrix associated to the training experiment
shutil.copy(src=f'{path_metrics}/confusion_matrix.png', dst=f'{ROOT_DIR}/reports/train_confision_matric.png')
shutil.copy(src=f'{path_metrics}/confusion_matrix.png', dst=f'{ROOT_DIR}/reports/train_confusion_matrix.png')

# save training params
shutil.copy(src=f'{path_metrics}/args.yaml', dst=f'{ROOT_DIR}/reports/train_params.yaml')



save_model('yolov8s_exp_v0')

0 comments on commit 48805e1

Please sign in to comment.