Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -132,25 +132,25 @@ def return_scaled_image(img, num_col, width_early, model_name):
|
|
| 132 |
elif model_name=="SBB/eynollah-main-regions":
|
| 133 |
if num_col == 1:
|
| 134 |
img_w_new = 1000
|
| 135 |
-
img_h_new = int(
|
| 136 |
|
| 137 |
elif num_col == 2:
|
| 138 |
img_w_new = 1500
|
| 139 |
-
img_h_new = int(
|
| 140 |
|
| 141 |
elif num_col == 3:
|
| 142 |
img_w_new = 2000
|
| 143 |
-
img_h_new = int(
|
| 144 |
|
| 145 |
elif num_col == 4:
|
| 146 |
img_w_new = 2500
|
| 147 |
-
img_h_new = int(
|
| 148 |
elif num_col == 5:
|
| 149 |
img_w_new = 3000
|
| 150 |
-
img_h_new = int(
|
| 151 |
else:
|
| 152 |
img_w_new = 4000
|
| 153 |
-
img_h_new = int(
|
| 154 |
img_resized = resize_image(img,img_h_new, img_w_new )
|
| 155 |
|
| 156 |
img_new = otsu_copy_binary(img_resized)
|
|
|
|
| 132 |
elif model_name=="SBB/eynollah-main-regions":
|
| 133 |
if num_col == 1:
|
| 134 |
img_w_new = 1000
|
| 135 |
+
img_h_new = int(img.shape[0] / float(img.shape[1]) * img_w_new)
|
| 136 |
|
| 137 |
elif num_col == 2:
|
| 138 |
img_w_new = 1500
|
| 139 |
+
img_h_new = int(img.shape[0] / float(img.shape[1]) * img_w_new)
|
| 140 |
|
| 141 |
elif num_col == 3:
|
| 142 |
img_w_new = 2000
|
| 143 |
+
img_h_new = int(img.shape[0] / float(img.shape[1]) * img_w_new)
|
| 144 |
|
| 145 |
elif num_col == 4:
|
| 146 |
img_w_new = 2500
|
| 147 |
+
img_h_new = int(img.shape[0] / float(img.shape[1]) * img_w_new)
|
| 148 |
elif num_col == 5:
|
| 149 |
img_w_new = 3000
|
| 150 |
+
img_h_new = int(img.shape[0] / float(img.shape[1]) * img_w_new)
|
| 151 |
else:
|
| 152 |
img_w_new = 4000
|
| 153 |
+
img_h_new = int(img.shape[0] / float(img.shape[1]) * img_w_new)
|
| 154 |
img_resized = resize_image(img,img_h_new, img_w_new )
|
| 155 |
|
| 156 |
img_new = otsu_copy_binary(img_resized)
|