Skip to content

Commit

Permalink
Merge with latest BiRefNet repository commits
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitribarbot committed Sep 14, 2024
1 parent 1a0d453 commit ba99d44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion birefnet/models/backbones/swin_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def forward(self, x, H, W):
mask_windows = window_partition(img_mask, self.window_size) # nW, window_size, window_size, 1
mask_windows = mask_windows.view(-1, self.window_size * self.window_size)
attn_mask = mask_windows.unsqueeze(1) - mask_windows.unsqueeze(2)
attn_mask = attn_mask.masked_fill(attn_mask != 0, float(-100.0)).masked_fill(attn_mask == 0, float(0.0))
attn_mask = attn_mask.masked_fill(attn_mask != 0, float(-100.0)).masked_fill(attn_mask == 0, float(0.0)).to(x.dtype)

for blk in self.blocks:
blk.H, blk.W = H, W
Expand Down

0 comments on commit ba99d44

Please sign in to comment.