Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,7 +43,7 @@ def detect(image, confidence_threshold=0.5):
|
|
| 43 |
face_manipulation_likelihood = confidence_fake # Refine if possible
|
| 44 |
|
| 45 |
# Add diagnostic output for debugging
|
| 46 |
-
logger.info(f"Probabilities - Real: {confidence_real:.1f}%, Fake: {confidence_fake:.1f}
|
| 47 |
|
| 48 |
overall = f"{confidence_score:.1f}% Confidence ({threshold_predicted})"
|
| 49 |
aigen = f"{aigen_likelihood:.1f}% (AI-Generated Content Likelihood)"
|
|
@@ -112,7 +112,7 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Default()) as demo:
|
|
| 112 |
with gr.Row(elem_classes="container"):
|
| 113 |
with gr.Column(scale=1):
|
| 114 |
image = gr.Image(type='filepath', height=400, label="Upload Image")
|
| 115 |
-
threshold = gr.Slider(0, 1, value=0.
|
| 116 |
detect_button = gr.Button("Analyze Image", elem_classes="button-gradient")
|
| 117 |
with gr.Column(scale=2):
|
| 118 |
overall = gr.Label(label="Confidence Score")
|
|
|
|
| 43 |
face_manipulation_likelihood = confidence_fake # Refine if possible
|
| 44 |
|
| 45 |
# Add diagnostic output for debugging
|
| 46 |
+
logger.info(f"Image: {image.name}, Probabilities - Real: {confidence_real:.1f}%, Fake: {confidence_fake:.1f}%, Predicted: {predicted_label}")
|
| 47 |
|
| 48 |
overall = f"{confidence_score:.1f}% Confidence ({threshold_predicted})"
|
| 49 |
aigen = f"{aigen_likelihood:.1f}% (AI-Generated Content Likelihood)"
|
|
|
|
| 112 |
with gr.Row(elem_classes="container"):
|
| 113 |
with gr.Column(scale=1):
|
| 114 |
image = gr.Image(type='filepath', height=400, label="Upload Image")
|
| 115 |
+
threshold = gr.Slider(0, 1, value=0.7, step=0.01, label="Confidence Threshold (Fake)")
|
| 116 |
detect_button = gr.Button("Analyze Image", elem_classes="button-gradient")
|
| 117 |
with gr.Column(scale=2):
|
| 118 |
overall = gr.Label(label="Confidence Score")
|