From d611adff32ade89d8ce7fcf716932de90ff54a6f Mon Sep 17 00:00:00 2001 From: 4o3F <4o3f@proton.me> Date: Wed, 15 Jan 2025 22:55:28 +0800 Subject: [PATCH] fix: fix split images with filter channel issue --- src/common/augment.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/augment.rs b/src/common/augment.rs index fd41104..267be63 100644 --- a/src/common/augment.rs +++ b/src/common/augment.rs @@ -719,9 +719,11 @@ pub async fn split_images_with_filter( let _ = permit.acquire().await.unwrap(); tracing::info!("Processing {}", entry.file_name().unwrap().to_str().unwrap()); let label_id = entry.file_stem().unwrap().to_str().unwrap().to_string(); - let img = imgcodecs::imread(entry.to_str().unwrap(), imgcodecs::IMREAD_UNCHANGED) + let img = imgcodecs::imread(entry.to_str().unwrap(), imgcodecs::IMREAD_COLOR) .unwrap(); + + let size = img.size().unwrap(); let (width, height) = (size.width, size.height); let y_count = height / target_height as i32;