🐛 Describe the bug
The function ops.masks_to_boxes can't deal masks with one or more zero matrix.
My simple solution:
`
for index, mask in enumerate(masks):
y, x = torch.where(mask != 0)
if y.numel() == 0 or x.numel() == 0:
bounding_boxes[index, :] = 0
else:
bounding_boxes[index, 0] = torch.min(x)
bounding_boxes[index, 1] = torch.min(y)
bounding_boxes[index, 2] = torch.max(x)
bounding_boxes[index, 3] = torch.max(y)
`
Versions
0.22.0 and upper