Bill Psomas commited on
Commit
4f80be6
·
1 Parent(s): 7578ae0

higher resolution choice

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -46,7 +46,7 @@ msg = model.load_state_dict(state_dict, strict=True)
46
  model.eval()
47
 
48
  def get_attention_map(img, resolution):
49
- input_size = resolution * 14
50
  data_transforms = transforms.Compose([
51
  transforms.Resize((input_size, input_size), interpolation=3),
52
  transforms.ToTensor(),
@@ -66,9 +66,13 @@ def get_attention_map(img, resolution):
66
 
67
  attention_interface = gr.Interface(
68
  fn=get_attention_map,
69
- inputs=[gr.Image(type="pil", label="Input Image"),
70
- gr.Dropdown(choices=["16", "32", "64", "128"],
71
- label="Attention Map Resolution", value="32", type="index")],
 
 
 
 
72
  outputs=gr.Image(type="pil", label="SimPool Attention Map", width=width_display, height=height_display),
73
  examples=example_list,
74
  title="Explore the Attention Maps of SimPool🔍",
 
46
  model.eval()
47
 
48
  def get_attention_map(img, resolution):
49
+ input_size = int(resolution) * 14
50
  data_transforms = transforms.Compose([
51
  transforms.Resize((input_size, input_size), interpolation=3),
52
  transforms.ToTensor(),
 
66
 
67
  attention_interface = gr.Interface(
68
  fn=get_attention_map,
69
+ inputs=[
70
+ gr.Image(type="pil", label="Input Image"),
71
+ gr.Dropdown(choices=["16", "32", "64", "128"],
72
+ label="Attention Map Resolution",
73
+ value="32",
74
+ type="index")
75
+ ],
76
  outputs=gr.Image(type="pil", label="SimPool Attention Map", width=width_display, height=height_display),
77
  examples=example_list,
78
  title="Explore the Attention Maps of SimPool🔍",