Skip to content

Commit

Permalink
fix: add explicit import tracing_unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
4o3F committed Sep 11, 2024
1 parent 3a08a9c commit 32e9e0e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/common/dataset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ use std::{

use opencv::{core::{self, MatTraitConst}, imgcodecs};
use tokio::{sync::Semaphore, task::JoinSet};
use tracing_unwrap::OptionExt;


pub async fn split_dataset(dataset_path: &String, train_ratio: &f32) {
let entries = fs::read_dir(dataset_path).unwrap();
Expand Down
1 change: 1 addition & 0 deletions src/common/operation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use image::imageops::FilterType;
use opencv::{core, core::MatTraitConst, imgcodecs};
use std::{fs, io::Cursor, sync::Arc};
use tokio::{fs::File, io::AsyncWriteExt, sync::Semaphore, task::JoinSet};
use tracing_unwrap::OptionExt;

pub async fn resize_images(
dataset_path: &String,
Expand Down
4 changes: 2 additions & 2 deletions src/common/remap.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use image::{GrayImage, Luma, Rgb, RgbImage};
use std::{
collections::HashMap,
fs,
ops::Deref,
sync::{Arc, RwLock},
};

use image::{GrayImage, Luma, Rgb, RgbImage};
use tokio::{sync::Semaphore, task::JoinSet};
use tracing_unwrap::OptionExt;

pub fn remap_color(original_color: &str, new_color: &str, image_path: &String, save_path: &String) {
let mut original_color_vec: Vec<u8> = vec![];
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use clap::{Parser, Subcommand};
use common::operation::EdgePosition;
use tracing::Level;
use tracing_unwrap::ResultExt;
use tracing_unwrap::{OptionExt, ResultExt};

mod common;
mod yolo;
Expand Down
1 change: 1 addition & 0 deletions src/yolo/dataset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::{

use itertools::Itertools;
use tokio::{sync::Semaphore, task::JoinSet};
use tracing_unwrap::OptionExt;

pub async fn split_dataset(dataset_path: &String) {
let entries = fs::read_dir(dataset_path).unwrap();
Expand Down

0 comments on commit 32e9e0e

Please sign in to comment.