Skip to content

Commit

Permalink
111
Browse files Browse the repository at this point in the history
  • Loading branch information
jamjamjon committed Jul 30, 2024
1 parent 05bc37e commit eefb242
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/models/sam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,8 @@ impl SAM {
let mask = mask.slice(s![i, .., ..]);
let (h, w) = mask.dim();
let luma = if self.use_low_res_mask {
let luma = mask.to_owned().into_raw_vec();
Ops::resize_lumaf32_vec(
&luma,
&mask.mapv(|x| if x < 0. { 0. } else { x }).into_raw_vec(),
w as _,
h as _,
image_width as _,
Expand All @@ -232,7 +231,7 @@ impl SAM {
"Bilinear",
)?
} else {
mask.map(|x| if *x > 0. { 255u8 } else { 0u8 })
mask.mapv(|x| if x > 0. { 255u8 } else { 0u8 })
.into_raw_vec()
};

Expand Down

0 comments on commit eefb242

Please sign in to comment.