Spaces:
Sleeping
Sleeping
ddovidovich
commited on
Commit
·
e0950a4
1
Parent(s):
c89721d
Update app.py
Browse files
app.py
CHANGED
|
@@ -164,13 +164,13 @@ if image_file is not None:
|
|
| 164 |
plt.imsave("predict.png",predicted_rgb)
|
| 165 |
|
| 166 |
predict1 = cv2.resize(predicted, (img.shape[1], img.shape[0]), interpolation=cv2.INTER_LANCZOS4)
|
| 167 |
-
|
|
|
|
| 168 |
mask = np.uint8(predict1 * 255)
|
| 169 |
_, mask = cv2.threshold(mask, thresh=255/2, maxval=255, type=cv2.THRESH_BINARY)
|
| 170 |
cnts, hierarchy = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
|
| 171 |
img = cv2.drawContours(img, cnts, -1, (0, 0, 255), 2)
|
| 172 |
|
| 173 |
-
decay_masks = detect_decays_static_th(img, mask)
|
| 174 |
mask = np.uint8(decay_mask * 255)
|
| 175 |
_, mask = cv2.threshold(mask, thresh=255/2, maxval=255, type=cv2.THRESH_BINARY)
|
| 176 |
cnts, hierarchy = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
|
|
|
|
| 164 |
plt.imsave("predict.png",predicted_rgb)
|
| 165 |
|
| 166 |
predict1 = cv2.resize(predicted, (img.shape[1], img.shape[0]), interpolation=cv2.INTER_LANCZOS4)
|
| 167 |
+
decay_masks = detect_decays_static_th(img, predict1)
|
| 168 |
+
|
| 169 |
mask = np.uint8(predict1 * 255)
|
| 170 |
_, mask = cv2.threshold(mask, thresh=255/2, maxval=255, type=cv2.THRESH_BINARY)
|
| 171 |
cnts, hierarchy = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
|
| 172 |
img = cv2.drawContours(img, cnts, -1, (0, 0, 255), 2)
|
| 173 |
|
|
|
|
| 174 |
mask = np.uint8(decay_mask * 255)
|
| 175 |
_, mask = cv2.threshold(mask, thresh=255/2, maxval=255, type=cv2.THRESH_BINARY)
|
| 176 |
cnts, hierarchy = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
|