From 2bf5c3bc693e7bf4f057e0846239fdcf8de5eaa1 Mon Sep 17 00:00:00 2001 From: dcarron <daniel.carron@idiap.ch> Date: Mon, 22 Jan 2024 09:10:11 +0100 Subject: [PATCH] [typing] Use typing_extensions.Self Typing.Self was introduced in Python 3.11 so we cannot use it in the 3.10 pipeline. --- src/ptbench/config/data/tbx11k/datamodule.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ptbench/config/data/tbx11k/datamodule.py b/src/ptbench/config/data/tbx11k/datamodule.py index 7d3d786e..abe2bec7 100644 --- a/src/ptbench/config/data/tbx11k/datamodule.py +++ b/src/ptbench/config/data/tbx11k/datamodule.py @@ -9,6 +9,7 @@ import os import typing import PIL.Image +import typing_extensions from torch.utils.data._utils.collate import default_collate_fn_map from torchvision.transforms.functional import to_tensor @@ -63,7 +64,7 @@ class BoundingBox: def ymax(self) -> int: 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. Notice that screen geometry dictates is slightly different from -- GitLab