From 77b7165d490d52e59d20bce271719a6c6bc111f7 Mon Sep 17 00:00:00 2001 From: Arthur Brussee Date: Mon, 6 Jan 2025 17:39:49 +0000 Subject: [PATCH] Remove now unnecesary clamps --- crates/brush-train/src/eval.rs | 4 +--- crates/brush-train/src/train.rs | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/brush-train/src/eval.rs b/crates/brush-train/src/eval.rs index 440ce64..d8ebfa8 100644 --- a/crates/brush-train/src/eval.rs +++ b/crates/brush-train/src/eval.rs @@ -62,9 +62,7 @@ pub async fn eval_stats( let gt_tensor = image_to_tensor::(&ground_truth, device); let (rendered, aux) = splats.render(&view.camera, res, false); - let render_rgb = rendered - .slice([0..res.y as usize, 0..res.x as usize, 0..3]) - .clamp_min(0.0); + let render_rgb = rendered.slice([0..res.y as usize, 0..res.x as usize, 0..3]); let mse = (render_rgb.clone() - gt_tensor.clone()) .powf_scalar(2.0) .mean(); diff --git a/crates/brush-train/src/train.rs b/crates/brush-train/src/train.rs index 3193ad6..a0d0542 100644 --- a/crates/brush-train/src/train.rs +++ b/crates/brush-train/src/train.rs @@ -256,11 +256,9 @@ impl SplatTrainer { let _span = trace_span!("Calculate losses", sync_burn = true).entered(); - // Convert to srgb space. let pred_rgb = pred_images .clone() - .slice([0..batch_size, 0..img_h, 0..img_w, 0..3]) - .clamp_min(0.0); + .slice([0..batch_size, 0..img_h, 0..img_w, 0..3]); // This is wrong if the batch has mixed transparent and non-transparent images, // but that's ok for now.