Spaces:
Running
Running
Used Caps for textbox labels
Browse files- image2text.py +5 -8
image2text.py
CHANGED
@@ -16,19 +16,16 @@ def app():
|
|
16 |
st.markdown(
|
17 |
"""
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
Here you can find the captions or the labels that are most related to a given image.
|
22 |
-
π€ Italian mode on! π€
|
23 |
|
24 |
-
|
25 |
"classify"!
|
26 |
|
27 |
"""
|
28 |
)
|
29 |
|
30 |
image_url = st.text_input(
|
31 |
-
"
|
32 |
value="https://www.petdetective.it/wp-content/uploads/2016/04/gatto-toilette.jpg",
|
33 |
)
|
34 |
|
@@ -38,14 +35,14 @@ def app():
|
|
38 |
|
39 |
with col2:
|
40 |
captions_count = st.selectbox(
|
41 |
-
"
|
42 |
)
|
43 |
compute = st.button("Classify")
|
44 |
|
45 |
with col1:
|
46 |
captions = list()
|
47 |
for idx in range(min(MAX_CAP, captions_count)):
|
48 |
-
captions.append(st.text_input(f"
|
49 |
|
50 |
if compute:
|
51 |
captions = [c for c in captions if c != ""]
|
|
|
16 |
st.markdown(
|
17 |
"""
|
18 |
|
19 |
+
π Ciao! Here you can find the captions or the labels that are most related to a given image.
|
|
|
|
|
|
|
20 |
|
21 |
+
Try typing "gatto" (cat) in the space for label1 and "cane" (dog) in the space for label2 and click
|
22 |
"classify"!
|
23 |
|
24 |
"""
|
25 |
)
|
26 |
|
27 |
image_url = st.text_input(
|
28 |
+
"YOU CAN INPUT THE URL OF AN IMAGE : ",
|
29 |
value="https://www.petdetective.it/wp-content/uploads/2016/04/gatto-toilette.jpg",
|
30 |
)
|
31 |
|
|
|
35 |
|
36 |
with col2:
|
37 |
captions_count = st.selectbox(
|
38 |
+
"NUMBER OF LABELS", options=range(1, MAX_CAP + 1), index=1
|
39 |
)
|
40 |
compute = st.button("Classify")
|
41 |
|
42 |
with col1:
|
43 |
captions = list()
|
44 |
for idx in range(min(MAX_CAP, captions_count)):
|
45 |
+
captions.append(st.text_input(f"INSERT LABEL {idx+1}"))
|
46 |
|
47 |
if compute:
|
48 |
captions = [c for c in captions if c != ""]
|