Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -24,14 +24,15 @@ if file_name is not None:
|
|
24 |
image = Image.open(file_name)
|
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 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
24 |
image = Image.open(file_name)
|
25 |
col1.image(image, use_column_width=True)
|
26 |
|
27 |
+
label = st.text_input("What to look for in the image?")
|
28 |
+
|
29 |
+
if st.button("Scan Image"):
|
30 |
+
predictions = scan_image(image, label)
|
31 |
+
|
32 |
+
col2.header("Probabilities")
|
33 |
+
for key in predictions[1].keys():
|
34 |
+
col2.subheader(f"{ key }: { round(predictions[1][key] * 100, 1)}%")
|
35 |
+
|
36 |
+
if predictions[0]:
|
37 |
+
st.header("The object is present in the given image")
|
38 |
+
else: st.header("The object is not found in the given image")
|