Skip to content

Commit

Permalink
fix: label studio expects 8 bit masks, not boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrutchf committed Nov 13, 2024
1 parent ec1de42 commit 6f8badd
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def __init__(self, mask: np.ndarray):
def __convert_mask(self, mask: np.ndarray):
unique_values = np.unique_values(mask[mask != 0])

converted_mask = np.zeros_like(mask)
converted_mask = np.zeros_like(mask, dtype=np.uint8)
for value in unique_values:
converted_mask[mask == value] = 1
converted_mask[mask == value] = 255

return converted_mask

Expand Down

0 comments on commit 6f8badd

Please sign in to comment.