Spaces:
Sleeping
Sleeping
Update dashboard.py
Browse files- dashboard.py +1 -1
dashboard.py
CHANGED
@@ -45,7 +45,7 @@ def predict_image(image):
|
|
45 |
with torch.no_grad():
|
46 |
outputs = hf_model(**inputs)
|
47 |
probs = torch.nn.functional.softmax(outputs.logits, dim=1).squeeze().tolist()
|
48 |
-
label = "✅ Real Image" if probs[
|
49 |
confidence = max(probs)
|
50 |
return f"{label} (Confidence: {confidence:.2%})"
|
51 |
|
|
|
45 |
with torch.no_grad():
|
46 |
outputs = hf_model(**inputs)
|
47 |
probs = torch.nn.functional.softmax(outputs.logits, dim=1).squeeze().tolist()
|
48 |
+
label = "✅ Real Image" if probs[0] >= probs[1] else "⚠️ Fake Image"
|
49 |
confidence = max(probs)
|
50 |
return f"{label} (Confidence: {confidence:.2%})"
|
51 |
|