Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,14 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
from transformers import pipeline
|
| 3 |
from PIL import Image
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
st.title("Fake Detection")
|
| 8 |
|
|
@@ -13,7 +19,7 @@ if file_name is not None:
|
|
| 13 |
|
| 14 |
image = Image.open(file_name)
|
| 15 |
col1.image(image, use_column_width=True)
|
| 16 |
-
predictions =
|
| 17 |
|
| 18 |
col2.header("Probabilities")
|
| 19 |
for p in predictions:
|
|
|
|
| 1 |
import streamlit as st
|
|
|
|
| 2 |
from PIL import Image
|
| 3 |
|
| 4 |
+
# Available backend options are: "jax", "tensorflow", "torch".
|
| 5 |
+
import os
|
| 6 |
+
os.environ["KERAS_BACKEND"] = "tensorflow"
|
| 7 |
+
|
| 8 |
+
import keras
|
| 9 |
+
|
| 10 |
+
model = keras.saving.load_model("hf://ElBeh/ma_basemodel")
|
| 11 |
+
|
| 12 |
|
| 13 |
st.title("Fake Detection")
|
| 14 |
|
|
|
|
| 19 |
|
| 20 |
image = Image.open(file_name)
|
| 21 |
col1.image(image, use_column_width=True)
|
| 22 |
+
predictions = model.predict(image)
|
| 23 |
|
| 24 |
col2.header("Probabilities")
|
| 25 |
for p in predictions:
|