Skip to content
Open
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions src/transformers/image_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
get_image_size,
infer_channel_dimension_format,
)
from .utils import ExplicitEnum, TensorType, is_torch_tensor
from .utils import ExplicitEnum, is_torch_tensor
from .utils.import_utils import (
is_torch_available,
is_vision_available,
Expand Down Expand Up @@ -547,7 +547,7 @@ def _center_to_corners_format_numpy(bboxes_center: np.ndarray) -> np.ndarray:


# 2 functions below inspired by https://github.com/facebookresearch/detr/blob/master/util/box_ops.py
def center_to_corners_format(bboxes_center: TensorType) -> TensorType:
def center_to_corners_format(bboxes_center: "torch.Tensor") -> "torch.Tensor":
"""
Converts bounding boxes from center format to corners format.

Expand Down Expand Up @@ -590,7 +590,7 @@ def _corners_to_center_format_numpy(bboxes_corners: np.ndarray) -> np.ndarray:
return bboxes_center


def corners_to_center_format(bboxes_corners: TensorType) -> TensorType:
def corners_to_center_format(bboxes_corners: "torch.Tensor") -> "torch.Tensor":
"""
Converts bounding boxes from corners format to center format.

Expand Down
Loading