Skip to content

Commit 7a92b22

Browse files
committed
fix mypy
Signed-off-by: Can-Zhao <[email protected]>
1 parent d920c38 commit 7a92b22

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

monai/data/box_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ def get_spatial_dims(
396396
# Check the validity of each input and add its corresponding spatial_dims to spatial_dims_set
397397
if boxes is not None:
398398
if len(boxes.shape) != 2:
399-
if boxes.numel() == 0:
399+
if boxes.shape[0] == 0:
400400
raise ValueError(
401401
f"Currently we support only boxes with shape [N,4] or [N,6], "
402402
f"got boxes with shape {boxes.shape}. "
@@ -413,7 +413,7 @@ def get_spatial_dims(
413413
spatial_dims_set.add(int(boxes.shape[1] / 2))
414414
if points is not None:
415415
if len(points.shape) != 2:
416-
if points.numel() == 0:
416+
if points.shape[0] == 0:
417417
raise ValueError(
418418
f"Currently we support only points with shape [N,2] or [N,3], "
419419
f"got points with shape {points.shape}. "

0 commit comments

Comments
 (0)