Skip to content

Commit

Permalink
fix mypy
Browse files Browse the repository at this point in the history
Signed-off-by: Can-Zhao <[email protected]>
  • Loading branch information
Can-Zhao committed Mar 22, 2023
1 parent d920c38 commit 7a92b22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions monai/data/box_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def get_spatial_dims(
# Check the validity of each input and add its corresponding spatial_dims to spatial_dims_set
if boxes is not None:
if len(boxes.shape) != 2:
if boxes.numel() == 0:
if boxes.shape[0] == 0:
raise ValueError(
f"Currently we support only boxes with shape [N,4] or [N,6], "
f"got boxes with shape {boxes.shape}. "
Expand All @@ -413,7 +413,7 @@ def get_spatial_dims(
spatial_dims_set.add(int(boxes.shape[1] / 2))
if points is not None:
if len(points.shape) != 2:
if points.numel() == 0:
if points.shape[0] == 0:
raise ValueError(
f"Currently we support only points with shape [N,2] or [N,3], "
f"got points with shape {points.shape}. "
Expand Down

0 comments on commit 7a92b22

Please sign in to comment.