Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -39,15 +39,10 @@ def visualize_model_output(prediction, img):
|
|
39 |
output[:,:,2][prediction[:,:,0]==unq_class] = rgb_class_unique[2]
|
40 |
|
41 |
output = output.astype(np.uint8)
|
42 |
-
output_color_coverted = cv2.cvtColor(output, cv2.COLOR_BGR2RGB)
|
43 |
-
im_pil_output = Image.fromarray(output_color_coverted)
|
44 |
|
45 |
-
|
46 |
-
im_pil = Image.fromarray(color_coverted)
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
return im_pil.astype(np.uint8)
|
51 |
|
52 |
|
53 |
def do_prediction(model_name, img):
|
|
|
39 |
output[:,:,2][prediction[:,:,0]==unq_class] = rgb_class_unique[2]
|
40 |
|
41 |
output = output.astype(np.uint8)
|
|
|
|
|
42 |
|
43 |
+
overlayed_image = cv2.addWeighted(img,0.4,output,0.1,0)
|
|
|
44 |
|
45 |
+
return overlayed_image.astype(np.uint8)
|
|
|
|
|
46 |
|
47 |
|
48 |
def do_prediction(model_name, img):
|