Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,15 +41,9 @@ def visualize_model_output(prediction, img):
|
|
| 41 |
output = output.astype(np.int8)
|
| 42 |
img = img.astype(np.int8)
|
| 43 |
|
| 44 |
-
|
| 45 |
-
shapes = np.zeros_like(img, np.uint8)
|
| 46 |
-
shapes = output
|
| 47 |
-
mask = shapes.astype(bool)
|
| 48 |
-
alpha = 0.5
|
| 49 |
-
bg_img[mask] = cv2.addWeighted(bg_img, 1 - alpha, shapes, alpha, 0)[mask]
|
| 50 |
-
|
| 51 |
|
| 52 |
-
return
|
| 53 |
|
| 54 |
|
| 55 |
def do_prediction(model_name, img):
|
|
|
|
| 41 |
output = output.astype(np.int8)
|
| 42 |
img = img.astype(np.int8)
|
| 43 |
|
| 44 |
+
added_image = cv2.addWeighted(img,0.4,output,0.1,0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
+
return added_image
|
| 47 |
|
| 48 |
|
| 49 |
def do_prediction(model_name, img):
|