Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -186,7 +186,7 @@ def detect_with_model(image: Image.Image, prompt: str, username: str, model_name
|
|
| 186 |
sorted_scores = sorted(leaderboard_scores.items(), key=lambda x: x[1], reverse=True)
|
| 187 |
leaderboard_table = [[name, points] for name, points in sorted_scores]
|
| 188 |
|
| 189 |
-
type_image = "real" if model_name.lower() == "real" else "fake"
|
| 190 |
image_dir = os.path.join("test", type_image)
|
| 191 |
os.makedirs(image_dir, exist_ok=True)
|
| 192 |
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
|
@@ -240,7 +240,7 @@ def load_initial_state():
|
|
| 240 |
# --- Gradio UI ---
|
| 241 |
with gr.Blocks(css=".gr-button {font-size: 16px !important}") as demo:
|
| 242 |
gr.Markdown("## 🌝 OpenFake Arena")
|
| 243 |
-
gr.Markdown("Welcome to the OpenFake Arena!\n\n**Your mission:** Generate a synthetic image for the prompt, upload it, and try to fool the AI detector into thinking it’s real.\n\n**Rules:**\n\n- You can modify the prompt on your end, but the image needs to have the same content. We verify the content with a CLIP similarity threshold.\n\n- Enter \"real\" in the model used to upload and test a real image. You don't need to follow the prompt for real images
|
| 244 |
|
| 245 |
with gr.Group(visible=True) as input_section:
|
| 246 |
username_input = gr.Textbox(label="Your Name", placeholder="Enter your name", interactive=True)
|
|
|
|
| 186 |
sorted_scores = sorted(leaderboard_scores.items(), key=lambda x: x[1], reverse=True)
|
| 187 |
leaderboard_table = [[name, points] for name, points in sorted_scores]
|
| 188 |
|
| 189 |
+
type_image = "real" if (model_name.lower() == "real" or model_name == "") else "fake"
|
| 190 |
image_dir = os.path.join("test", type_image)
|
| 191 |
os.makedirs(image_dir, exist_ok=True)
|
| 192 |
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
|
|
|
| 240 |
# --- Gradio UI ---
|
| 241 |
with gr.Blocks(css=".gr-button {font-size: 16px !important}") as demo:
|
| 242 |
gr.Markdown("## 🌝 OpenFake Arena")
|
| 243 |
+
gr.Markdown("Welcome to the OpenFake Arena!\n\n**Your mission:** Generate a synthetic image for the prompt, upload it, and try to fool the AI detector into thinking it’s real.\n\n**Rules:**\n\n- You can modify the prompt on your end, but the image needs to have the same content. We verify the content with a CLIP similarity threshold.\n\n- Enter \"real\" in the model used to upload and test a real image. You don't need to follow the prompt for real images. Tips: you can also enter \"real\" if you just want to test the detector! We won't be collecting them. \n\n- It is important to enter the correct model name for licensing.\n\n- Only synthetic images count toward the leaderboard!\n\n\nNote: The detector is still in early development. The prompt is not used for prediction, only the image.")
|
| 244 |
|
| 245 |
with gr.Group(visible=True) as input_section:
|
| 246 |
username_input = gr.Textbox(label="Your Name", placeholder="Enter your name", interactive=True)
|