Zeyadd-Mostaffa commited on
Commit
2bf05af
·
verified ·
1 Parent(s): 93ce865

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -28,18 +28,14 @@ def predict(image):
28
  avg_pred = (xcp_pred + eff_pred) / 2
29
  label = "Real" if avg_pred > 0.5 else "Fake"
30
 
31
- result = f"{label} (Avg: {avg_pred:.3f}, XCP: {xcp_pred:.3f}, EFF: {eff_pred:.3f})"
32
- return result, image
33
 
34
  interface = gr.Interface(
35
  fn=predict,
36
  inputs=gr.Image(type="numpy", label="Upload Image"),
37
- outputs=[
38
- gr.Label(label="Prediction"),
39
- gr.Image(type="numpy", label="Input Image")
40
- ],
41
- title="Deepfake Image Detector (Ensemble: Xception + EfficientNetB4)",
42
- description="Upload a full image. The model classifies it as real or fake using an ensemble of Xception and EfficientNetB4."
43
  )
44
 
45
  interface.launch()
 
28
  avg_pred = (xcp_pred + eff_pred) / 2
29
  label = "Real" if avg_pred > 0.5 else "Fake"
30
 
31
+ return label
 
32
 
33
  interface = gr.Interface(
34
  fn=predict,
35
  inputs=gr.Image(type="numpy", label="Upload Image"),
36
+ outputs=gr.Label(label="Prediction"),
37
+ title="Deepfake Image Detector",
38
+ description="Upload a full image. The model classifies it as real or fake."
 
 
 
39
  )
40
 
41
  interface.launch()