diff --git a/Cargo.toml b/Cargo.toml index 93ac94f..980d566 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "usls" -version = "0.0.5" +version = "0.0.6" edition = "2021" description = "A Rust library integrated with ONNXRuntime, providing a collection of ML models." repository = "https://github.com/jamjamjon/usls" @@ -38,7 +38,7 @@ walkdir = { version = "2.5.0" } tokenizers = { version = "0.15.2" } rayon = "1.10.0" indicatif = "0.17.8" -image = "0.25.1" +image = "0.25.2" imageproc = { version = "0.24" } ab_glyph = "0.2.23" geo = "0.28.0" diff --git a/src/core/dataloader.rs b/src/core/dataloader.rs index c94fcc4..e7bb444 100644 --- a/src/core/dataloader.rs +++ b/src/core/dataloader.rs @@ -92,7 +92,7 @@ impl DataLoader { } pub fn try_read>(path: P) -> Result { - let img = image::io::Reader::open(&path) + let img = image::ImageReader::open(&path) .map_err(|_| anyhow!("Failed to open image at {:?}", path.as_ref()))? .decode() .map_err(|_| anyhow!("Failed to decode image at {:?}", path.as_ref()))? diff --git a/src/core/ops.rs b/src/core/ops.rs index d617647..da4341f 100644 --- a/src/core/ops.rs +++ b/src/core/ops.rs @@ -223,7 +223,7 @@ impl Ops<'_> { let (mut resizer, options) = Self::build_resizer_filter(filter)?; for (idx, x) in xs.iter().enumerate() { let buffer = if x.dimensions() == (width, height) { - x.to_rgba8().into_raw() + x.to_rgb8().into_raw() } else { let mut dst_image = Image::new(width, height, PixelType::U8x3); resizer.resize(x, &mut dst_image, &options)?; @@ -251,7 +251,7 @@ impl Ops<'_> { for (idx, x) in xs.iter().enumerate() { let (w0, h0) = x.dimensions(); let buffer = if w0 == width && h0 == height { - x.to_rgba8().into_raw() + x.to_rgb8().into_raw() } else { let (w, h) = match resize_by { "auto" => {