quazarcom commited on
Commit
13b7eb0
·
verified ·
1 Parent(s): ce90053

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -39,9 +39,11 @@ def classify_image(img: Image.Image):
39
  with torch.no_grad():
40
  outputs = model(img_tensor)
41
  _, predicted = torch.max(outputs, 1)
42
- label = 'Fake' if predicted.item() == 0 else 'Real'
 
43
  return label
44
 
 
45
  # ✅ Then wrap it in predict()
46
  def predict(img: Image.Image):
47
  return classify_image(img)
 
39
  with torch.no_grad():
40
  outputs = model(img_tensor)
41
  _, predicted = torch.max(outputs, 1)
42
+ print("🔍 Prediction index:", predicted.item()) # Optional debug
43
+ label = 'Real' if predicted.item() == 0 else 'Fake'
44
  return label
45
 
46
+
47
  # ✅ Then wrap it in predict()
48
  def predict(img: Image.Image):
49
  return classify_image(img)