File tree Expand file tree Collapse file tree
t4_devkit/evaluation/metric Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import numpy as np
66from attrs import define , field
77
8+ from .base import BaseMetric
9+
810if TYPE_CHECKING :
911 from t4_devkit .evaluation import BoxMatch , FrameBoxMatch , MatchingScorerLike
1012
1113__all__ = ["Ap" , "ApH" ]
1214
1315
14- class Ap :
16+ class Ap ( BaseMetric ) :
1517 num_recall_point = 101
1618 min_precision = 0.1
1719 min_recall = 0.1
Original file line number Diff line number Diff line change 1+ from __future__ import annotations
2+
3+ from abc import ABC , abstractmethod
4+ from typing import TYPE_CHECKING
5+
6+ if TYPE_CHECKING :
7+ from t4_devkit .evaluation import FrameBoxMatch
8+
9+
10+ class BaseMetric (ABC ):
11+ @abstractmethod
12+ def __call__ (self , frames : list [FrameBoxMatch ]) -> float :
13+ """Compute metric score."""
14+ ...
Original file line number Diff line number Diff line change 44
55from attrs import define , field
66
7+ from .base import BaseMetric
8+
79if TYPE_CHECKING :
810 from t4_devkit .evaluation import BoxMatch , FrameBoxMatch , MatchingScorerLike
911
1012__all__ = ["Mota" , "Motp" ]
1113
1214
13- class Mota :
15+ class Mota ( BaseMetric ) :
1416 @define
1517 class ClearBuffer :
1618 num_gt : int = field (init = False , default = 0 )
You can’t perform that action at this time.
0 commit comments