Skip to content

Commit

Permalink
Disable SSIM on wasm for now
Browse files Browse the repository at this point in the history
SSIM on wasm causes bad glitches. I suspect it's related to tracel-ai/burn#2435, but hard to say.
  • Loading branch information
ArthurBrussee committed Nov 14, 2024
1 parent d1a482b commit 278091c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion crates/brush-train/src/train.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ where

let loss = (pred_compare - batch.gt_images.clone()).abs().mean();

let loss = if self.config.ssim_weight > 0.0 {
// Disabled on WASM for now. On WebGPU + Metal this unfortunately has glitches.
let loss = if self.config.ssim_weight > 0.0 && !cfg!(target_family = "wasm") {
let gt_rgb =
batch
.gt_images
Expand Down
7 changes: 4 additions & 3 deletions crates/brush-viewer/src/panels/scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,13 @@ Or load a dataset to train on. These are zip files with:
#[cfg(target_family = "wasm")]
ui.scope(|ui| {
ui.visuals_mut().override_text_color = Some(Color32::YELLOW);
ui.heading("Note: Running in browser is experimental");
ui.heading("Note: Running in browser is still experimental");

ui.label(
r#"
In browser training is about 2x lower than the native app. For bigger training
runs consider using the native app."#,
In browser training is slower, and lower quality than the native app.
For bigger training runs consider using the native app."#,
);
});

Expand Down

0 comments on commit 278091c

Please sign in to comment.