Skip to content

Commit

Permalink
Fix mask redundant dims
Browse files Browse the repository at this point in the history
  • Loading branch information
fAIseh00d committed Sep 24, 2024
1 parent e3a7de4 commit 03ff6c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion birefnetNode.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,14 @@ def rem_bg(self, model, images):
image = apply_mask_to_image(image.cpu(), mask.cpu())

_images.append(image)
_masks.append(mask)
_masks.append(mask.squeeze(0))

out_images = torch.cat(_images, dim=0)
out_masks = torch.cat(_masks, dim=0)

if out_masks.shape[0] == 1:
out_masks = out_masks.squeeze(0)

return out_images, out_masks


Expand Down

0 comments on commit 03ff6c2

Please sign in to comment.