Spaces:
Running
Running
File size: 888 Bytes
2e175db | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | """
Frequency-domain detector (Stage 2).
The intuition: many generators leave characteristic artefacts in the frequency
spectrum (DCT/FFT) that are not visible to humans but are highly diagnostic.
This detector complements CLIP-based semantic detection — when the generator
fools CLIP, frequency artefacts often still betray it.
NOT IMPLEMENTED in Stage 1. Wire the implementation in when the dataset is
curated and we can validate the approach on held-out generators.
"""
from __future__ import annotations
from PIL import Image
from .base import Detector, DetectorResult
class FrequencyDetector(Detector):
name = "frequency_artifacts"
def run(self, image: Image.Image) -> DetectorResult: # noqa: ARG002
raise NotImplementedError(
"FrequencyDetector is reserved for Stage 2. "
"Set ENABLE_FREQUENCY_DETECTOR=false in Stage 1."
)
|