Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -40,17 +40,18 @@ def predict(image_path):
|
|
40 |
|
41 |
label = "Real" if avg_pred > 0.5 else "Fake"
|
42 |
|
43 |
-
return {
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
49 |
|
50 |
iface = gr.Interface(
|
51 |
fn=predict,
|
52 |
inputs=gr.Image(type="filepath"),
|
53 |
-
outputs=gr.JSON(), # ✅ Now it actually returns a dict
|
54 |
live=False
|
55 |
)
|
56 |
|
|
|
40 |
|
41 |
label = "Real" if avg_pred > 0.5 else "Fake"
|
42 |
|
43 |
+
return {"result": {
|
44 |
+
"label": label,
|
45 |
+
"average": round(avg_pred, 3),
|
46 |
+
"xception": round(xcp_pred, 3),
|
47 |
+
"efficientnet": round(eff_pred, 3)
|
48 |
+
}}
|
49 |
+
|
50 |
|
51 |
iface = gr.Interface(
|
52 |
fn=predict,
|
53 |
inputs=gr.Image(type="filepath"),
|
54 |
+
outputs=gr.JSON(label="Prediction"), # ✅ Now it actually returns a dict
|
55 |
live=False
|
56 |
)
|
57 |
|