Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ import torch
|
|
6 |
|
7 |
model_id_list = ['deprem-ml/Binafarktespit-yolo5x-v1-xview', 'SerdarHelli/deprem_satellite_labeled_yolov8', 'kadirnar/yolov7-v0.1', 'kadirnar/UNet-EfficientNet-b6-Istanbul']
|
8 |
current_device = "cuda" if torch.cuda.is_available() else "cpu"
|
9 |
-
model_types = ["YOLOv5", "YOLOv5 + SAHI", "YOLOv8", "YOLOv7"
|
10 |
|
11 |
def sahi_yolov5_inference(
|
12 |
image,
|
@@ -97,11 +97,13 @@ def sahi_yolov5_inference(
|
|
97 |
results = model([image], size=image_size)
|
98 |
return results.render()[0]
|
99 |
|
|
|
100 |
elif model_type == "Unet-Istanbul":
|
101 |
from istanbul_unet import unet_prediction
|
102 |
|
103 |
output = unet_prediction(input_path=image, model_path=model_id)
|
104 |
return output
|
|
|
105 |
|
106 |
inputs = [
|
107 |
gr.Image(type="pil", label="Original Image"),
|
@@ -127,8 +129,8 @@ examples = [
|
|
127 |
["data/26.jpg", 'deprem-ml/Binafarktespit-yolo5x-v1-xview', "YOLOv5 + SAHI", 640, 512, 512, 0.1, 0.1, "NMS", "IOU", 0.25, False],
|
128 |
["data/27.jpg", 'deprem-ml/Binafarktespit-yolo5x-v1-xview', "YOLOv5 + SAHI", 640, 512, 512, 0.1, 0.1, "NMS", "IOU", 0.25, False],
|
129 |
["data/28.jpg", 'deprem-ml/Binafarktespit-yolo5x-v1-xview', "YOLOv5 + SAHI", 640, 512, 512, 0.1, 0.1, "NMS", "IOU", 0.25, False],
|
130 |
-
["data/31.jpg", 'deprem-ml/SerdarHelli-yolov8-v1-xview', "YOLOv8", 640, 512, 512, 0.1, 0.1, "NMS", "IOU", 0.25, False]
|
131 |
-
["data/Istanbul.jpg", 'kadirnar/UNet-EfficientNet-b6-Istanbul', "Unet-Istanbul", 512, 512, 512, 0.1, 0.1, "NMS", "IOU", 0.25, False],
|
132 |
]
|
133 |
|
134 |
|
|
|
6 |
|
7 |
model_id_list = ['deprem-ml/Binafarktespit-yolo5x-v1-xview', 'SerdarHelli/deprem_satellite_labeled_yolov8', 'kadirnar/yolov7-v0.1', 'kadirnar/UNet-EfficientNet-b6-Istanbul']
|
8 |
current_device = "cuda" if torch.cuda.is_available() else "cpu"
|
9 |
+
model_types = ["YOLOv5", "YOLOv5 + SAHI", "YOLOv8", "YOLOv7"]
|
10 |
|
11 |
def sahi_yolov5_inference(
|
12 |
image,
|
|
|
97 |
results = model([image], size=image_size)
|
98 |
return results.render()[0]
|
99 |
|
100 |
+
"""
|
101 |
elif model_type == "Unet-Istanbul":
|
102 |
from istanbul_unet import unet_prediction
|
103 |
|
104 |
output = unet_prediction(input_path=image, model_path=model_id)
|
105 |
return output
|
106 |
+
"""
|
107 |
|
108 |
inputs = [
|
109 |
gr.Image(type="pil", label="Original Image"),
|
|
|
129 |
["data/26.jpg", 'deprem-ml/Binafarktespit-yolo5x-v1-xview', "YOLOv5 + SAHI", 640, 512, 512, 0.1, 0.1, "NMS", "IOU", 0.25, False],
|
130 |
["data/27.jpg", 'deprem-ml/Binafarktespit-yolo5x-v1-xview', "YOLOv5 + SAHI", 640, 512, 512, 0.1, 0.1, "NMS", "IOU", 0.25, False],
|
131 |
["data/28.jpg", 'deprem-ml/Binafarktespit-yolo5x-v1-xview', "YOLOv5 + SAHI", 640, 512, 512, 0.1, 0.1, "NMS", "IOU", 0.25, False],
|
132 |
+
["data/31.jpg", 'deprem-ml/SerdarHelli-yolov8-v1-xview', "YOLOv8", 640, 512, 512, 0.1, 0.1, "NMS", "IOU", 0.25, False]
|
133 |
+
#["data/Istanbul.jpg", 'kadirnar/UNet-EfficientNet-b6-Istanbul', "Unet-Istanbul", 512, 512, 512, 0.1, 0.1, "NMS", "IOU", 0.25, False],
|
134 |
]
|
135 |
|
136 |
|