jhj0517 commited on
Commit
44f2d47
1 Parent(s): 381bc6f

Update `invert_masks()`

Browse files
Files changed (1) hide show
  1. modules/mask_utils.py +2 -1
modules/mask_utils.py CHANGED
@@ -19,7 +19,8 @@ def decode_to_mask(seg: np.ndarray[np.bool_] | np.ndarray[np.uint8]) -> np.ndarr
19
 
20
  def invert_masks(masks: List[Dict]) -> List[Dict]:
21
  """Invert the masks. Used for background masking"""
22
- return [{'segmentation': 1 - mask['segmentation'], 'area': mask['area']} for mask in masks]
 
23
 
24
 
25
  def generate_random_color() -> Tuple[int, int, int]:
 
19
 
20
  def invert_masks(masks: List[Dict]) -> List[Dict]:
21
  """Invert the masks. Used for background masking"""
22
+ inverted = 1 - masks
23
+ return inverted
24
 
25
 
26
  def generate_random_color() -> Tuple[int, int, int]: