Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,6 +8,11 @@ from huggingface_hub import snapshot_download
|
|
| 8 |
local_model_path = snapshot_download(repo_id="ElBeh/ma_basemodel")
|
| 9 |
model = keras.models.load_model(local_model_path)
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
st.title("Fake Detection")
|
| 13 |
|
|
@@ -17,12 +22,10 @@ if file_name is not None:
|
|
| 17 |
col1, col2 = st.columns(2)
|
| 18 |
|
| 19 |
image = Image.open(file_name)
|
| 20 |
-
col1.image(image, use_column_width=True)
|
| 21 |
-
|
| 22 |
st.subheader('Bild geladen')
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
predictions = 0
|
| 26 |
|
| 27 |
col2.header("Probabilities")
|
| 28 |
for p in predictions:
|
|
|
|
| 8 |
local_model_path = snapshot_download(repo_id="ElBeh/ma_basemodel")
|
| 9 |
model = keras.models.load_model(local_model_path)
|
| 10 |
|
| 11 |
+
def get_prediction(img):
|
| 12 |
+
x = image.img_to_array(img)
|
| 13 |
+
x = np.expand_dims(x, axis=0)
|
| 14 |
+
predictions = model.predict(x)
|
| 15 |
+
return predictions
|
| 16 |
|
| 17 |
st.title("Fake Detection")
|
| 18 |
|
|
|
|
| 22 |
col1, col2 = st.columns(2)
|
| 23 |
|
| 24 |
image = Image.open(file_name)
|
| 25 |
+
col1.image(image, use_column_width=True)
|
|
|
|
| 26 |
st.subheader('Bild geladen')
|
| 27 |
+
|
| 28 |
+
predictions = get_prediction(image)
|
|
|
|
| 29 |
|
| 30 |
col2.header("Probabilities")
|
| 31 |
for p in predictions:
|