mirror of
https://github.com/wiltodelta/remove-ai-watermarks.git
synced 2026-10-18 23:37:14 +02:00
Export calibrated image source providers
This commit is contained in:
3 files changed
+5
-2
No files matched your search
@@ -1166,7 +1166,8 @@ entry point. Its NPZ schema contains only complex spectral filters, spatial
|
||||
templates, and thresholds; the runtime pins the Hub revision and SHA-256,
|
||||
rejects unknown fields and invalid shapes, and never loads pickles. The result
|
||||
has `watermark_truth="unknown"` even when a provider pattern matches. A
|
||||
simultaneous provider match abstains. Tests in
|
||||
simultaneous provider match abstains. `PROVIDERS` exports only the calibrated
|
||||
provider labels for callers that route processing from a source hint. Tests in
|
||||
`tests/test_source_classify_v2.py` cover the public seam and changed-threshold
|
||||
behavior; the [model card](image-source-hf/README.md) records the frozen
|
||||
aggregate evidence and limits. This does not change the earlier
|
||||
|
||||
@@ -12,7 +12,7 @@ from functools import lru_cache
|
||||
from hashlib import file_digest
|
||||
from importlib import import_module
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Any, Literal
|
||||
from typing import TYPE_CHECKING, Any, Literal, get_args
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from numpy.typing import NDArray
|
||||
@@ -51,6 +51,7 @@ CLAIM = "likely image source/export pattern; not SynthID detection"
|
||||
|
||||
SourceLabel = Literal["openai", "google", "unknown"]
|
||||
SourceReason = Literal["classified", "abstained", "conflict", "feature_unavailable"]
|
||||
PROVIDERS = tuple(label for label in get_args(SourceLabel) if label != "unknown")
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
||||
@@ -61,6 +61,7 @@ def test_top_level_api_is_lazy_and_points_to_new_runtime() -> None:
|
||||
|
||||
assert raiw.classify_image_source is model.classify_image_source
|
||||
assert raiw.ImageSourceClassification is model.ImageSourceClassification
|
||||
assert model.PROVIDERS == ("openai", "google")
|
||||
assert len(model.WEIGHTS_REVISION) == 40
|
||||
assert all(character in "0123456789abcdef" for character in model.WEIGHTS_REVISION)
|
||||
|
||||
|
||||
Reference in new issue
Block a user