Spaces:
Sleeping
Sleeping
darkmortal
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -25,14 +25,16 @@ if file_name is not None:
|
|
25 |
col1.image(image, use_column_width=True)
|
26 |
|
27 |
label = st.text_input("What to look for in the image?")
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
col2.
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
|
|
|
|
|
25 |
col1.image(image, use_column_width=True)
|
26 |
|
27 |
label = st.text_input("What to look for in the image?")
|
28 |
+
if label == '':
|
29 |
+
st.warning('Please enter a object label', icon="⚠️")
|
30 |
+
else:
|
31 |
+
if st.button("Scan Image"):
|
32 |
+
predictions = scan_image(image, label)
|
33 |
+
|
34 |
+
col2.header("Probabilities")
|
35 |
+
for key in predictions[1].keys():
|
36 |
+
col2.subheader(f"{ key }: { round(predictions[1][key] * 100, 1)}%")
|
37 |
+
|
38 |
+
if predictions[0]:
|
39 |
+
st.header("The object is present in the given image")
|
40 |
+
else: st.header("The object is not found in the given image")
|