swimmiing commited on
Commit
5592209
1 Parent(s): 38c6aa1

Fix resolution v2

Browse files
Files changed (1) hide show
  1. app.py +3 -1
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(image.resize(352, 352)), 0.5, heatmap_image, 0.5, 0)
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