Immaculate 0.2.0__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {immaculate-0.2.0 → immaculate-0.4.0}/.github/workflows/ci.yml +8 -8
- immaculate-0.4.0/.github/workflows/release-onnx.yml +47 -0
- {immaculate-0.2.0 → immaculate-0.4.0}/.github/workflows/release.yml +31 -39
- {immaculate-0.2.0 → immaculate-0.4.0}/Cargo.lock +23 -23
- {immaculate-0.2.0 → immaculate-0.4.0}/Cargo.toml +4 -4
- immaculate-0.4.0/PKG-INFO +91 -0
- immaculate-0.4.0/README.md +73 -0
- immaculate-0.4.0/docs/api.md +25 -0
- immaculate-0.4.0/docs/benchmarks.md +181 -0
- immaculate-0.4.0/docs/checks.md +145 -0
- {immaculate-0.2.0 → immaculate-0.4.0}/mkdocs.yml +3 -1
- {immaculate-0.2.0 → immaculate-0.4.0}/pyproject.toml +44 -18
- immaculate-0.4.0/rust/error.rs +51 -0
- immaculate-0.4.0/rust/images.rs +199 -0
- immaculate-0.4.0/rust/lib.rs +441 -0
- {immaculate-0.2.0/rust → immaculate-0.4.0/rust/near}/multi_index.rs +1 -1
- {immaculate-0.2.0/rust → immaculate-0.4.0/rust/near}/pdq.rs +10 -11
- {immaculate-0.2.0/rust → immaculate-0.4.0/rust/near}/phash.rs +9 -11
- {immaculate-0.2.0/rust → immaculate-0.4.0/rust/near}/sscd.rs +10 -10
- immaculate-0.2.0/rust/perceptual_hash.rs → immaculate-0.4.0/rust/near.rs +32 -4
- immaculate-0.4.0/rust/progress.rs +80 -0
- immaculate-0.4.0/rust/properties/pixels.rs +383 -0
- immaculate-0.4.0/rust/properties/settings.rs +81 -0
- immaculate-0.4.0/rust/properties/stats.rs +88 -0
- immaculate-0.4.0/rust/properties.rs +275 -0
- {immaculate-0.2.0 → immaculate-0.4.0}/rust/test_util.rs +1 -1
- immaculate-0.4.0/rust/truncation.rs +176 -0
- immaculate-0.4.0/src/immaculate/__init__.py +39 -0
- immaculate-0.4.0/src/immaculate/__main__.py +243 -0
- immaculate-0.4.0/src/immaculate/_checks.py +229 -0
- immaculate-0.4.0/src/immaculate/_core.pyi +54 -0
- immaculate-0.4.0/src/immaculate/_issues.py +233 -0
- immaculate-0.4.0/tests/test_immaculate.py +841 -0
- {immaculate-0.2.0 → immaculate-0.4.0}/uv.lock +391 -275
- immaculate-0.2.0/PKG-INFO +0 -96
- immaculate-0.2.0/README.md +0 -80
- immaculate-0.2.0/docs/api.md +0 -6
- immaculate-0.2.0/rust/lib.rs +0 -445
- immaculate-0.2.0/src/immaculate/__init__.py +0 -6
- immaculate-0.2.0/src/immaculate/__main__.py +0 -154
- immaculate-0.2.0/src/immaculate/_core.pyi +0 -20
- immaculate-0.2.0/src/immaculate/_duplicates.py +0 -102
- immaculate-0.2.0/src/immaculate/models/SSCD_LICENSE +0 -21
- immaculate-0.2.0/src/immaculate/models/sscd.onnx +0 -0
- immaculate-0.2.0/src/immaculate/models/sscd_distilled.onnx +0 -0
- immaculate-0.2.0/tests/test_immaculate.py +0 -429
- {immaculate-0.2.0 → immaculate-0.4.0}/.gitignore +0 -0
- {immaculate-0.2.0 → immaculate-0.4.0}/.pre-commit-config.yaml +0 -0
- {immaculate-0.2.0 → immaculate-0.4.0}/.python-version +0 -0
- {immaculate-0.2.0 → immaculate-0.4.0}/LICENSE +0 -0
- {immaculate-0.2.0 → immaculate-0.4.0}/clippy.toml +0 -0
- {immaculate-0.2.0 → immaculate-0.4.0}/docs/index.md +0 -0
- {immaculate-0.2.0/rust → immaculate-0.4.0/rust/near}/side_cache.rs +0 -0
- {immaculate-0.2.0 → immaculate-0.4.0}/src/immaculate/py.typed +0 -0
|
@@ -15,8 +15,8 @@ jobs:
|
|
|
15
15
|
lint:
|
|
16
16
|
runs-on: ubuntu-latest
|
|
17
17
|
steps:
|
|
18
|
-
- uses: actions/checkout@
|
|
19
|
-
- uses: astral-sh/setup-uv@
|
|
18
|
+
- uses: actions/checkout@v7
|
|
19
|
+
- uses: astral-sh/setup-uv@v7
|
|
20
20
|
with:
|
|
21
21
|
enable-cache: true
|
|
22
22
|
# Syncing installs the project, which builds the Rust extension
|
|
@@ -31,8 +31,8 @@ jobs:
|
|
|
31
31
|
test:
|
|
32
32
|
runs-on: ubuntu-latest
|
|
33
33
|
steps:
|
|
34
|
-
- uses: actions/checkout@
|
|
35
|
-
- uses: astral-sh/setup-uv@
|
|
34
|
+
- uses: actions/checkout@v7
|
|
35
|
+
- uses: astral-sh/setup-uv@v7
|
|
36
36
|
with:
|
|
37
37
|
enable-cache: true
|
|
38
38
|
- uses: Swatinem/rust-cache@v2
|
|
@@ -43,13 +43,13 @@ jobs:
|
|
|
43
43
|
docs:
|
|
44
44
|
runs-on: ubuntu-latest
|
|
45
45
|
steps:
|
|
46
|
-
- uses: actions/checkout@
|
|
47
|
-
- uses: astral-sh/setup-uv@
|
|
46
|
+
- uses: actions/checkout@v7
|
|
47
|
+
- uses: astral-sh/setup-uv@v7
|
|
48
48
|
with:
|
|
49
49
|
enable-cache: true
|
|
50
50
|
# mkdocstrings reads the source statically, so the Rust extension isn't built
|
|
51
51
|
- run: uv run --locked --only-group docs mkdocs build --strict
|
|
52
|
-
- uses: actions/upload-pages-artifact@
|
|
52
|
+
- uses: actions/upload-pages-artifact@v5
|
|
53
53
|
if: github.event_name == 'push'
|
|
54
54
|
with:
|
|
55
55
|
path: site
|
|
@@ -66,4 +66,4 @@ jobs:
|
|
|
66
66
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
67
67
|
steps:
|
|
68
68
|
- id: deployment
|
|
69
|
-
uses: actions/deploy-pages@
|
|
69
|
+
uses: actions/deploy-pages@v5
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Release immaculate-onnx
|
|
2
|
+
|
|
3
|
+
# Builds the immaculate-onnx package and, on an immaculate-onnx-v<version> tag, publishes it to
|
|
4
|
+
# PyPI; see DEPLOYMENT.md. It is a workflow of its own, not a job in release.yml, so its trusted
|
|
5
|
+
# publisher differs from immaculate's: PyPI would otherwise give the upload immaculate's token,
|
|
6
|
+
# which can't create or upload to another project
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
tags: ["immaculate-onnx-v*"]
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
# Pure Python, so one wheel serves every platform
|
|
17
|
+
build:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v7
|
|
21
|
+
- uses: astral-sh/setup-uv@v7
|
|
22
|
+
- run: uv build --package immaculate-onnx --out-dir dist
|
|
23
|
+
- uses: actions/upload-artifact@v7
|
|
24
|
+
with:
|
|
25
|
+
name: immaculate-onnx
|
|
26
|
+
path: dist/*
|
|
27
|
+
|
|
28
|
+
# Uploads use trusted publishing, so no tokens are stored; PyPI trusts this workflow in the
|
|
29
|
+
# pypi environment, which needs approval
|
|
30
|
+
publish-pypi:
|
|
31
|
+
if: startsWith(github.ref, 'refs/tags/immaculate-onnx-v')
|
|
32
|
+
needs: build
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
environment:
|
|
35
|
+
name: pypi
|
|
36
|
+
url: https://pypi.org/project/immaculate-onnx/
|
|
37
|
+
permissions:
|
|
38
|
+
id-token: write
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/download-artifact@v8
|
|
41
|
+
with:
|
|
42
|
+
name: immaculate-onnx
|
|
43
|
+
path: dist
|
|
44
|
+
# PyPI never accepts a version twice, so a test tag mustn't upload the real version
|
|
45
|
+
- name: Check the tag matches the version
|
|
46
|
+
run: test -f "dist/immaculate_onnx-${GITHUB_REF_NAME#immaculate-onnx-v}.tar.gz"
|
|
47
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
name: Release
|
|
2
2
|
|
|
3
|
-
# Builds the sdist and a wheel for each platform ONNX Runtime has wheels for,
|
|
4
|
-
# wheel on its own platform, and on a version tag
|
|
5
|
-
# DEPLOYMENT.md
|
|
3
|
+
# Builds the sdist and a wheel for each platform ONNX Runtime has wheels for, so the sscd extra
|
|
4
|
+
# installs wherever Immaculate does, tests each wheel on its own platform, and on a version tag
|
|
5
|
+
# publishes them to PyPI; see DEPLOYMENT.md. The immaculate-onnx package has its own workflow,
|
|
6
|
+
# release-onnx.yml
|
|
6
7
|
on:
|
|
7
8
|
push:
|
|
8
9
|
tags: ["v*"]
|
|
@@ -27,22 +28,23 @@ jobs:
|
|
|
27
28
|
python-arch: arm64
|
|
28
29
|
runs-on: ${{ matrix.os }}
|
|
29
30
|
steps:
|
|
30
|
-
- uses: actions/checkout@
|
|
31
|
+
- uses: actions/checkout@v7
|
|
31
32
|
- id: python
|
|
32
|
-
uses: actions/setup-python@
|
|
33
|
+
uses: actions/setup-python@v7
|
|
33
34
|
with:
|
|
34
35
|
python-version: "3.12"
|
|
35
36
|
architecture: ${{ matrix.python-arch }}
|
|
36
37
|
- uses: dtolnay/rust-toolchain@stable
|
|
37
38
|
- uses: PyO3/maturin-action@v1
|
|
38
39
|
with:
|
|
39
|
-
maturin-version: v1.
|
|
40
|
+
maturin-version: v1.16.0
|
|
40
41
|
args: --release --out dist
|
|
41
42
|
# ONNX Runtime's own Linux wheels need glibc 2.28
|
|
42
43
|
manylinux: "2_28"
|
|
43
|
-
- uses: astral-sh/setup-uv@
|
|
44
|
-
# Tests the built wheel, not the source tree: the dev group
|
|
45
|
-
# it doesn't build
|
|
44
|
+
- uses: astral-sh/setup-uv@v7
|
|
45
|
+
# Tests the built wheel, not the source tree: the dev group doesn't include Immaculate,
|
|
46
|
+
# so syncing it doesn't build it. It does install immaculate-onnx from the source tree,
|
|
47
|
+
# for the tests of the SSCD methods
|
|
46
48
|
- name: Test the wheel
|
|
47
49
|
shell: bash
|
|
48
50
|
# Only uv sync is given the Python: with UV_PYTHON set, uv pip would install into that
|
|
@@ -53,60 +55,50 @@ jobs:
|
|
|
53
55
|
uv sync --locked --only-group dev --python "$PYTHON"
|
|
54
56
|
uv pip install dist/*.whl
|
|
55
57
|
uv run --no-sync pytest
|
|
56
|
-
- uses: actions/upload-artifact@
|
|
58
|
+
- uses: actions/upload-artifact@v7
|
|
57
59
|
with:
|
|
58
|
-
name: wheel-${{ matrix.os }}
|
|
60
|
+
name: immaculate-wheel-${{ matrix.os }}
|
|
59
61
|
path: dist/*.whl
|
|
60
62
|
|
|
61
63
|
sdist:
|
|
62
64
|
runs-on: ubuntu-latest
|
|
63
65
|
steps:
|
|
64
|
-
- uses: actions/checkout@
|
|
66
|
+
- uses: actions/checkout@v7
|
|
65
67
|
- uses: PyO3/maturin-action@v1
|
|
66
68
|
with:
|
|
67
|
-
maturin-version: v1.
|
|
69
|
+
maturin-version: v1.16.0
|
|
68
70
|
command: sdist
|
|
69
71
|
args: --out dist
|
|
70
|
-
- uses: actions/upload-artifact@
|
|
72
|
+
- uses: actions/upload-artifact@v7
|
|
71
73
|
with:
|
|
72
|
-
name: sdist
|
|
74
|
+
name: immaculate-sdist
|
|
73
75
|
path: dist/*.tar.gz
|
|
74
76
|
|
|
75
|
-
# Uploads use trusted publishing, so no tokens are stored;
|
|
76
|
-
#
|
|
77
|
-
publish-
|
|
77
|
+
# Uploads use trusted publishing, so no tokens are stored; PyPI trusts this workflow in the
|
|
78
|
+
# pypi environment, which needs approval
|
|
79
|
+
publish-pypi:
|
|
78
80
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
79
81
|
needs: [wheels, sdist]
|
|
80
82
|
runs-on: ubuntu-latest
|
|
81
83
|
environment:
|
|
82
|
-
name:
|
|
83
|
-
url: https://
|
|
84
|
+
name: pypi
|
|
85
|
+
url: https://pypi.org/project/immaculate/
|
|
84
86
|
permissions:
|
|
85
87
|
id-token: write
|
|
86
88
|
steps:
|
|
87
|
-
- uses: actions/download-artifact@
|
|
89
|
+
- uses: actions/download-artifact@v8
|
|
88
90
|
with:
|
|
91
|
+
pattern: immaculate-*
|
|
89
92
|
path: dist
|
|
90
93
|
merge-multiple: true
|
|
91
94
|
# PyPI never accepts a version twice, so a tag like v0.1.0-test mustn't upload 0.1.0
|
|
92
95
|
- name: Check the tag matches the version
|
|
93
96
|
run: test -f "dist/immaculate-${GITHUB_REF_NAME#v}.tar.gz"
|
|
94
|
-
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
runs-on: ubuntu-latest
|
|
102
|
-
environment:
|
|
103
|
-
name: pypi
|
|
104
|
-
url: https://pypi.org/project/immaculate/
|
|
105
|
-
permissions:
|
|
106
|
-
id-token: write
|
|
107
|
-
steps:
|
|
108
|
-
- uses: actions/download-artifact@v4
|
|
109
|
-
with:
|
|
110
|
-
path: dist
|
|
111
|
-
merge-multiple: true
|
|
97
|
+
# Otherwise installing the sscd extra would fail; release-onnx.yml publishes it
|
|
98
|
+
- name: Check the pinned immaculate-onnx is on PyPI
|
|
99
|
+
run: |
|
|
100
|
+
version=$(tar -xzOf dist/immaculate-*.tar.gz --wildcards '*/PKG-INFO' \
|
|
101
|
+
| sed -n 's/^Requires-Dist: immaculate-onnx==\([^ ;]*\).*/\1/p')
|
|
102
|
+
test -n "$version"
|
|
103
|
+
curl -fsS -o /dev/null "https://pypi.org/pypi/immaculate-onnx/$version/json"
|
|
112
104
|
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -46,9 +46,9 @@ checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
|
|
|
46
46
|
|
|
47
47
|
[[package]]
|
|
48
48
|
name = "crc32fast"
|
|
49
|
-
version = "1.5.
|
|
49
|
+
version = "1.5.5"
|
|
50
50
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
51
|
-
checksum = "
|
|
51
|
+
checksum = "2b929dd2a135771f40afabd1073f85eed59c800b7c61901e5c254270497dad64"
|
|
52
52
|
dependencies = [
|
|
53
53
|
"cfg-if",
|
|
54
54
|
]
|
|
@@ -107,9 +107,9 @@ dependencies = [
|
|
|
107
107
|
|
|
108
108
|
[[package]]
|
|
109
109
|
name = "flate2"
|
|
110
|
-
version = "1.1.
|
|
110
|
+
version = "1.1.11"
|
|
111
111
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
112
|
-
checksum = "
|
|
112
|
+
checksum = "626d4928326b646e70f65ed36fc7cf9f206bdb68a0019ee7c6b4709da4e084c4"
|
|
113
113
|
dependencies = [
|
|
114
114
|
"crc32fast",
|
|
115
115
|
"miniz_oxide 0.9.1",
|
|
@@ -174,7 +174,7 @@ dependencies = [
|
|
|
174
174
|
|
|
175
175
|
[[package]]
|
|
176
176
|
name = "immaculate"
|
|
177
|
-
version = "0.
|
|
177
|
+
version = "0.4.0"
|
|
178
178
|
dependencies = [
|
|
179
179
|
"image",
|
|
180
180
|
"ort",
|
|
@@ -192,9 +192,9 @@ checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
|
|
|
192
192
|
|
|
193
193
|
[[package]]
|
|
194
194
|
name = "libloading"
|
|
195
|
-
version = "0.9.
|
|
195
|
+
version = "0.9.1"
|
|
196
196
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
197
|
-
checksum = "
|
|
197
|
+
checksum = "a1832accd5a4ca2795ace4d05d15c4039be15b62d3b950eff99746a990e3cc10"
|
|
198
198
|
dependencies = [
|
|
199
199
|
"cfg-if",
|
|
200
200
|
"windows-link",
|
|
@@ -290,9 +290,9 @@ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
|
|
290
290
|
|
|
291
291
|
[[package]]
|
|
292
292
|
name = "ort"
|
|
293
|
-
version = "2.0.0-rc.
|
|
293
|
+
version = "2.0.0-rc.15"
|
|
294
294
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
295
|
-
checksum = "
|
|
295
|
+
checksum = "37c87aa7a90b7ff3e0fe36cccd475df8d67f15f07f4d6c370c4b38464232813c"
|
|
296
296
|
dependencies = [
|
|
297
297
|
"libloading",
|
|
298
298
|
"ndarray",
|
|
@@ -303,15 +303,15 @@ dependencies = [
|
|
|
303
303
|
|
|
304
304
|
[[package]]
|
|
305
305
|
name = "ort-sys"
|
|
306
|
-
version = "2.0.0-rc.
|
|
306
|
+
version = "2.0.0-rc.15"
|
|
307
307
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
308
|
-
checksum = "
|
|
308
|
+
checksum = "8d22b0417f1838db5a3ac0b3f98dfe39f6fb73624aa0a27c6bbb5040b9c7db2b"
|
|
309
309
|
|
|
310
310
|
[[package]]
|
|
311
311
|
name = "pin-project-lite"
|
|
312
|
-
version = "0.2.
|
|
312
|
+
version = "0.2.18"
|
|
313
313
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
314
|
-
checksum = "
|
|
314
|
+
checksum = "c938015719552d665fd0553b90d96cd7ff58e83e4c061ca99e6bb78865a72752"
|
|
315
315
|
|
|
316
316
|
[[package]]
|
|
317
317
|
name = "png"
|
|
@@ -398,7 +398,7 @@ dependencies = [
|
|
|
398
398
|
"proc-macro2",
|
|
399
399
|
"pyo3-macros-backend",
|
|
400
400
|
"quote",
|
|
401
|
-
"syn 3.0.
|
|
401
|
+
"syn 3.0.10",
|
|
402
402
|
]
|
|
403
403
|
|
|
404
404
|
[[package]]
|
|
@@ -410,7 +410,7 @@ dependencies = [
|
|
|
410
410
|
"heck",
|
|
411
411
|
"proc-macro2",
|
|
412
412
|
"quote",
|
|
413
|
-
"syn 3.0.
|
|
413
|
+
"syn 3.0.10",
|
|
414
414
|
]
|
|
415
415
|
|
|
416
416
|
[[package]]
|
|
@@ -471,9 +471,9 @@ checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea"
|
|
|
471
471
|
|
|
472
472
|
[[package]]
|
|
473
473
|
name = "smallvec"
|
|
474
|
-
version = "1.16.
|
|
474
|
+
version = "1.16.6"
|
|
475
475
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
476
|
-
checksum = "
|
|
476
|
+
checksum = "3244542535d5de959d90ec55d1b5ff0fd2bb7b1310223907d5f11932847f7b59"
|
|
477
477
|
|
|
478
478
|
[[package]]
|
|
479
479
|
name = "syn"
|
|
@@ -488,9 +488,9 @@ dependencies = [
|
|
|
488
488
|
|
|
489
489
|
[[package]]
|
|
490
490
|
name = "syn"
|
|
491
|
-
version = "3.0.
|
|
491
|
+
version = "3.0.10"
|
|
492
492
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
493
|
-
checksum = "
|
|
493
|
+
checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
|
|
494
494
|
dependencies = [
|
|
495
495
|
"proc-macro2",
|
|
496
496
|
"quote",
|
|
@@ -499,9 +499,9 @@ dependencies = [
|
|
|
499
499
|
|
|
500
500
|
[[package]]
|
|
501
501
|
name = "target-lexicon"
|
|
502
|
-
version = "0.13.
|
|
502
|
+
version = "0.13.6"
|
|
503
503
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
504
|
-
checksum = "
|
|
504
|
+
checksum = "8c447be3a2abfa84b2d91680c56600bd6b2873866de27b36ec911be705e291da"
|
|
505
505
|
|
|
506
506
|
[[package]]
|
|
507
507
|
name = "tiff"
|
|
@@ -584,9 +584,9 @@ dependencies = [
|
|
|
584
584
|
|
|
585
585
|
[[package]]
|
|
586
586
|
name = "xxhash-rust"
|
|
587
|
-
version = "0.8.
|
|
587
|
+
version = "0.8.21"
|
|
588
588
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
589
|
-
checksum = "
|
|
589
|
+
checksum = "40de123dbb523ebcc00d61ec01840ad192578afc378d859f3429caa38308fad5"
|
|
590
590
|
|
|
591
591
|
[[package]]
|
|
592
592
|
name = "zerocopy"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "immaculate"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.4.0"
|
|
4
4
|
edition = "2024"
|
|
5
5
|
license-file = "LICENSE"
|
|
6
6
|
publish = false
|
|
@@ -13,9 +13,9 @@ crate-type = ["cdylib"]
|
|
|
13
13
|
|
|
14
14
|
[dependencies]
|
|
15
15
|
image = { version = "0.25.10", default-features = false, features = ["bmp", "gif", "jpeg", "png", "tiff", "webp"] }
|
|
16
|
-
# ONNX Runtime is loaded at runtime from the onnxruntime Python package,
|
|
17
|
-
# the wheel. Without the api-* features ort needs only ONNX Runtime 1.17 or later.
|
|
18
|
-
ort = { version = "=2.0.0-rc.
|
|
16
|
+
# ONNX Runtime is loaded at runtime from the onnxruntime Python package, which the sscd extra
|
|
17
|
+
# installs, so it isn't built into the wheel. Without the api-* features ort needs only ONNX Runtime 1.17 or later.
|
|
18
|
+
ort = { version = "=2.0.0-rc.15", default-features = false, features = ["load-dynamic", "std"] }
|
|
19
19
|
pyo3 = { version = "0.30.1", features = ["abi3-py312"] }
|
|
20
20
|
rayon = "1.12.0"
|
|
21
21
|
walkdir = "2.5.0"
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: Immaculate
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Classifier: Programming Language :: Python :: 3
|
|
5
|
+
Requires-Dist: immaculate-onnx==0.2.0 ; extra == 'sscd'
|
|
6
|
+
Requires-Dist: onnxruntime>=1.17 ; extra == 'sscd'
|
|
7
|
+
Provides-Extra: sscd
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Summary: Find problematic images fast.
|
|
10
|
+
Author: Peter Batchelor
|
|
11
|
+
License-Expression: LicenseRef-Proprietary
|
|
12
|
+
Requires-Python: >=3.12
|
|
13
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
14
|
+
Project-URL: Documentation, https://pbatch.github.io/Immaculate/
|
|
15
|
+
Project-URL: Issues, https://github.com/Pbatch/Immaculate/issues
|
|
16
|
+
Project-URL: Repository, https://github.com/Pbatch/Immaculate
|
|
17
|
+
|
|
18
|
+
# Immaculate
|
|
19
|
+
|
|
20
|
+
[](https://pypi.org/project/immaculate/)
|
|
21
|
+
[](https://pypi.org/project/immaculate/)
|
|
22
|
+
[](https://github.com/Pbatch/Immaculate/actions/workflows/ci.yml)
|
|
23
|
+
[](https://pbatch.github.io/Immaculate/)
|
|
24
|
+
|
|
25
|
+
Find problematic images fast.
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install immaculate
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+

|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
from immaculate import Blurry, NearDuplicates, find_issues
|
|
39
|
+
|
|
40
|
+
issues = find_issues("photos/")
|
|
41
|
+
issues.near_duplicates # [[PosixPath('photos/robin.jpg'), PosixPath('photos/robin_edited.jpg')]]
|
|
42
|
+
issues.blurry # [PosixPath('photos/goldfinch.jpg')], and likewise for each check below
|
|
43
|
+
issues.truncated # [PosixPath('photos/great_tit.jpg')]
|
|
44
|
+
|
|
45
|
+
issues = find_issues("photos/", [NearDuplicates(), Blurry()]) # only some checks
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Or from the command line:
|
|
49
|
+
|
|
50
|
+
```console
|
|
51
|
+
$ immaculate photos/ --issues near_duplicates blurry
|
|
52
|
+
Near duplicates: 1 set
|
|
53
|
+
|
|
54
|
+
photos/robin.jpg
|
|
55
|
+
photos/robin_edited.jpg
|
|
56
|
+
|
|
57
|
+
Blurry: 1 image
|
|
58
|
+
photos/goldfinch.jpg
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Checks
|
|
62
|
+
|
|
63
|
+
| Check | On the command line | Finds | Settings (defaults) |
|
|
64
|
+
|---|---|---|---|
|
|
65
|
+
| `ExactDuplicates` | `exact_duplicates` | Images with identical pixels, even if saved with different metadata or in another lossless format | |
|
|
66
|
+
| `NearDuplicates` | `near_duplicates` | Resized, recompressed, flipped and rotated copies; see [methods](https://pbatch.github.io/Immaculate/checks/#near-duplicates) | `method` (`"pdq"`) |
|
|
67
|
+
| `Dark` | `dark` | Images that are almost all dark | `brightness` (0.32), `fraction` (0.01) |
|
|
68
|
+
| `Light` | `light` | Images that are almost all light | `brightness` (0.95), `fraction` (0.05) |
|
|
69
|
+
| `Blurry` | `blurry` | Blurry images | `sharpness` (5.0) |
|
|
70
|
+
| `LowInformation` | `low_information` | Images with few distinct colors, such as blank ones | `entropy` (3.0) |
|
|
71
|
+
| `OddAspectRatio` | `odd_aspect_ratio` | Unusually long or tall images | `ratio` (0.35) |
|
|
72
|
+
| `OddSize` | `odd_size` | Images much larger or smaller than the others | `iqr_factor` (3.0) |
|
|
73
|
+
| `Grayscale` | `grayscale` | Grayscale images, including color files whose pixels are all gray | `tolerance` (2) |
|
|
74
|
+
| `LowContrast` | `low_contrast` | Washed-out, foggy or otherwise flat-looking images | `contrast` (0.05) |
|
|
75
|
+
| `Truncated` | `truncated` | Images whose files end early, such as interrupted downloads, which often still decode with a gray patch | |
|
|
76
|
+
|
|
77
|
+
Pass each check with its settings, such as `Dark(brightness=0.2)`, or `Dark()` for the defaults.
|
|
78
|
+
|
|
79
|
+
See [checks](https://pbatch.github.io/Immaculate/checks/) for what each setting does.
|
|
80
|
+
|
|
81
|
+
## Benchmarks
|
|
82
|
+
|
|
83
|
+
Every check CleanVision has, run together on 250 images of [INRIA Copydays](https://thoth.inrialpes.fr/~jegou/data.php.html#copydays):
|
|
84
|
+
|
|
85
|
+
| | Time | Peak memory | Images flagged |
|
|
86
|
+
|---|---:|---:|---:|
|
|
87
|
+
| Immaculate | **0.73 s** | **387 MiB** | 12 |
|
|
88
|
+
| CleanVision | 14.12 s | 2,974 MiB | 12 |
|
|
89
|
+
|
|
90
|
+
See the [benchmarks](https://pbatch.github.io/Immaculate/benchmarks/) for how this was run, and for comparisons with other libraries.
|
|
91
|
+
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Immaculate
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/immaculate/)
|
|
4
|
+
[](https://pypi.org/project/immaculate/)
|
|
5
|
+
[](https://github.com/Pbatch/Immaculate/actions/workflows/ci.yml)
|
|
6
|
+
[](https://pbatch.github.io/Immaculate/)
|
|
7
|
+
|
|
8
|
+
Find problematic images fast.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install immaculate
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
from immaculate import Blurry, NearDuplicates, find_issues
|
|
22
|
+
|
|
23
|
+
issues = find_issues("photos/")
|
|
24
|
+
issues.near_duplicates # [[PosixPath('photos/robin.jpg'), PosixPath('photos/robin_edited.jpg')]]
|
|
25
|
+
issues.blurry # [PosixPath('photos/goldfinch.jpg')], and likewise for each check below
|
|
26
|
+
issues.truncated # [PosixPath('photos/great_tit.jpg')]
|
|
27
|
+
|
|
28
|
+
issues = find_issues("photos/", [NearDuplicates(), Blurry()]) # only some checks
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Or from the command line:
|
|
32
|
+
|
|
33
|
+
```console
|
|
34
|
+
$ immaculate photos/ --issues near_duplicates blurry
|
|
35
|
+
Near duplicates: 1 set
|
|
36
|
+
|
|
37
|
+
photos/robin.jpg
|
|
38
|
+
photos/robin_edited.jpg
|
|
39
|
+
|
|
40
|
+
Blurry: 1 image
|
|
41
|
+
photos/goldfinch.jpg
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Checks
|
|
45
|
+
|
|
46
|
+
| Check | On the command line | Finds | Settings (defaults) |
|
|
47
|
+
|---|---|---|---|
|
|
48
|
+
| `ExactDuplicates` | `exact_duplicates` | Images with identical pixels, even if saved with different metadata or in another lossless format | |
|
|
49
|
+
| `NearDuplicates` | `near_duplicates` | Resized, recompressed, flipped and rotated copies; see [methods](https://pbatch.github.io/Immaculate/checks/#near-duplicates) | `method` (`"pdq"`) |
|
|
50
|
+
| `Dark` | `dark` | Images that are almost all dark | `brightness` (0.32), `fraction` (0.01) |
|
|
51
|
+
| `Light` | `light` | Images that are almost all light | `brightness` (0.95), `fraction` (0.05) |
|
|
52
|
+
| `Blurry` | `blurry` | Blurry images | `sharpness` (5.0) |
|
|
53
|
+
| `LowInformation` | `low_information` | Images with few distinct colors, such as blank ones | `entropy` (3.0) |
|
|
54
|
+
| `OddAspectRatio` | `odd_aspect_ratio` | Unusually long or tall images | `ratio` (0.35) |
|
|
55
|
+
| `OddSize` | `odd_size` | Images much larger or smaller than the others | `iqr_factor` (3.0) |
|
|
56
|
+
| `Grayscale` | `grayscale` | Grayscale images, including color files whose pixels are all gray | `tolerance` (2) |
|
|
57
|
+
| `LowContrast` | `low_contrast` | Washed-out, foggy or otherwise flat-looking images | `contrast` (0.05) |
|
|
58
|
+
| `Truncated` | `truncated` | Images whose files end early, such as interrupted downloads, which often still decode with a gray patch | |
|
|
59
|
+
|
|
60
|
+
Pass each check with its settings, such as `Dark(brightness=0.2)`, or `Dark()` for the defaults.
|
|
61
|
+
|
|
62
|
+
See [checks](https://pbatch.github.io/Immaculate/checks/) for what each setting does.
|
|
63
|
+
|
|
64
|
+
## Benchmarks
|
|
65
|
+
|
|
66
|
+
Every check CleanVision has, run together on 250 images of [INRIA Copydays](https://thoth.inrialpes.fr/~jegou/data.php.html#copydays):
|
|
67
|
+
|
|
68
|
+
| | Time | Peak memory | Images flagged |
|
|
69
|
+
|---|---:|---:|---:|
|
|
70
|
+
| Immaculate | **0.73 s** | **387 MiB** | 12 |
|
|
71
|
+
| CleanVision | 14.12 s | 2,974 MiB | 12 |
|
|
72
|
+
|
|
73
|
+
See the [benchmarks](https://pbatch.github.io/Immaculate/benchmarks/) for how this was run, and for comparisons with other libraries.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# API reference
|
|
2
|
+
|
|
3
|
+
::: immaculate.find_issues
|
|
4
|
+
options:
|
|
5
|
+
heading_level: 2
|
|
6
|
+
|
|
7
|
+
::: immaculate
|
|
8
|
+
options:
|
|
9
|
+
show_root_heading: false
|
|
10
|
+
members:
|
|
11
|
+
- Issues
|
|
12
|
+
- IssueName
|
|
13
|
+
- Check
|
|
14
|
+
- ExactDuplicates
|
|
15
|
+
- NearDuplicates
|
|
16
|
+
- Method
|
|
17
|
+
- Dark
|
|
18
|
+
- Light
|
|
19
|
+
- Blurry
|
|
20
|
+
- LowInformation
|
|
21
|
+
- OddAspectRatio
|
|
22
|
+
- OddSize
|
|
23
|
+
- Grayscale
|
|
24
|
+
- LowContrast
|
|
25
|
+
- Truncated
|