Skip to content

Commit

Permalink
Remove now unnecesary clamps
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurBrussee committed Jan 6, 2025
1 parent 20374d2 commit 77b7165
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions crates/brush-train/src/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ pub async fn eval_stats<B: Backend>(
let gt_tensor = image_to_tensor::<B>(&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();
Expand Down
4 changes: 1 addition & 3 deletions crates/brush-train/src/train.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 77b7165

Please sign in to comment.