Spaces:
Running
Running
Anish commited on
Commit ·
bf557e8
1
Parent(s): 9b8dcc7
[Feature Updated] > Tweaked aggregator for video processing a bit to identify videos more effectively
Browse files
backend/app/ai/video/aggregator.py
CHANGED
|
@@ -52,6 +52,16 @@ def aggregate_scores(
|
|
| 52 |
(md_score * md_weight)
|
| 53 |
) / total_weight
|
| 54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
if final_probability >= THRESHOLDS["ai_certainty"]:
|
| 56 |
label = "AI"
|
| 57 |
elif final_probability >= THRESHOLDS["suspicious_range"]:
|
|
|
|
| 52 |
(md_score * md_weight)
|
| 53 |
) / total_weight
|
| 54 |
|
| 55 |
+
# --- NEURAL OVERRIDE FOR SORA-CLASS MODELS ---
|
| 56 |
+
# SORA and modern generators have near-perfect optical flow and noise consistency.
|
| 57 |
+
# They will score 0.0 on the physics modules, dragging the final score down by 50%.
|
| 58 |
+
# If the SigLIP neural module is highly confident it found visual anomalies,
|
| 59 |
+
# we do not let the analog physics modules drag the verdict down to "Real".
|
| 60 |
+
if avg_frame_score >= 0.82:
|
| 61 |
+
final_probability = max(final_probability, 0.80) # Auto-AI
|
| 62 |
+
elif avg_frame_score >= 0.72:
|
| 63 |
+
final_probability = max(final_probability, 0.55) # Auto-Suspicious
|
| 64 |
+
|
| 65 |
if final_probability >= THRESHOLDS["ai_certainty"]:
|
| 66 |
label = "AI"
|
| 67 |
elif final_probability >= THRESHOLDS["suspicious_range"]:
|
backend/app/api/file_routes.py
CHANGED
|
@@ -26,6 +26,7 @@ def format_file_response(f):
|
|
| 26 |
if f.filetype and f.filetype.startswith("video/"):
|
| 27 |
base_dict["confidence"] = f.confidence
|
| 28 |
base_dict["ai_explanation"] = f.ai_explanation
|
|
|
|
| 29 |
return base_dict
|
| 30 |
|
| 31 |
@router.get("/my-files")
|
|
|
|
| 26 |
if f.filetype and f.filetype.startswith("video/"):
|
| 27 |
base_dict["confidence"] = f.confidence
|
| 28 |
base_dict["ai_explanation"] = f.ai_explanation
|
| 29 |
+
base_dict["size"] = f"{(f.filesize/(1024**2)):.2f} MB"
|
| 30 |
return base_dict
|
| 31 |
|
| 32 |
@router.get("/my-files")
|