Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -49,8 +49,11 @@ st.divider()
|
|
| 49 |
|
| 50 |
crop = st.toggle("Activate random crop")
|
| 51 |
compress = st.toggle("Activate jpeg compression")
|
|
|
|
| 52 |
|
|
|
|
| 53 |
st.divider()
|
|
|
|
| 54 |
file_name = st.file_uploader("Choose an image...")
|
| 55 |
|
| 56 |
if file_name is not None:
|
|
@@ -70,5 +73,11 @@ if file_name is not None:
|
|
| 70 |
predictions = get_prediction(image)
|
| 71 |
|
| 72 |
col2.header("Probabilities")
|
| 73 |
-
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
crop = st.toggle("Activate random crop")
|
| 51 |
compress = st.toggle("Activate jpeg compression")
|
| 52 |
+
st.divider()
|
| 53 |
|
| 54 |
+
binary = st.toggle("Activate binary classification")
|
| 55 |
st.divider()
|
| 56 |
+
|
| 57 |
file_name = st.file_uploader("Choose an image...")
|
| 58 |
|
| 59 |
if file_name is not None:
|
|
|
|
| 73 |
predictions = get_prediction(image)
|
| 74 |
|
| 75 |
col2.header("Probabilities")
|
| 76 |
+
if binary:
|
| 77 |
+
if predictions[7] > 0.5:
|
| 78 |
+
col2.markdown(":green[real image!]")
|
| 79 |
+
else:
|
| 80 |
+
col2.markdown(":red[fake image!]")
|
| 81 |
+
else:
|
| 82 |
+
for idx,p in enumerate(predictions):
|
| 83 |
+
col2.text(f"{ models[idx] }: { round(p * 100, 2)}%")
|