Spaces:
Running
Running
# inference_2.py | |
from PIL import Image | |
import numpy as np | |
def detect_ai_generated_image(img): | |
# if img is a path, load as array | |
if isinstance(img, str): | |
img = np.array(Image.open(img).convert("RGB")) | |
# 🧠 PLACEHOLDER: fake logic | |
# Replace with actual AI detection logic or model | |
mean_pixel = img.mean() | |
if mean_pixel > 120: | |
return "Possibly AI-generated" | |
else: | |
return "Likely Real" | |