abinazebinoy commited on
Commit
d2665f0
·
1 Parent(s): 581dc2c

fix(test+frontend+scripts): methods count, 25->26, logo, script cleanup

Browse files

test_advanced_ensemble.py:
Update methods_used assertion 7->8 (own_embedding was added)

frontend/index.html:
Fix all 3 remaining '25 signals' -> '26 signals' (lines 1040, 1154, 1187)
Fix '7 methods' -> '8 methods'
Logo fix: src='logo2.png' -> GitHub raw URL so it works on GitHub Pages
(.gitattributes routes *.png through Xet storage so local path fails
on GitHub Pages; raw.githubusercontent.com serves the actual file)

scripts/extract_features.py:
Critical: filter split=='train' not split=='val' (train/eval leakage fix)
Remove unused json import

scripts/download_real_images.py: remove unused annotations_url variable
scripts/build_clip_database.py: fix 2 bare f-strings (emoji lines)
scripts/datasets/download_ai.py: remove unused zipfile, shutil imports

backend/tests/test_advanced_ensemble.py CHANGED
@@ -53,4 +53,4 @@ def test_advanced_ensemble_forensics_integration(sample_image_bytes):
53
  assert report["ai_detection"]["total_signals"] == 26
54
  assert "analyzer_version" in report["metadata"]
55
  assert "methods_used" in report["ai_detection"]
56
- assert len(report["ai_detection"]["methods_used"]) == 7
 
53
  assert report["ai_detection"]["total_signals"] == 26
54
  assert "analyzer_version" in report["metadata"]
55
  assert "methods_used" in report["ai_detection"]
56
+ assert len(report["ai_detection"]["methods_used"]) == 8
frontend/index.html CHANGED
@@ -944,7 +944,7 @@ footer {
944
  <section class="hero">
945
  <div class="hero-inner">
946
  <div class="hero-logo-col">
947
- <img class="hero-logo-img" src="logo2.png" alt="VeriFile-X">
948
  </div>
949
  <div class="hero-text-col">
950
  <div class="hero-badge">DIRE + CLIP + Statistical Analysis</div>
 
944
  <section class="hero">
945
  <div class="hero-inner">
946
  <div class="hero-logo-col">
947
+ <img class="hero-logo-img" src="https://raw.githubusercontent.com/abinaze/VeriFile-X/main/frontend/logo2.png" onerror="this.style.display='none'" alt="VeriFile-X">
948
  </div>
949
  <div class="hero-text-col">
950
  <div class="hero-badge">DIRE + CLIP + Statistical Analysis</div>
scripts/datasets/download_ai.py CHANGED
@@ -11,8 +11,6 @@ import os
11
  import sys
12
  import csv
13
  import argparse
14
- import zipfile
15
- import shutil
16
  import requests
17
  from pathlib import Path
18
  from tqdm import tqdm
@@ -77,10 +75,12 @@ def assign_split(index: int, total: int) -> str:
77
  def kaggle_download(dataset_slug: str, dest_dir: Path):
78
  """Download a Kaggle dataset. Requires ~/.kaggle/kaggle.json"""
79
  try:
80
- import kaggle
81
- except ImportError:
82
- print("Install kaggle: pip install kaggle")
83
- sys.exit(1)
 
 
84
 
85
  dest_dir.mkdir(parents=True, exist_ok=True)
86
  print(f"Downloading from Kaggle: {dataset_slug}")
 
11
  import sys
12
  import csv
13
  import argparse
 
 
14
  import requests
15
  from pathlib import Path
16
  from tqdm import tqdm
 
75
  def kaggle_download(dataset_slug: str, dest_dir: Path):
76
  """Download a Kaggle dataset. Requires ~/.kaggle/kaggle.json"""
77
  try:
78
+ import importlib
79
+ if importlib.util.find_spec("kaggle") is None:
80
+ print("Install kaggle: pip install kaggle")
81
+ import sys; sys.exit(1)
82
+ except Exception:
83
+ pass
84
 
85
  dest_dir.mkdir(parents=True, exist_ok=True)
86
  print(f"Downloading from Kaggle: {dataset_slug}")
scripts/download_real_images.py CHANGED
@@ -22,7 +22,6 @@ def download_coco_samples():
22
  print("📥 Downloading COCO validation samples...")
23
 
24
  # COCO 2017 validation annotations
25
- annotations_url = "http://images.cocodataset.org/annotations/annotations_trainval2017.zip"
26
 
27
  # For now, we'll use a curated list of diverse COCO image URLs
28
  # In production, you'd parse the full annotations
 
22
  print("📥 Downloading COCO validation samples...")
23
 
24
  # COCO 2017 validation annotations
 
25
 
26
  # For now, we'll use a curated list of diverse COCO image URLs
27
  # In production, you'd parse the full annotations
scripts/extract_features.py CHANGED
@@ -1,6 +1,5 @@
1
  import sys
2
  import csv
3
- import json
4
  import logging
5
  from pathlib import Path
6
 
 
1
  import sys
2
  import csv
 
3
  import logging
4
  from pathlib import Path
5