JeffLiang commited on
Commit
01d0cdf
1 Parent(s): 9d3c696
open_vocab_seg/modeling/clip_adapter/utils.py CHANGED
@@ -62,7 +62,7 @@ def crop_with_mask(
62
  new_image = torch.cat(
63
  [image.new_full((1, b - t, r - l), fill_value=val) for val in fill]
64
  )
65
- # return image[:, t:b, l:r], mask[None, t:b, l:r]
66
  return image[:, t:b, l:r] * mask[None, t:b, l:r] + (~ mask[None, t:b, l:r]) * new_image, mask[None, t:b, l:r]
67
 
68
 
 
62
  new_image = torch.cat(
63
  [image.new_full((1, b - t, r - l), fill_value=val) for val in fill]
64
  )
65
+ mask = mask.bool()
66
  return image[:, t:b, l:r] * mask[None, t:b, l:r] + (~ mask[None, t:b, l:r]) * new_image, mask[None, t:b, l:r]
67
 
68