Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,15 @@
|
|
1 |
-
# RUN BELOW FIRST THEN RUN BELOW
|
2 |
|
3 |
-
|
|
|
4 |
|
5 |
from ultralytics import YOLO
|
6 |
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
9 |
|
10 |
#model = YOLO(model_path)
|
11 |
#metrics = model.val(data=data_yaml_path) # ensure data.yaml points to the correct valid set
|
@@ -35,13 +39,12 @@ data_yaml_path = "/content/bccd_rbc_wbc_platelets-1/data.yaml" # dataset config
|
|
35 |
# print(f"{cname}: Precision={p}, Recall={r}, mAP50={ap50}, mAP50-95={ap}")
|
36 |
|
37 |
|
|
|
38 |
|
39 |
############ Take the values from abover and put them below manually
|
40 |
|
41 |
-
|
42 |
############## Use below for production with manual metrics input
|
43 |
|
44 |
-
|
45 |
import os
|
46 |
import torch
|
47 |
import cv2
|
|
|
|
|
1 |
|
2 |
+
|
3 |
+
|
4 |
|
5 |
from ultralytics import YOLO
|
6 |
|
7 |
+
# RUN BELOW FIRST THEN RUN BELOW
|
8 |
+
|
9 |
+
# First run the code to get the validation metrics of best.pt
|
10 |
+
|
11 |
+
#model_path = "best.pt" # your trained model and use exact file location
|
12 |
+
#data_yaml_path = "data.yaml" # dataset configuration file and use exact data.yaml file location
|
13 |
|
14 |
#model = YOLO(model_path)
|
15 |
#metrics = model.val(data=data_yaml_path) # ensure data.yaml points to the correct valid set
|
|
|
39 |
# print(f"{cname}: Precision={p}, Recall={r}, mAP50={ap50}, mAP50-95={ap}")
|
40 |
|
41 |
|
42 |
+
## End of Validation
|
43 |
|
44 |
############ Take the values from abover and put them below manually
|
45 |
|
|
|
46 |
############## Use below for production with manual metrics input
|
47 |
|
|
|
48 |
import os
|
49 |
import torch
|
50 |
import cv2
|