Skip to content

Commit 1d496d8

Browse files
authored
Merge pull request #17 from aastopher/stage
cannot have spaces
2 parents cf4cb6c + 199b767 commit 1d496d8

File tree

12 files changed

+205
-20
lines changed

12 files changed

+205
-20
lines changed

.github/workflows/benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- name: Checkout code
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626

2727
- name: Set up Python
2828
uses: actions/setup-python@v4

.github/workflows/release-python.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
python -c 'import imgdd'
108108
109109
- name: Upload sdist artifact
110-
uses: actions/upload-artifact@v3
110+
uses: actions/upload-artifact@v4
111111
with:
112112
name: sdist
113113
path: target/wheels/*.tar.gz
@@ -147,7 +147,7 @@ jobs:
147147

148148
steps:
149149
- name: Checkout code
150-
uses: actions/checkout@v3
150+
uses: actions/checkout@v4
151151

152152
- name: Install Rust
153153
uses: actions-rs/toolchain@v1
@@ -185,7 +185,7 @@ jobs:
185185
ls -l target/wheels/
186186
187187
- name: Upload wheel artifact
188-
uses: actions/upload-artifact@v3
188+
uses: actions/upload-artifact@v4
189189
with:
190190
name: wheels
191191
path: target/wheels/*.whl
@@ -200,7 +200,7 @@ jobs:
200200
if: ${{ !inputs.dry-run }}
201201
steps:
202202
- name: Download all artifacts
203-
uses: actions/download-artifact@v3
203+
uses: actions/download-artifact@v4
204204
with:
205205
path: root
206206

@@ -224,7 +224,7 @@ jobs:
224224
if: ${{ inputs.dry-run }}
225225
steps:
226226
- name: Download all artifacts
227-
uses: actions/download-artifact@v3
227+
uses: actions/download-artifact@v4
228228
with:
229229
path: root
230230

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ repository = "https://github.com/aastopher/imgdd"
1616
documentation = "https://github.com/aastopher/imgdd"
1717
homepage = "https://github.com/aastopher/imgdd"
1818

19-
keywords = ["imagehash", "hash", "perceptual hash", "deduplication", "image deduplication"]
19+
keywords = ["imagehash", "hash", "perceptual", "deduplication", "wavelet"]
2020
readme = "./README.md"
21-
categories = ["image-processing", "utilities", "image-hash", "hashing"]
21+
categories = ["algorithms", "computer-vision", "data-structures", "mathematics"]
22+
23+
2224

2325

2426
[workspace.dependencies]

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[![imgdd pypi](https://img.shields.io/pypi/v/imgdd?label=imgdd%20pypi)](https://pypi.org/project/imgdd)
2+
[![imgdd crate](https://img.shields.io/crates/v/imgdd?label=imgdd)](https://crates.io/crates/imgdd)
3+
[![imgddcore crate](https://img.shields.io/crates/v/imgddcore?label=imgddcore)](https://crates.io/crates/imgddcore)
14
[![codecov](https://codecov.io/gh/aastopher/imgdd/graph/badge.svg?token=XZ1O2X04SO)](https://codecov.io/gh/aastopher/imgdd)
25
[![Documentation Status](https://img.shields.io/badge/docs-online-brightgreen)](https://aastopher.github.io/imgdd/)
36
[![DeepSource](https://app.deepsource.com/gh/aastopher/imgdd.svg/?label=active+issues&show_trend=true&token=IiuhCO6n1pK-GAJ800k6Z_9t)](https://app.deepsource.com/gh/aastopher/imgdd/)

crates/imgdd/Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "imgdd"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
edition.workspace = true
55
license.workspace = true
66
authors.workspace = true
@@ -9,12 +9,11 @@ repository.workspace = true
99
documentation.workspace = true
1010
homepage.workspace = true
1111
keywords.workspace = true
12-
readme.workspace = true
1312
categories.workspace = true
14-
13+
readme = "README.md"
1514

1615
[dependencies]
17-
imgddcore = { path = "../imgddcore", version = "0.1.0" }
16+
imgddcore = { path = "../imgddcore", version = "0.1.1" }
1817
image.workspace = true
1918
anyhow.workspace = true
2019
criterion = { version = "0.5.1", optional = true }

crates/imgdd/README.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
[![codecov](https://codecov.io/gh/aastopher/imgdd/graph/badge.svg?token=XZ1O2X04SO)](https://codecov.io/gh/aastopher/imgdd)
2+
[![Documentation Status](https://img.shields.io/badge/docs-online-brightgreen)](https://aastopher.github.io/imgdd/)
3+
[![DeepSource](https://app.deepsource.com/gh/aastopher/imgdd.svg/?label=active+issues&show_trend=true&token=IiuhCO6n1pK-GAJ800k6Z_9t)](https://app.deepsource.com/gh/aastopher/imgdd/)
4+
5+
# imgdd: Image DeDuplication
6+
7+
`imgdd` is a performance-first perceptual hashing library that combines Rust's speed with Python's accessibility, making it perfect for handling large datasets. Designed to quickly process nested folder structures, commonly found in image datasets.
8+
9+
## Features
10+
- **Multiple Hashing Algorithms**: Supports `aHash`, `dHash`, `mHash`, `pHash`, `wHash`.
11+
- **Multiple Filter Types**: Supports `Nearest`, `Triangle`, `CatmullRom`, `Gaussian`, `Lanczos3`.
12+
- **Identify Duplicates**: Quickly identify duplicate hash pairs.
13+
- **Simplicity**: Simple interface, robust performance.
14+
15+
## Why imgdd?
16+
17+
`imgdd` has been inspired by [imagehash](https://github.com/JohannesBuchner/imagehash) and aims to be a lightning-fast replacement with additional features. To ensure enhanced performance, `imgdd` has been benchmarked against `imagehash`. In Python, **imgdd consistently outperforms imagehash by ~60%–95%**, demonstrating a significant reduction in hashing time per image.
18+
19+
---
20+
21+
# Quick Start
22+
23+
## Installation
24+
25+
```bash
26+
pip install imgdd
27+
```
28+
29+
## Usage Examples
30+
31+
### Hash Images
32+
33+
```rust
34+
use imgdd::*;
35+
use std::path::PathBuf;
36+
37+
let result = hash(
38+
PathBuf::from("path/to/images"),
39+
Some("Triangle"), // Optional: default = "Triangle"
40+
Some("dHash"), // Optional: default = "dHash"
41+
Some(false), // Optional: default = false
42+
);
43+
println!("{:#?}", result);
44+
```
45+
46+
### Find Duplicates
47+
48+
```rust
49+
use imgdd::*;
50+
use std::path::PathBuf;
51+
52+
let result = dupes(
53+
PathBuf::from("path/to/images"),
54+
Some("Triangle"), // Optional: default = "Triangle"
55+
Some("dHash"), // Optional: default = "dHash"
56+
false,
57+
);
58+
println!("{:#?}", result);
59+
```(duplicates)
60+
```
61+
62+
## Supported Algorithms
63+
- **aHash**: Average Hash
64+
- **mHash**: Median Hash
65+
- **dHash**: Difference Hash
66+
- **pHash**: Perceptual Hash
67+
- **wHash**: Wavelet Hash
68+
69+
## Supported Filters
70+
- `Nearest`, `Triangle`, `CatmullRom`, `Gaussian`, `Lanczos3`
71+
72+
## Contributing
73+
Contributions are always welcome! 🚀
74+
75+
Found a bug or have a question? Open a GitHub issue. Pull requests for new features or fixes are encouraged!
76+
77+
## Similar projects
78+
- https://github.com/JohannesBuchner/imagehash
79+
- https://github.com/commonsmachinery/blockhash-python
80+
- https://github.com/acoomans/instagram-filters
81+
- https://pippy360.github.io/transformationInvariantImageSearch/
82+
- https://www.phash.org/
83+
- https://pypi.org/project/dhash/
84+
- https://github.com/thorn-oss/perception (based on imagehash code, depends on opencv)
85+
- https://docs.opencv.org/3.4/d4/d93/group__img__hash.html

crates/imgddcore/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
[package]
22
name = "imgddcore"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
edition.workspace = true
55
license.workspace = true
66
authors.workspace = true
77
description.workspace = true
88
repository.workspace = true
99
documentation.workspace = true
1010
homepage.workspace = true
11+
keywords.workspace = true
12+
categories.workspace = true
1113
readme = "README.md"
1214

1315
[dependencies]

crates/imgddpy/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "imgddpy"
3-
version = "0.1.0"
3+
version = "0.1.3"
44
edition.workspace = true
55
license.workspace = true
66
authors.workspace = true
@@ -9,9 +9,10 @@ description.workspace = true
99
repository.workspace = true
1010
documentation.workspace = true
1111
homepage.workspace = true
12+
readme = "README.md"
1213

1314
[dependencies]
14-
imgddcore = { path = "../imgddcore", version = "0.1.0" }
15+
imgddcore = { path = "../imgddcore", version = "0.1.1" }
1516
pyo3 = { version = "0.23", features = ["extension-module", "abi3-py39"] }
1617
image.workspace = true
1718

crates/imgddpy/README.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
[![imgdd pypi](https://img.shields.io/pypi/v/imgdd?label=imgdd%20pypi)](https://pypi.org/project/imgdd)
2+
[![imgdd crate](https://img.shields.io/crates/v/imgdd?label=imgdd)](https://crates.io/crates/imgdd)
3+
[![imgddcore crate](https://img.shields.io/crates/v/imgddcore?label=imgddcore)](https://crates.io/crates/imgddcore)
4+
[![codecov](https://codecov.io/gh/aastopher/imgdd/graph/badge.svg?token=XZ1O2X04SO)](https://codecov.io/gh/aastopher/imgdd)
5+
[![Documentation Status](https://img.shields.io/badge/docs-online-brightgreen)](https://aastopher.github.io/imgdd/)
6+
[![DeepSource](https://app.deepsource.com/gh/aastopher/imgdd.svg/?label=active+issues&show_trend=true&token=IiuhCO6n1pK-GAJ800k6Z_9t)](https://app.deepsource.com/gh/aastopher/imgdd/)
7+
8+
# imgdd: Image DeDuplication
9+
10+
`imgdd` is a performance-first perceptual hashing library that combines Rust's speed with Python's accessibility, making it perfect for handling large datasets. Designed to quickly process nested folder structures, commonly found in image datasets.
11+
12+
## Features
13+
- **Multiple Hashing Algorithms**: Supports `aHash`, `dHash`, `mHash`, `pHash`, `wHash`.
14+
- **Multiple Filter Types**: Supports `Nearest`, `Triangle`, `CatmullRom`, `Gaussian`, `Lanczos3`.
15+
- **Identify Duplicates**: Quickly identify duplicate hash pairs.
16+
- **Simplicity**: Simple interface, robust performance.
17+
18+
## Why imgdd?
19+
20+
`imgdd` has been inspired by [imagehash](https://github.com/JohannesBuchner/imagehash) and aims to be a lightning-fast replacement with additional features. To ensure enhanced performance, `imgdd` has been benchmarked against `imagehash`. In Python, **imgdd consistently outperforms imagehash by ~60%–95%**, demonstrating a significant reduction in hashing time per image.
21+
22+
---
23+
24+
# Quick Start
25+
26+
## Installation
27+
28+
```bash
29+
pip install imgdd
30+
```
31+
32+
## Usage Examples
33+
34+
### Hash Images
35+
36+
```python
37+
import imgdd as dd
38+
39+
results = dd.hash(
40+
path="path/to/images",
41+
algo="dhash", # Optional: default = dhash
42+
filter="triangle" # Optional: default = triangle
43+
sort=False # Optional: default = False
44+
)
45+
print(results)
46+
```
47+
48+
### Find Duplicates
49+
50+
```python
51+
import imgdd as dd
52+
53+
duplicates = dd.dupes(
54+
path="path/to/images",
55+
algo="dhash", # Optional: default = dhash
56+
filter="triangle", # Optional: default = triangle
57+
remove=False # Optional: default = False
58+
)
59+
print(duplicates)
60+
```
61+
62+
## Supported Algorithms
63+
- **aHash**: Average Hash
64+
- **mHash**: Median Hash
65+
- **dHash**: Difference Hash
66+
- **pHash**: Perceptual Hash
67+
- **wHash**: Wavelet Hash
68+
69+
## Supported Filters
70+
- `Nearest`, `Triangle`, `CatmullRom`, `Gaussian`, `Lanczos3`
71+
72+
## Contributing
73+
Contributions are always welcome! 🚀
74+
75+
Found a bug or have a question? Open a GitHub issue. Pull requests for new features or fixes are encouraged!
76+
77+
## Similar projects
78+
- https://github.com/JohannesBuchner/imagehash
79+
- https://github.com/commonsmachinery/blockhash-python
80+
- https://github.com/acoomans/instagram-filters
81+
- https://pippy360.github.io/transformationInvariantImageSearch/
82+
- https://www.phash.org/
83+
- https://pypi.org/project/dhash/
84+
- https://github.com/thorn-oss/perception (based on imagehash code, depends on opencv)
85+
- https://docs.opencv.org/3.4/d4/d93/group__img__hash.html

0 commit comments

Comments
 (0)