Skip to content

Commit 20f45ae

Browse files
committed
Refactors to a simplified, single-process image processing model
Revamps the image processing pipeline from a distributed, asynchronous, queue-based architecture to a synchronous, direct file processing approach. This significantly simplifies the codebase by: - Removing complex components for batching, worker pools, and message queues. - Streamlining ONNX model loading and inference, removing dedicated batch processing at the model level. - Consolidating input file discovery from `walkdir` to glob patterns. - Reducing external dependencies such as `tokio`, `rayon`, `async-trait`, and `serde`. - Simplifying configuration options and error handling, removing distributed-specific settings and retry logic. The model now processes images sequentially within a single thread, utilizing `fast_image_resize` and `imageops-kit` for robust image manipulation. This improves maintainability and reduces operational overhead.
1 parent bb027f6 commit 20f45ae

16 files changed

Lines changed: 273 additions & 3459 deletions

Cargo.lock

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

Cargo.toml

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ keywords = [
2020
default = ["image"]
2121

2222
# ort execution providers
23-
cuda = ["ort/cuda", "ort/copy-dylibs"]
24-
tensorrt = ["ort/tensorrt", "ort/cuda", "ort/copy-dylibs"]
23+
cuda = ["ort/cuda"]
2524

2625
# image processing
2726
image = ["image/jpeg", "image/png", "image/webp"]
@@ -31,36 +30,16 @@ image-avif = ["image/avif"]
3130

3231
[dependencies]
3332
anyhow = "1"
34-
async-trait = "0.1"
35-
chrono = { version = "0.4", features = ["serde"] }
3633
clap = { version = "4.5.51", features = ["derive"] }
34+
fast_image_resize = { version = "5.3.0", features = ["image"] }
35+
glob = "0.3"
3736
image = { version = "0.25", default-features = false }
3837
imageops-kit = { git = "https://github.com/nusu-github/imageops-kit", version = "0.1.0" }
3938
imageproc = { version = "0.25", default-features = false }
4039
indicatif = "0.18"
4140
ndarray = "0.16.1"
4241
ort = "2.0.0-rc.10"
43-
parking_lot = { version = "0.12", features = ["hardware-lock-elision"] }
44-
rayon = "1.11"
45-
serde = { version = "1.0", features = ["derive"] }
4642
thiserror = "2.0"
47-
tokio = { version = "1", features = ["full"] }
48-
tokio-util = { version = "0.7", features = ["rt"] }
49-
uuid = { version = "1.18", features = ["v4", "serde"] }
50-
walkdir = "2.5"
5143

52-
[dev-dependencies]
53-
tempfile = "3.23"
54-
55-
[profile.release]
56-
opt-level = 3
57-
lto = "fat"
58-
codegen-units = 1
59-
panic = "abort"
60-
61-
[profile.release.package."*"]
62-
opt-level = 3
63-
64-
# 開発時の高速化
6544
[profile.dev]
6645
opt-level = 1

0 commit comments

Comments
 (0)