Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions t4_devkit/common/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ def is_box_in_image(
in_front = corners_3d[2, :] > 0.1 # True if a corner is at least 0.1 meter in front of camera.

if visibility == VisibilityLevel.FULL:
return np.all(is_visible) and np.all(in_front)
return bool(np.all(is_visible) and np.all(in_front))
elif visibility in (VisibilityLevel.MOST, VisibilityLevel.PARTIAL):
return np.any(is_visible)
return bool(np.any(is_visible))
elif visibility == VisibilityLevel.NONE:
return True
else:
Expand Down
2 changes: 1 addition & 1 deletion t4_devkit/dataclass/box.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def distance_box(box: BoxLike, tf_matrix: HomogeneousMatrix) -> float | None:
else:
raise TypeError(f"Unexpected box type: {type(box)}")

return np.linalg.norm(position)
return np.linalg.norm(position).item()


@define(eq=False)
Expand Down
Loading