Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(perception): remove typing_extensions #277

Merged
merged 1 commit into from
Oct 12, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# limitations under the License.


from __future__ import annotations

from abc import ABC
from abc import abstractmethod
from enum import Enum
Expand All @@ -21,7 +23,6 @@
from perception_eval.common.evaluation_task import EvaluationTask
from perception_eval.evaluation import PerceptionFrameResult
from perception_eval.evaluation.matching import MatchingMode
from typing_extensions import Self


class SuccessFail(Enum):
Expand Down Expand Up @@ -78,7 +79,7 @@ def is_valid(self, score: Number) -> bool:
return score >= self.value

@classmethod
def from_str(cls, value: str) -> Self:
def from_str(cls, value: str) -> CriteriaLevel:
"""
Construct instance from.

Expand All @@ -96,7 +97,7 @@ def from_str(cls, value: str) -> Self:
return cls.__members__[name]

@classmethod
def from_number(cls, value: Number) -> Self:
def from_number(cls, value: Number) -> CriteriaLevel:
"""
Construct `CriteriaLevel.CUSTOM` with custom value.

Expand Down Expand Up @@ -129,7 +130,7 @@ class CriteriaMethod(Enum):
METRICS_SCORE = "metrics_score"

@classmethod
def from_str(cls, value: str) -> Self:
def from_str(cls, value: str) -> CriteriaMethod:
"""
Construct instance from name in string.

Expand Down