Zeyadd-Mostaffa commited on
Commit
3378d00
·
verified ·
1 Parent(s): e3fbc7a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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 file path (not array)
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", label="image_path"), # <- This must match backend call
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
  )