-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be28477
commit a6d686c
Showing
8 changed files
with
73 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
schema: '2.0' | ||
stages: | ||
train: | ||
cmd: python src/train.py | ||
deps: | ||
- path: data/raw/wildfire-raw-yolov8 | ||
md5: ffe9083905cf64817ca61146b3356bb6.dir | ||
size: 28867246 | ||
nfiles: 1482 | ||
- path: src/params.yaml | ||
md5: a0c123b909925d3386149e8b024832a0 | ||
size: 215 | ||
- path: src/train.py | ||
md5: d2675f1ccbf8af2b7c25485e47c4c783 | ||
size: 990 | ||
- path: src/utils.py | ||
md5: e1585268f1a61213ac6e51f7abf0d47f | ||
size: 1090 | ||
outs: | ||
- path: models/model.pt | ||
md5: 8198bbc4220f971f09595a135320f968 | ||
size: 6226104 | ||
- path: reports/train_metrics.csv | ||
md5: fb687ccb189b9b1fe433eac7c2b4304f | ||
size: 672 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/model.pt |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, 1.9822, 4.1505, 1.6088, 0.00279, 0.83673, 0.04395, 0.0187, 2.0868, 4.2883, 1.5972, 0.070462, 0.0032821, 0.0032821 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import os | ||
import shutil | ||
from pathlib import Path | ||
|
||
ROOT_DIR = Path(__file__).resolve().parents[1] # root directory absolute path | ||
|
||
|
||
def save_model(experiment_name: str) -> None: | ||
""" saves the weights of trained model to the models directory """ | ||
if os.path.isdir('runs'): | ||
model_weights = experiment_name + "/weights/best.pt" | ||
path_model_weights = os.path.join(ROOT_DIR, "runs/detect", model_weights) | ||
|
||
shutil.copy(src=path_model_weights, dst=f'{ROOT_DIR}/models/model.pt') | ||
|
||
|
||
def save_metrics(experiment_name: str) -> None: | ||
""" saves training metrics and confusion matrix to the reports directory """ | ||
if os.path.isdir('runs'): | ||
path_metrics = os.path.join(ROOT_DIR, "runs/detect", experiment_name) | ||
# save experiment training metrics | ||
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') | ||
|
||
|