Spaces:
Running
Running
Fix resolution v2
Browse files
app.py
CHANGED
@@ -66,8 +66,10 @@ def greet(image, audio):
|
|
66 |
seg = out_dict['heatmap'][0:1]
|
67 |
seg_image = ((1 - seg.squeeze().detach().cpu().numpy()) * 255).astype(np.uint8)
|
68 |
seg_image = Image.fromarray(seg_image)
|
|
|
|
|
69 |
heatmap_image = cv2.applyColorMap(np.array(seg_image), cv2.COLORMAP_JET)
|
70 |
-
overlaid_image = cv2.addWeighted(np.array(
|
71 |
|
72 |
return overlaid_image
|
73 |
|
|
|
66 |
seg = out_dict['heatmap'][0:1]
|
67 |
seg_image = ((1 - seg.squeeze().detach().cpu().numpy()) * 255).astype(np.uint8)
|
68 |
seg_image = Image.fromarray(seg_image)
|
69 |
+
|
70 |
+
original_image = image.resize((352, 352), Image.BICUBIC)
|
71 |
heatmap_image = cv2.applyColorMap(np.array(seg_image), cv2.COLORMAP_JET)
|
72 |
+
overlaid_image = cv2.addWeighted(np.array(original_image), 0.5, heatmap_image, 0.5, 0)
|
73 |
|
74 |
return overlaid_image
|
75 |
|