fmt
This commit is contained in:
parent
3be68fcccf
commit
ebdbe13f26
4 changed files with 24 additions and 17 deletions
|
|
@ -70,7 +70,9 @@ struct Args {
|
|||
#[show_image::main]
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
fmt()
|
||||
.with_env_filter(EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info")))
|
||||
.with_env_filter(
|
||||
EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info")),
|
||||
)
|
||||
.with_writer(std::io::stderr)
|
||||
.init();
|
||||
|
||||
|
|
@ -113,8 +115,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||
|
||||
if debug {
|
||||
debug_mode(&img, &result_rgba)?;
|
||||
}
|
||||
|
||||
} else {
|
||||
if let Some(output_file) = output_file {
|
||||
result_rgba.save(&output_file)?;
|
||||
info!(path = %output_file.display(), "Wrote output image to file");
|
||||
|
|
@ -126,6 +127,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||
stdout.write_all(&buffer.into_inner())?;
|
||||
}
|
||||
}
|
||||
}
|
||||
Command::Batch {
|
||||
input_directory,
|
||||
output_directory,
|
||||
|
|
|
|||
|
|
@ -68,7 +68,12 @@ fn download_file(url: &str, dest: &Path) -> Result<(), Box<dyn Error>> {
|
|||
// Only emit every 10% to avoid log spam while still giving feedback.
|
||||
if progress >= last_reported_pct + 10 {
|
||||
last_reported_pct = progress - (progress % 10);
|
||||
debug!(percent = last_reported_pct, downloaded, total = total_size, "Download progress");
|
||||
debug!(
|
||||
percent = last_reported_pct,
|
||||
downloaded,
|
||||
total = total_size,
|
||||
"Download progress"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,10 +16,7 @@ pub fn apply_mask(original: &DynamicImage, mask: &GrayImage) -> Result<RgbaImage
|
|||
if mask_width != orig_width || mask_height != orig_height {
|
||||
debug!(
|
||||
mask_width,
|
||||
mask_height,
|
||||
orig_width,
|
||||
orig_height,
|
||||
"Resizing mask to match original image"
|
||||
mask_height, orig_width, orig_height, "Resizing mask to match original image"
|
||||
);
|
||||
std::borrow::Cow::Owned(image::imageops::resize(
|
||||
mask,
|
||||
|
|
|
|||
|
|
@ -109,7 +109,10 @@ pub trait Session {
|
|||
|
||||
let preprocess_start = Instant::now();
|
||||
let input = self.normalize(img)?;
|
||||
debug!(elapsed_ms = preprocess_start.elapsed().as_millis() as u64, "Preprocessing complete");
|
||||
debug!(
|
||||
elapsed_ms = preprocess_start.elapsed().as_millis() as u64,
|
||||
"Preprocessing complete"
|
||||
);
|
||||
let apply_sigmoid = self.apply_sigmoid();
|
||||
|
||||
let input_name = self.input_name().to_string();
|
||||
|
|
|
|||
Loading…
Reference in a new issue