swimmiing commited on
Commit
38c6aa1
·
1 Parent(s): 35843d7

Fix resolution

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -67,7 +67,7 @@ def greet(image, audio):
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), 0.5, heatmap_image, 0.5, 0)
71
 
72
  return overlaid_image
73
 
@@ -75,8 +75,9 @@ def greet(image, audio):
75
  title = "Audio-Grounded Contrastive Learning"
76
 
77
  description = """<p>
78
- This is a simple demo of Can CLIP Help Sound Source Localization? (WACV2024), zero-shot visual sound localization.<br><br>
79
- To use it simply upload an image and corresponding audio to mask (identify in the image), or use one of the examples below and click ‘submit’.
 
80
  </p>"""
81
 
82
  article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2311.04066'>Can CLIP Help Sound Source Localization?</a> | <a href='https://github.com/swimmiing/ACL-SSL'>Offical Github repo</a></p>"
 
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
 
 
75
  title = "Audio-Grounded Contrastive Learning"
76
 
77
  description = """<p>
78
+ This is a simple demo of our WACV'24 paper 'Can CLIP Help Sound Source Localization?', zero-shot visual sound localization.<br><br>
79
+ To use it simply upload an image and corresponding audio to mask (identify in the image), or use one of the examples below and click ‘submit’.<br><br>
80
+ Results will show up in a few seconds.
81
  </p>"""
82
 
83
  article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2311.04066'>Can CLIP Help Sound Source Localization?</a> | <a href='https://github.com/swimmiing/ACL-SSL'>Offical Github repo</a></p>"