Vi0509 commited on
Commit
d4781ee
Β·
verified Β·
1 Parent(s): 748844e

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +15 -15
app.py CHANGED
@@ -25,33 +25,33 @@ app.add_middleware(CORSMiddleware, allow_origins=["*"], allow_methods=["*"], all
25
  DEVICE = torch.device("cpu")
26
 
27
  # ── Ensemble configs (from optimizer) ──
28
- # Using image_ensemble_v2 + ai_gen (the two models with confirmed working architectures)
29
- # These achieve 99.3-99.4% F1 across all platforms
30
  ENSEMBLE_CONFIGS = {
31
  "clean": {
32
- "models": ["image_ensemble_v2", "ai_gen"],
33
- "weights": [0.556, 0.444],
34
- "threshold": 0.55
35
  },
36
  "whatsapp": {
37
  "models": ["image_ensemble_v2"],
38
  "weights": [1.0],
39
- "threshold": 0.65
40
  },
41
  "instagram": {
42
- "models": ["image_ensemble_v2", "ai_gen"],
43
- "weights": [0.6, 0.4],
44
- "threshold": 0.60
45
  },
46
  "telegram": {
47
- "models": ["image_ensemble_v2", "ai_gen"],
48
- "weights": [0.75, 0.25],
49
- "threshold": 0.60
50
  },
51
  "screenshot": {
52
- "models": ["image_ensemble_v2", "ai_gen"],
53
- "weights": [0.667, 0.333],
54
- "threshold": 0.55
55
  }
56
  }
57
 
 
25
  DEVICE = torch.device("cpu")
26
 
27
  # ── Ensemble configs (from optimizer) ──
28
+ # Using image_ensemble_v2 only β€” ai_gen model has class-mapping issues (always predicts fake)
29
+ # Will re-enable ai_gen after retraining/fixing
30
  ENSEMBLE_CONFIGS = {
31
  "clean": {
32
+ "models": ["image_ensemble_v2"],
33
+ "weights": [1.0],
34
+ "threshold": 0.50
35
  },
36
  "whatsapp": {
37
  "models": ["image_ensemble_v2"],
38
  "weights": [1.0],
39
+ "threshold": 0.55
40
  },
41
  "instagram": {
42
+ "models": ["image_ensemble_v2"],
43
+ "weights": [1.0],
44
+ "threshold": 0.50
45
  },
46
  "telegram": {
47
+ "models": ["image_ensemble_v2"],
48
+ "weights": [1.0],
49
+ "threshold": 0.50
50
  },
51
  "screenshot": {
52
+ "models": ["image_ensemble_v2"],
53
+ "weights": [1.0],
54
+ "threshold": 0.50
55
  }
56
  }
57