Skip to content
Snippets Groups Projects
Commit 2bf5c3bc authored by Daniel CARRON's avatar Daniel CARRON :b:
Browse files

[typing] Use typing_extensions.Self

Typing.Self was introduced in Python 3.11 so we cannot use it in the
3.10 pipeline.
parent 8e5b1d7c
No related branches found
No related tags found
1 merge request!12Adds grad-cam support on classifiers
Pipeline #83388 passed
...@@ -9,6 +9,7 @@ import os ...@@ -9,6 +9,7 @@ import os
import typing import typing
import PIL.Image import PIL.Image
import typing_extensions
from torch.utils.data._utils.collate import default_collate_fn_map from torch.utils.data._utils.collate import default_collate_fn_map
from torchvision.transforms.functional import to_tensor from torchvision.transforms.functional import to_tensor
...@@ -63,7 +64,7 @@ class BoundingBox: ...@@ -63,7 +64,7 @@ class BoundingBox:
def ymax(self) -> int: def ymax(self) -> int:
return self.ymin + self.height - 1 return self.ymin + self.height - 1
def intersection(self, other: typing.Self) -> int: def intersection(self, other: typing_extensions.Self) -> int:
"""Computes the area intersection between bounding boxes. """Computes the area intersection between bounding boxes.
Notice that screen geometry dictates is slightly different from Notice that screen geometry dictates is slightly different from
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment