Spaces:
Sleeping
Sleeping
add file uploader
Browse filessupport providing image url or upload
app.py
CHANGED
@@ -11,6 +11,7 @@ image_url = st.text_input(
|
|
11 |
value="https://dl.fbaipublicfiles.com/dino/img.png",
|
12 |
placeholder="https://your-favourite-image.png"
|
13 |
)
|
|
|
14 |
|
15 |
# Outputs
|
16 |
st.title("Original Image from URL")
|
@@ -20,6 +21,10 @@ image, preprocessed_image = utils.load_image_from_url(
|
|
20 |
image_url,
|
21 |
model_type="dino"
|
22 |
)
|
|
|
|
|
|
|
|
|
23 |
st.image(image, caption="Original Image")
|
24 |
|
25 |
# Load the DINO model
|
|
|
11 |
value="https://dl.fbaipublicfiles.com/dino/img.png",
|
12 |
placeholder="https://your-favourite-image.png"
|
13 |
)
|
14 |
+
uploaded_files = st.file_uploader("or an image file", type =["jpg","jpeg"])
|
15 |
|
16 |
# Outputs
|
17 |
st.title("Original Image from URL")
|
|
|
21 |
image_url,
|
22 |
model_type="dino"
|
23 |
)
|
24 |
+
if uploaded_file:
|
25 |
+
image = Image.open(im)
|
26 |
+
preprocessed_image = utils.preprocess_image(image, model_type)
|
27 |
+
|
28 |
st.image(image, caption="Original Image")
|
29 |
|
30 |
# Load the DINO model
|