Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,11 +43,11 @@ def predict_image(img, confidence_threshold):
|
|
| 43 |
|
| 44 |
# Check if either class meets the confidence threshold
|
| 45 |
if result['artificial'] >= confidence_threshold:
|
| 46 |
-
return f"
|
| 47 |
elif result['real'] >= confidence_threshold:
|
| 48 |
-
return f"
|
| 49 |
else:
|
| 50 |
-
return "Uncertain
|
| 51 |
|
| 52 |
# Define the Gradio interface
|
| 53 |
image = gr.Image(label="Image to Analyze", sources=['upload'], type='pil') # Ensure the image type is PIL
|
|
|
|
| 43 |
|
| 44 |
# Check if either class meets the confidence threshold
|
| 45 |
if result['artificial'] >= confidence_threshold:
|
| 46 |
+
return f"⚠️ AI Generated Image, Confidence: {result['artificial']:.4f}"
|
| 47 |
elif result['real'] >= confidence_threshold:
|
| 48 |
+
return f"✅ Real Photo, Confidence: {result['real']:.4f}"
|
| 49 |
else:
|
| 50 |
+
return "🤷♂️ Uncertain, not confident enough to call."
|
| 51 |
|
| 52 |
# Define the Gradio interface
|
| 53 |
image = gr.Image(label="Image to Analyze", sources=['upload'], type='pil') # Ensure the image type is PIL
|