Spaces:
Sleeping
Sleeping
init did not work
Browse files- user-friendly-metrics.py +13 -21
user-friendly-metrics.py
CHANGED
@@ -60,22 +60,6 @@ Args:
|
|
60 |
class UserFriendlyMetrics(evaluate.Metric):
|
61 |
"""TODO: Short description of my evaluation module."""
|
62 |
|
63 |
-
def __init__(self,
|
64 |
-
iou_threshold = 1e-10,
|
65 |
-
filter = {"name": "area", "ranges": [("all", [0, 1e5**2])]},
|
66 |
-
payload: Payload = None,,
|
67 |
-
recognition_thresholds: list = [0.3, 0.5, 0.8],
|
68 |
-
**kwargs
|
69 |
-
):
|
70 |
-
super().__init__(**kwargs)
|
71 |
-
|
72 |
-
self.iou_threshold = iou_threshold
|
73 |
-
self.filter = filter
|
74 |
-
self.payload = payload
|
75 |
-
self.recognition_thresholds = recognition_thresholds
|
76 |
-
|
77 |
-
print("iou_threshold", self.iou_threshold)
|
78 |
-
|
79 |
def _info(self):
|
80 |
# TODO: Specifies the evaluate.EvaluationModuleInfo object
|
81 |
return evaluate.MetricInfo(
|
@@ -108,18 +92,26 @@ class UserFriendlyMetrics(evaluate.Metric):
|
|
108 |
# def compute_from_payload(self, payload, **kwargs):
|
109 |
|
110 |
|
111 |
-
def _compute(self,
|
|
|
|
|
|
|
|
|
|
|
112 |
|
113 |
return calculate_from_payload(
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
**kwargs
|
119 |
)
|
120 |
|
121 |
def compute_from_payload(self,
|
122 |
payload: Payload,
|
|
|
|
|
|
|
123 |
**kwargs):
|
124 |
|
125 |
results = {}
|
|
|
60 |
class UserFriendlyMetrics(evaluate.Metric):
|
61 |
"""TODO: Short description of my evaluation module."""
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
def _info(self):
|
64 |
# TODO: Specifies the evaluate.EvaluationModuleInfo object
|
65 |
return evaluate.MetricInfo(
|
|
|
92 |
# def compute_from_payload(self, payload, **kwargs):
|
93 |
|
94 |
|
95 |
+
def _compute(self,
|
96 |
+
payload: Payload,
|
97 |
+
iou_threshold: float = 1e-10,
|
98 |
+
filter={"name": "area", "ranges": [("all", [0, 1e5**2])]},
|
99 |
+
recognition_thresholds=[0.3, 0.5, 0.8],
|
100 |
+
**kwargs):
|
101 |
|
102 |
return calculate_from_payload(
|
103 |
+
payload,
|
104 |
+
iou_threshold,
|
105 |
+
filter,
|
106 |
+
recognition_thresholds,
|
107 |
**kwargs
|
108 |
)
|
109 |
|
110 |
def compute_from_payload(self,
|
111 |
payload: Payload,
|
112 |
+
iou_threshold: float = 1e-10,
|
113 |
+
filter={"name": "area", "ranges": [("all", [0, 1e5**2])]},
|
114 |
+
recognition_thresholds=[0.3, 0.5, 0.8],
|
115 |
**kwargs):
|
116 |
|
117 |
results = {}
|