Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ eff_path = hf_hub_download(repo_id="Zeyadd-Mostaffa/deepfake-image-detector_fina
|
|
| 14 |
xcp_model = load_model(xcp_path)
|
| 15 |
eff_model = load_model(eff_path)
|
| 16 |
|
| 17 |
-
def predict(image_path): # receives
|
| 18 |
image = cv2.imread(image_path)
|
| 19 |
if image is None:
|
| 20 |
return "Invalid image"
|
|
@@ -36,7 +36,7 @@ def predict(image_path): # receives file path (not array)
|
|
| 36 |
|
| 37 |
iface = gr.Interface(
|
| 38 |
fn=predict,
|
| 39 |
-
inputs=gr.Image(type="filepath",
|
| 40 |
outputs="text",
|
| 41 |
allow_flagging="never"
|
| 42 |
)
|
|
|
|
| 14 |
xcp_model = load_model(xcp_path)
|
| 15 |
eff_model = load_model(eff_path)
|
| 16 |
|
| 17 |
+
def predict(image_path): # receives filepath from gr.Image(type="filepath")
|
| 18 |
image = cv2.imread(image_path)
|
| 19 |
if image is None:
|
| 20 |
return "Invalid image"
|
|
|
|
| 36 |
|
| 37 |
iface = gr.Interface(
|
| 38 |
fn=predict,
|
| 39 |
+
inputs=gr.Image(type="filepath", name="image"), # ✅ name must match Flask
|
| 40 |
outputs="text",
|
| 41 |
allow_flagging="never"
|
| 42 |
)
|