Spaces:
Sleeping
Sleeping
Commit
·
270559d
1
Parent(s):
228e0ae
add explicit instructions
Browse files
app.py
CHANGED
@@ -30,15 +30,15 @@ if model_name is not None:
|
|
30 |
num_parts = model.num_landmarks
|
31 |
amap_vis = VisualizeAttentionMaps(num_parts=num_parts + 1, bg_label=num_parts)
|
32 |
test_transforms = make_test_transforms(image_size)
|
|
|
33 |
# Instructions
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
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(
|
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)
|
|
|
30 |
num_parts = model.num_landmarks
|
31 |
amap_vis = VisualizeAttentionMaps(num_parts=num_parts + 1, bg_label=num_parts)
|
32 |
test_transforms = make_test_transforms(image_size)
|
33 |
+
|
34 |
# Instructions
|
35 |
+
st.write("If you choose to upload an image, the attention map will be displayed.")
|
36 |
+
st.write("The attention map will highlight the regions of the image that the model is focusing on.")
|
37 |
+
st.write("If you choose one of the CUB or NABirds models, please choose a bird image.")
|
38 |
+
st.write("If you choose one of the Flower models, please choose a flower image.")
|
39 |
+
st.write("If you choose one of the PartImageNet models, please choose an images of classes from PartImageNet like land animals/birds/cars/bottles/airplanes.")
|
|
|
40 |
|
41 |
+
image_name = st.file_uploader("Upload an 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)
|