ananthu-aniraj commited on
Commit
228e0ae
·
1 Parent(s): 083cd0d

try different text based on model choice

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -32,13 +32,13 @@ if model_name is not None:
32
  test_transforms = make_test_transforms(image_size)
33
  # Instructions
34
  if "cub" or "nabirds" in model_name:
35
- st.write("Upload an image of a bird to visualize the attention maps")
36
  elif "flowers" in model_name:
37
- st.write("Upload an image of a flower to visualize the attention maps")
38
  else:
39
- st.write("Upload an image of any PartImageNet class (land animals + fish + cars + airplanes) to visualize the attention maps")
40
 
41
- image_name = st.file_uploader("Upload Image", type=["jpg", "jpeg", "png"]) # Upload an image
42
  if image_name is not None:
43
  image = Image.open(image_name).convert("RGB")
44
  image_tensor = test_transforms(image).unsqueeze(0).to(device)
 
32
  test_transforms = make_test_transforms(image_size)
33
  # Instructions
34
  if "cub" or "nabirds" in model_name:
35
+ upload_text = "Upload an image of a bird to visualize the attention maps"
36
  elif "flowers" in model_name:
37
+ upload_text = "Upload an image of a flower to visualize the attention maps"
38
  else:
39
+ upload_text = "Upload an image of any PartImageNet class (land animals + fish + cars + airplanes) to visualize the attention maps"
40
 
41
+ image_name = st.file_uploader(upload_text, type=["jpg", "jpeg", "png"]) # Upload an image
42
  if image_name is not None:
43
  image = Image.open(image_name).convert("RGB")
44
  image_tensor = test_transforms(image).unsqueeze(0).to(device)