Update fake_video.py
Browse files- fake_video.py +11 -8
fake_video.py
CHANGED
|
@@ -225,16 +225,19 @@ def analyze_video(video, progress=gr.Progress()):
|
|
| 225 |
color = "red" if is_forged else "green"
|
| 226 |
verdict_text = "🚨 FORGED (FAKE VIDEO)" if is_forged else "✅ REAL VIDEO"
|
| 227 |
|
| 228 |
-
|
| 229 |
f"## Verdict: <span style='color:{color}'>{verdict_text}</span>\n"
|
| 230 |
f"**Voting System (10 Frames):** {fake_votes} Fake / {real_votes} Real\n\n"
|
| 231 |
-
f"**OpenCLIP Semantic Similarity
|
| 232 |
-
f"- Correlation with
|
| 233 |
-
f"- Correlation with
|
| 234 |
-
f"### 🤖 Claude 3.5 Reasoning:\n"
|
| 235 |
-
f"> {claude_reasoning}"
|
| 236 |
)
|
| 237 |
|
| 238 |
-
|
| 239 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 240 |
# Removed standalone UI logic because app.py handles it.
|
|
|
|
| 225 |
color = "red" if is_forged else "green"
|
| 226 |
verdict_text = "🚨 FORGED (FAKE VIDEO)" if is_forged else "✅ REAL VIDEO"
|
| 227 |
|
| 228 |
+
stats_summary = (
|
| 229 |
f"## Verdict: <span style='color:{color}'>{verdict_text}</span>\n"
|
| 230 |
f"**Voting System (10 Frames):** {fake_votes} Fake / {real_votes} Real\n\n"
|
| 231 |
+
f"**OpenCLIP Semantic Similarity:**\n"
|
| 232 |
+
f"- Correlation with Fake: `{avg_sim_fake:.4f}`\n"
|
| 233 |
+
f"- Correlation with Real: `{avg_sim_real:.4f}`"
|
|
|
|
|
|
|
| 234 |
)
|
| 235 |
|
| 236 |
+
# Return EXACTLY 4 items to match your app.py outputs list
|
| 237 |
+
return (
|
| 238 |
+
best_face_for_claude, # 1. Goes to vid_img_out (Image)
|
| 239 |
+
stats_summary, # 2. Goes to vid_txt_out (Markdown)
|
| 240 |
+
claude_reasoning, # 3. Goes to vid_reason_out (Textbox)
|
| 241 |
+
verdict_text # 4. Goes to vid_hidden (Textbox)
|
| 242 |
+
)
|
| 243 |
# Removed standalone UI logic because app.py handles it.
|