anky2002 commited on
Commit
f2fc256
·
verified ·
1 Parent(s): bb46227

Upload agents/model_agent.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. agents/model_agent.py +8 -2
agents/model_agent.py CHANGED
@@ -77,10 +77,16 @@ def m05_autocorrelation(img):
77
  h,w=ac.shape; cy,cx=h//2,w//2; acm=ac.copy()
78
  re=max(h,w)//20; Y,X=np.mgrid[0:h,0:w]; cm=((X-cx)**2+(Y-cy)**2)<re**2; acm[cm]=0
79
  ms=float(np.max(acm))
80
- if ms>0.3: s,n=0.6,f"Strong secondary peak ({ms:.3f}) GAN checkerboard"
 
 
 
81
  elif ms>0.15: s,n=0.3,f"Moderate peak ({ms:.3f})"
82
  else: s,n=-0.2,f"Natural autocorrelation ({ms:.3f})"
83
- return {"test":"Autocorrelation Peak","max_secondary":round(ms,4),"score":s,"note":n}
 
 
 
84
 
85
  def m06_checkerboard(img):
86
  gray=_g(img); h,w=gray.shape
 
77
  h,w=ac.shape; cy,cx=h//2,w//2; acm=ac.copy()
78
  re=max(h,w)//20; Y,X=np.mgrid[0:h,0:w]; cm=((X-cx)**2+(Y-cy)**2)<re**2; acm[cm]=0
79
  ms=float(np.max(acm))
80
+ # HARD THRESHOLD: >0.95 is physically impossible for any real camera sensor.
81
+ # This overrides ALL modality suppression — no real photo can produce this.
82
+ if ms>0.95: s,n=0.8,f"CRITICAL: Autocorrelation {ms:.3f} exceeds physical camera limit — AI generated"
83
+ elif ms>0.3: s,n=0.6,f"Strong secondary peak ({ms:.3f}) — GAN checkerboard"
84
  elif ms>0.15: s,n=0.3,f"Moderate peak ({ms:.3f})"
85
  else: s,n=-0.2,f"Natural autocorrelation ({ms:.3f})"
86
+ result = {"test":"Autocorrelation Peak","max_secondary":round(ms,4),"score":s,"note":n}
87
+ if ms > 0.95:
88
+ result["override_suppression"] = True # Signal to utils.py: do NOT suppress this
89
+ return result
90
 
91
  def m06_checkerboard(img):
92
  gray=_g(img); h,w=gray.shape