Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,7 +39,8 @@ def classify_image(img: Image.Image):
|
|
| 39 |
with torch.no_grad():
|
| 40 |
outputs = model(img_tensor)
|
| 41 |
_, predicted = torch.max(outputs, 1)
|
| 42 |
-
|
|
|
|
| 43 |
return label
|
| 44 |
|
| 45 |
# ✅ Then wrap it in predict()
|
|
|
|
| 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 |
# ✅ Then wrap it in predict()
|