Update app.py
Browse files
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 |
-
|
|
|
|
| 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)
|