wiltodelta commited on
Commit
016b464
·
verified ·
1 Parent(s): ebc2dcf

Source-classify freeze (GitHub 4ce3bad)

Browse files
Files changed (4) hide show
  1. README.md +2 -0
  2. benchmark.py +9 -4
  3. demo.ipynb +1 -1
  4. infer.py +1 -1
README.md CHANGED
@@ -83,6 +83,8 @@ The artifact contains only learned parameters, weight-fp16 ONNX graph bytes, nor
83
 
84
  ### Open 578-image multi-regime benchmark (`benchmark.py`)
85
 
 
 
86
  Evaluated end-to-end via `classify_source` on `200` non-AI false-positive traps (`50` camera photos, `50` UI screenshots, `50` science diagrams, `50` scanned documents), `125` untouched native AI exports (`25` each across FLUX.1-dev, GPT-Image-1, Gemini Nano Banana Pro, SDXL, Midjourney v6.1), and `253` square-resized/transcoded crowd-arena AI images (`Rapidata` and `bitmind` `1024x1024` JPEG/WebP/PNG):
87
 
88
  - **Non-AI false-positive rate (`200` traps):** **`0.0%` (`0 / 200`)** across all four slices (`0%` camera photo, `0%` UI screenshot, `0%` science diagram, `0%` scanned document) and **`100.0%` precision**.
 
83
 
84
  ### Open 578-image multi-regime benchmark (`benchmark.py`)
85
 
86
+ Interactive 20-model comparison matrix: [`wiltodelta/ai-image-detector-leaderboard`](https://huggingface.co/spaces/wiltodelta/ai-image-detector-leaderboard).
87
+
88
  Evaluated end-to-end via `classify_source` on `200` non-AI false-positive traps (`50` camera photos, `50` UI screenshots, `50` science diagrams, `50` scanned documents), `125` untouched native AI exports (`25` each across FLUX.1-dev, GPT-Image-1, Gemini Nano Banana Pro, SDXL, Midjourney v6.1), and `253` square-resized/transcoded crowd-arena AI images (`Rapidata` and `bitmind` `1024x1024` JPEG/WebP/PNG):
89
 
90
  - **Non-AI false-positive rate (`200` traps):** **`0.0%` (`0 / 200`)** across all four slices (`0%` camera photo, `0%` UI screenshot, `0%` science diagram, `0%` scanned document) and **`100.0%` precision**.
benchmark.py CHANGED
@@ -2,7 +2,7 @@
2
  # /// script
3
  # requires-python = ">=3.11,<3.15"
4
  # dependencies = [
5
- # "remove-ai-watermarks[source-classify]>=0.62.1",
6
  # "huggingface-hub>=0.26.0",
7
  # "onnxruntime>=1.24.0",
8
  # "peft>=0.14.0",
@@ -722,11 +722,16 @@ def _evaluate_rgb_detector(
722
  )
723
 
724
 
725
- def evaluate_raiw(samples: list[SampleItem]) -> dict[str, Any]:
 
 
 
 
 
726
  """Evaluate `wiltodelta/raiw-source-classify` on CPU."""
727
  from remove_ai_watermarks import source_classify as sc
728
 
729
- weights_file = sc.resolve_weights_path()
730
  weights_mb = round(weights_file.stat().st_size / (1024 * 1024), 2)
731
 
732
  def _classify_one(raw_bytes: bytes) -> dict[str, Any]:
@@ -755,7 +760,7 @@ def evaluate_raiw(samples: list[SampleItem]) -> dict[str, Any]:
755
 
756
  return _summarize_predictions(
757
  model_id=sc.WEIGHTS_REPO,
758
- revision=sc.WEIGHTS_REVISION,
759
  runtime="NumPy + ONNX Runtime (CPU)",
760
  weights_mb=weights_mb,
761
  license_id="apache-2.0",
 
2
  # /// script
3
  # requires-python = ">=3.11,<3.15"
4
  # dependencies = [
5
+ # "remove-ai-watermarks[source-classify]>=0.64.0",
6
  # "huggingface-hub>=0.26.0",
7
  # "onnxruntime>=1.24.0",
8
  # "peft>=0.14.0",
 
722
  )
723
 
724
 
725
+ def evaluate_raiw(
726
+ samples: list[SampleItem],
727
+ *,
728
+ weights_path: Path | None = None,
729
+ revision: str | None = None,
730
+ ) -> dict[str, Any]:
731
  """Evaluate `wiltodelta/raiw-source-classify` on CPU."""
732
  from remove_ai_watermarks import source_classify as sc
733
 
734
+ weights_file = sc.resolve_weights_path(weights_path)
735
  weights_mb = round(weights_file.stat().st_size / (1024 * 1024), 2)
736
 
737
  def _classify_one(raw_bytes: bytes) -> dict[str, Any]:
 
760
 
761
  return _summarize_predictions(
762
  model_id=sc.WEIGHTS_REPO,
763
+ revision=revision or sc.WEIGHTS_REVISION,
764
  runtime="NumPy + ONNX Runtime (CPU)",
765
  weights_mb=weights_mb,
766
  license_id="apache-2.0",
demo.ipynb CHANGED
@@ -22,7 +22,7 @@
22
  "metadata": {},
23
  "outputs": [],
24
  "source": [
25
- "%pip install -q \"remove-ai-watermarks[source-classify]>=0.62.0\""
26
  ]
27
  },
28
  {
 
22
  "metadata": {},
23
  "outputs": [],
24
  "source": [
25
+ "%pip install -q \"remove-ai-watermarks[source-classify]>=0.64.0\""
26
  ]
27
  },
28
  {
infer.py CHANGED
@@ -2,7 +2,7 @@
2
  # /// script
3
  # requires-python = ">=3.11,<3.15"
4
  # dependencies = [
5
- # "remove-ai-watermarks[source-classify]>=0.62.0",
6
  # ]
7
  # ///
8
  """Standalone reference runner and pickle-free `.npz` weight inspector for `wiltodelta/raiw-source-classify`.
 
2
  # /// script
3
  # requires-python = ">=3.11,<3.15"
4
  # dependencies = [
5
+ # "remove-ai-watermarks[source-classify]>=0.64.0",
6
  # ]
7
  # ///
8
  """Standalone reference runner and pickle-free `.npz` weight inspector for `wiltodelta/raiw-source-classify`.