-
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.
Merge pull request #1 from RihabFekii/mlflow
MLflow logging and adding test stage
- Loading branch information
Showing
12 changed files
with
132 additions
and
89 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 |
---|---|---|
@@ -1,6 +1,18 @@ | ||
#!make | ||
include .env | ||
|
||
PYTHON_INTERPRETER = python3 | ||
|
||
env: | ||
@echo ">>> Creating a python virtual environment with venv" | ||
$(PYTHON_INTERPRETER) -m venv env | ||
@echo ">>> A new virtual env is created. Activate it with:\nsource env/bin/activate ." | ||
@echo ">>> A new virtual env is created. Activate it with:\nsource env/bin/activate ." | ||
|
||
|
||
mlflow: | ||
@echo ">>> Authenticating to MLflow remote server on DagsHub" | ||
export MLFLOW_TRACKING_URI=$(MLFLOW_TRACKING_URI) | ||
export MLFLOW_TRACKING_USERNAME=$(MLFLOW_TRACKING_USERNAME) | ||
export MLFLOW_TRACKING_PASSWORD=$(MLFLOW_TRACKING_PASSWORD) | ||
@echo ">>> Authenticating successful!" | ||
|
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
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
model_type: yolov8s.pt | ||
model_type: yolov8n.pt | ||
pretrained: True | ||
seed: 0 | ||
imgsz: 640 | ||
batch: 8 | ||
epochs: 20 | ||
epochs: 1 | ||
optimizer: SGD # other choices=['SGD', 'Adam', 'AdamW', 'RMSProp'] | ||
lr0: 0.01 # learning rate | ||
name: 'yolov8s_exp_v0' # experiment name | ||
name: 'yolov8n_exp_v0' # experiment name |
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 |
---|---|---|
@@ -1,21 +1,3 @@ | ||
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 | ||
1, 1.767, 1.7208, 1.4953, 0.64651, 0.53061, 0.62556, 0.29666, 1.8773, 1.8427, 1.3876, 0.040134, 0.0062879, 0.0062879 | ||
2, 1.7171, 1.707, 1.3988, 0.06729, 0.09524, 0.04705, 0.02481, 3.0641, 4.3916, 2.5411, 0.0094766, 0.0089638, 0.0089638 | ||
3, 1.7341, 1.8335, 1.4552, 0.38806, 0.47619, 0.41508, 0.17576, 1.9845, 2.1096, 1.6549, 0.008515, 0.008515, 0.008515 | ||
4, 1.691, 1.3376, 1.4286, 0.49323, 0.42177, 0.41415, 0.16903, 2.213, 2.0351, 1.7182, 0.008515, 0.008515, 0.008515 | ||
5, 1.6586, 1.3538, 1.3919, 0.62787, 0.38095, 0.39228, 0.18293, 2.0223, 2.3359, 1.6252, 0.00802, 0.00802, 0.00802 | ||
6, 1.6037, 1.2676, 1.3543, 0.66557, 0.47619, 0.5516, 0.25586, 1.8962, 1.6098, 1.4971, 0.007525, 0.007525, 0.007525 | ||
7, 1.658, 1.2554, 1.3514, 0.58698, 0.68027, 0.6487, 0.29438, 1.7871, 1.3586, 1.4083, 0.00703, 0.00703, 0.00703 | ||
8, 1.609, 1.1162, 1.3305, 0.6504, 0.5102, 0.53742, 0.25941, 1.9, 1.6061, 1.4134, 0.006535, 0.006535, 0.006535 | ||
9, 1.5784, 1.1193, 1.3391, 0.58894, 0.70068, 0.60387, 0.26491, 1.8898, 1.466, 1.4003, 0.00604, 0.00604, 0.00604 | ||
10, 1.6081, 1.0872, 1.332, 0.54884, 0.53741, 0.56067, 0.26937, 1.89, 1.6558, 1.4405, 0.005545, 0.005545, 0.005545 | ||
11, 1.6216, 1.0673, 1.3576, 0.6775, 0.7415, 0.76254, 0.40175, 1.6952, 1.1328, 1.3126, 0.00505, 0.00505, 0.00505 | ||
12, 1.5426, 1.0814, 1.3183, 0.63694, 0.73995, 0.67857, 0.33739, 1.8035, 1.2909, 1.3621, 0.004555, 0.004555, 0.004555 | ||
13, 1.527, 0.9778, 1.2827, 0.76852, 0.76871, 0.80068, 0.40906, 1.6945, 1.0812, 1.3067, 0.00406, 0.00406, 0.00406 | ||
14, 1.4765, 0.93611, 1.2862, 0.74653, 0.84152, 0.85997, 0.47623, 1.6398, 1.0427, 1.3348, 0.003565, 0.003565, 0.003565 | ||
15, 1.4623, 0.90297, 1.2588, 0.83993, 0.80952, 0.88026, 0.47516, 1.6723, 0.98866, 1.2993, 0.00307, 0.00307, 0.00307 | ||
16, 1.4283, 0.86243, 1.2558, 0.81461, 0.82313, 0.90594, 0.46365, 1.6496, 0.93395, 1.3134, 0.002575, 0.002575, 0.002575 | ||
17, 1.4264, 0.83566, 1.2381, 0.85204, 0.82993, 0.90175, 0.49576, 1.5633, 0.94734, 1.2569, 0.00208, 0.00208, 0.00208 | ||
18, 1.3657, 0.84115, 1.214, 0.87301, 0.87755, 0.922, 0.4962, 1.5714, 0.88971, 1.2903, 0.001585, 0.001585, 0.001585 | ||
19, 1.3289, 0.8171, 1.1956, 0.85437, 0.86395, 0.92797, 0.51129, 1.5971, 0.85184, 1.2837, 0.00109, 0.00109, 0.00109 | ||
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 | ||
1, 1.7723, 2.9226, 1.3586, 0.25019, 0.33333, 0.19749, 0.07728, 2.2085, 3.4761, 1.5367, 0.037187, 0.0033408, 0.0033408 |
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
dvc==2.51.0 | ||
ultralytics==8.0.58 | ||
python-dotenv==1.0.0 | ||
mlflow==2.2.2 | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
import os | ||
import glob | ||
from pathlib import Path | ||
|
||
from ultralytics import YOLO | ||
|
||
|
||
root_dir = Path(__file__).resolve().parents[1] # root directory | ||
path_model_weights = os.path.join(root_dir, 'models/model.pt') | ||
data_dir = os.path.join(root_dir, "data/raw/wildfire-raw-yolov8") | ||
test_data_path = os.path.join(data_dir, 'test/images') | ||
|
||
|
||
if __name__ == '__main__': | ||
|
||
#load trained model | ||
model = YOLO(path_model_weights) | ||
|
||
for images in glob.glob(f"{test_data_path}/*.jpg"): | ||
predictions = model.predict(images, save=True) | ||
print(predictions) | ||
print(type(predictions)) | ||
|
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