valor-lite 0.33.0__py3-none-any.whl → 0.33.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- valor_lite/detection/__init__.py +4 -6
- valor_lite/detection/computation.py +243 -64
- valor_lite/detection/manager.py +216 -98
- valor_lite/detection/metric.py +77 -77
- {valor_lite-0.33.0.dist-info → valor_lite-0.33.2.dist-info}/METADATA +1 -1
- valor_lite-0.33.2.dist-info/RECORD +12 -0
- valor_lite-0.33.0.dist-info/RECORD +0 -12
- {valor_lite-0.33.0.dist-info → valor_lite-0.33.2.dist-info}/LICENSE +0 -0
- {valor_lite-0.33.0.dist-info → valor_lite-0.33.2.dist-info}/WHEEL +0 -0
- {valor_lite-0.33.0.dist-info → valor_lite-0.33.2.dist-info}/top_level.txt +0 -0
valor_lite/detection/metric.py
CHANGED
|
@@ -19,7 +19,7 @@ class MetricType(str, Enum):
|
|
|
19
19
|
ARAveragedOverScores = "ARAveragedOverScores"
|
|
20
20
|
mARAveragedOverScores = "mARAveragedOverScores"
|
|
21
21
|
PrecisionRecallCurve = "PrecisionRecallCurve"
|
|
22
|
-
|
|
22
|
+
DetailedCounts = "DetailedCounts"
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
@dataclass
|
|
@@ -28,8 +28,8 @@ class Counts:
|
|
|
28
28
|
fp: int
|
|
29
29
|
fn: int
|
|
30
30
|
label: tuple[str, str]
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
iou_threshold: float
|
|
32
|
+
score_threshold: float
|
|
33
33
|
|
|
34
34
|
@property
|
|
35
35
|
def metric(self) -> Metric:
|
|
@@ -41,8 +41,8 @@ class Counts:
|
|
|
41
41
|
"fn": self.fn,
|
|
42
42
|
},
|
|
43
43
|
parameters={
|
|
44
|
-
"
|
|
45
|
-
"
|
|
44
|
+
"iou_threshold": self.iou_threshold,
|
|
45
|
+
"score_threshold": self.score_threshold,
|
|
46
46
|
"label": {
|
|
47
47
|
"key": self.label[0],
|
|
48
48
|
"value": self.label[1],
|
|
@@ -58,8 +58,8 @@ class Counts:
|
|
|
58
58
|
class ClassMetric:
|
|
59
59
|
value: float
|
|
60
60
|
label: tuple[str, str]
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
iou_threshold: float
|
|
62
|
+
score_threshold: float
|
|
63
63
|
|
|
64
64
|
@property
|
|
65
65
|
def metric(self) -> Metric:
|
|
@@ -67,8 +67,8 @@ class ClassMetric:
|
|
|
67
67
|
type=type(self).__name__,
|
|
68
68
|
value=self.value,
|
|
69
69
|
parameters={
|
|
70
|
-
"
|
|
71
|
-
"
|
|
70
|
+
"iou_threshold": self.iou_threshold,
|
|
71
|
+
"score_threshold": self.score_threshold,
|
|
72
72
|
"label": {
|
|
73
73
|
"key": self.label[0],
|
|
74
74
|
"value": self.label[1],
|
|
@@ -99,7 +99,7 @@ class F1(ClassMetric):
|
|
|
99
99
|
@dataclass
|
|
100
100
|
class AP:
|
|
101
101
|
value: float
|
|
102
|
-
|
|
102
|
+
iou_threshold: float
|
|
103
103
|
label: tuple[str, str]
|
|
104
104
|
|
|
105
105
|
@property
|
|
@@ -108,7 +108,7 @@ class AP:
|
|
|
108
108
|
type=type(self).__name__,
|
|
109
109
|
value=self.value,
|
|
110
110
|
parameters={
|
|
111
|
-
"
|
|
111
|
+
"iou_threshold": self.iou_threshold,
|
|
112
112
|
"label": {
|
|
113
113
|
"key": self.label[0],
|
|
114
114
|
"value": self.label[1],
|
|
@@ -123,7 +123,7 @@ class AP:
|
|
|
123
123
|
@dataclass
|
|
124
124
|
class mAP:
|
|
125
125
|
value: float
|
|
126
|
-
|
|
126
|
+
iou_threshold: float
|
|
127
127
|
label_key: str
|
|
128
128
|
|
|
129
129
|
@property
|
|
@@ -132,7 +132,7 @@ class mAP:
|
|
|
132
132
|
type=type(self).__name__,
|
|
133
133
|
value=self.value,
|
|
134
134
|
parameters={
|
|
135
|
-
"
|
|
135
|
+
"iou_threshold": self.iou_threshold,
|
|
136
136
|
"label_key": self.label_key,
|
|
137
137
|
},
|
|
138
138
|
)
|
|
@@ -144,7 +144,7 @@ class mAP:
|
|
|
144
144
|
@dataclass
|
|
145
145
|
class APAveragedOverIOUs:
|
|
146
146
|
value: float
|
|
147
|
-
|
|
147
|
+
iou_thresholds: list[float]
|
|
148
148
|
label: tuple[str, str]
|
|
149
149
|
|
|
150
150
|
@property
|
|
@@ -153,7 +153,7 @@ class APAveragedOverIOUs:
|
|
|
153
153
|
type=type(self).__name__,
|
|
154
154
|
value=self.value,
|
|
155
155
|
parameters={
|
|
156
|
-
"
|
|
156
|
+
"iou_thresholds": self.iou_thresholds,
|
|
157
157
|
"label": {
|
|
158
158
|
"key": self.label[0],
|
|
159
159
|
"value": self.label[1],
|
|
@@ -168,7 +168,7 @@ class APAveragedOverIOUs:
|
|
|
168
168
|
@dataclass
|
|
169
169
|
class mAPAveragedOverIOUs:
|
|
170
170
|
value: float
|
|
171
|
-
|
|
171
|
+
iou_thresholds: list[float]
|
|
172
172
|
label_key: str
|
|
173
173
|
|
|
174
174
|
@property
|
|
@@ -177,7 +177,7 @@ class mAPAveragedOverIOUs:
|
|
|
177
177
|
type=type(self).__name__,
|
|
178
178
|
value=self.value,
|
|
179
179
|
parameters={
|
|
180
|
-
"
|
|
180
|
+
"iou_thresholds": self.iou_thresholds,
|
|
181
181
|
"label_key": self.label_key,
|
|
182
182
|
},
|
|
183
183
|
)
|
|
@@ -189,8 +189,8 @@ class mAPAveragedOverIOUs:
|
|
|
189
189
|
@dataclass
|
|
190
190
|
class AR:
|
|
191
191
|
value: float
|
|
192
|
-
|
|
193
|
-
|
|
192
|
+
score_threshold: float
|
|
193
|
+
iou_thresholds: list[float]
|
|
194
194
|
label: tuple[str, str]
|
|
195
195
|
|
|
196
196
|
@property
|
|
@@ -199,8 +199,8 @@ class AR:
|
|
|
199
199
|
type=type(self).__name__,
|
|
200
200
|
value=self.value,
|
|
201
201
|
parameters={
|
|
202
|
-
"
|
|
203
|
-
"
|
|
202
|
+
"score_threshold": self.score_threshold,
|
|
203
|
+
"iou_thresholds": self.iou_thresholds,
|
|
204
204
|
"label": {
|
|
205
205
|
"key": self.label[0],
|
|
206
206
|
"value": self.label[1],
|
|
@@ -215,8 +215,8 @@ class AR:
|
|
|
215
215
|
@dataclass
|
|
216
216
|
class mAR:
|
|
217
217
|
value: float
|
|
218
|
-
|
|
219
|
-
|
|
218
|
+
score_threshold: float
|
|
219
|
+
iou_thresholds: list[float]
|
|
220
220
|
label_key: str
|
|
221
221
|
|
|
222
222
|
@property
|
|
@@ -225,8 +225,8 @@ class mAR:
|
|
|
225
225
|
type=type(self).__name__,
|
|
226
226
|
value=self.value,
|
|
227
227
|
parameters={
|
|
228
|
-
"
|
|
229
|
-
"
|
|
228
|
+
"score_threshold": self.score_threshold,
|
|
229
|
+
"iou_thresholds": self.iou_thresholds,
|
|
230
230
|
"label_key": self.label_key,
|
|
231
231
|
},
|
|
232
232
|
)
|
|
@@ -238,8 +238,8 @@ class mAR:
|
|
|
238
238
|
@dataclass
|
|
239
239
|
class ARAveragedOverScores:
|
|
240
240
|
value: float
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
score_thresholds: list[float]
|
|
242
|
+
iou_thresholds: list[float]
|
|
243
243
|
label: tuple[str, str]
|
|
244
244
|
|
|
245
245
|
@property
|
|
@@ -248,8 +248,8 @@ class ARAveragedOverScores:
|
|
|
248
248
|
type=type(self).__name__,
|
|
249
249
|
value=self.value,
|
|
250
250
|
parameters={
|
|
251
|
-
"
|
|
252
|
-
"
|
|
251
|
+
"score_thresholds": self.score_thresholds,
|
|
252
|
+
"iou_thresholds": self.iou_thresholds,
|
|
253
253
|
"label": {
|
|
254
254
|
"key": self.label[0],
|
|
255
255
|
"value": self.label[1],
|
|
@@ -264,8 +264,8 @@ class ARAveragedOverScores:
|
|
|
264
264
|
@dataclass
|
|
265
265
|
class mARAveragedOverScores:
|
|
266
266
|
value: float
|
|
267
|
-
|
|
268
|
-
|
|
267
|
+
score_thresholds: list[float]
|
|
268
|
+
iou_thresholds: list[float]
|
|
269
269
|
label_key: str
|
|
270
270
|
|
|
271
271
|
@property
|
|
@@ -274,8 +274,8 @@ class mARAveragedOverScores:
|
|
|
274
274
|
type=type(self).__name__,
|
|
275
275
|
value=self.value,
|
|
276
276
|
parameters={
|
|
277
|
-
"
|
|
278
|
-
"
|
|
277
|
+
"score_thresholds": self.score_thresholds,
|
|
278
|
+
"iou_thresholds": self.iou_thresholds,
|
|
279
279
|
"label_key": self.label_key,
|
|
280
280
|
},
|
|
281
281
|
)
|
|
@@ -291,7 +291,7 @@ class PrecisionRecallCurve:
|
|
|
291
291
|
"""
|
|
292
292
|
|
|
293
293
|
precision: list[float]
|
|
294
|
-
|
|
294
|
+
iou_threshold: float
|
|
295
295
|
label: tuple[str, str]
|
|
296
296
|
|
|
297
297
|
@property
|
|
@@ -300,7 +300,7 @@ class PrecisionRecallCurve:
|
|
|
300
300
|
type=type(self).__name__,
|
|
301
301
|
value=self.precision,
|
|
302
302
|
parameters={
|
|
303
|
-
"
|
|
303
|
+
"iou_threshold": self.iou_threshold,
|
|
304
304
|
"label": {"key": self.label[0], "value": self.label[1]},
|
|
305
305
|
},
|
|
306
306
|
)
|
|
@@ -310,48 +310,48 @@ class PrecisionRecallCurve:
|
|
|
310
310
|
|
|
311
311
|
|
|
312
312
|
@dataclass
|
|
313
|
-
class
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
def to_dict(self) -> dict:
|
|
327
|
-
return {
|
|
328
|
-
"score": self.score,
|
|
329
|
-
"tp": self.tp,
|
|
330
|
-
"fp_misclassification": self.fp_misclassification,
|
|
331
|
-
"fp_hallucination": self.fp_hallucination,
|
|
332
|
-
"fn_misclassification": self.fn_misclassification,
|
|
333
|
-
"fn_missing_prediction": self.fn_missing_prediction,
|
|
334
|
-
"tp_examples": self.tp_examples,
|
|
335
|
-
"fp_misclassification_examples": self.fp_misclassification_examples,
|
|
336
|
-
"fp_hallucination_examples": self.fp_hallucination_examples,
|
|
337
|
-
"fn_misclassification_examples": self.fn_misclassification_examples,
|
|
338
|
-
"fn_missing_prediction_examples": self.fn_missing_prediction_examples,
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
@dataclass
|
|
343
|
-
class DetailedPrecisionRecallCurve:
|
|
344
|
-
iou: float
|
|
345
|
-
value: list[DetailedPrecisionRecallPoint]
|
|
313
|
+
class DetailedCounts:
|
|
314
|
+
tp: list[int]
|
|
315
|
+
fp_misclassification: list[int]
|
|
316
|
+
fp_hallucination: list[int]
|
|
317
|
+
fn_misclassification: list[int]
|
|
318
|
+
fn_missing_prediction: list[int]
|
|
319
|
+
tp_examples: list[list[str]]
|
|
320
|
+
fp_misclassification_examples: list[list[str]]
|
|
321
|
+
fp_hallucination_examples: list[list[str]]
|
|
322
|
+
fn_misclassification_examples: list[list[str]]
|
|
323
|
+
fn_missing_prediction_examples: list[list[str]]
|
|
324
|
+
score_thresholds: list[float]
|
|
325
|
+
iou_threshold: float
|
|
346
326
|
label: tuple[str, str]
|
|
347
327
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
"
|
|
354
|
-
"
|
|
328
|
+
@property
|
|
329
|
+
def metric(self) -> Metric:
|
|
330
|
+
return Metric(
|
|
331
|
+
type=type(self).__name__,
|
|
332
|
+
value={
|
|
333
|
+
"tp": self.tp,
|
|
334
|
+
"fp_misclassification": self.fp_misclassification,
|
|
335
|
+
"fp_hallucination": self.fp_hallucination,
|
|
336
|
+
"fn_misclassification": self.fn_misclassification,
|
|
337
|
+
"fn_missing_prediction": self.fn_missing_prediction,
|
|
338
|
+
"tn": None,
|
|
339
|
+
"tp_examples": self.tp_examples,
|
|
340
|
+
"fp_misclassification_examples": self.fp_misclassification_examples,
|
|
341
|
+
"fp_hallucination_examples": self.fp_hallucination_examples,
|
|
342
|
+
"fn_misclassification_examples": self.fn_misclassification_examples,
|
|
343
|
+
"fn_missing_prediction_examples": self.fn_missing_prediction_examples,
|
|
344
|
+
"tn_examples": None,
|
|
355
345
|
},
|
|
356
|
-
|
|
357
|
-
|
|
346
|
+
parameters={
|
|
347
|
+
"score_thresholds": self.score_thresholds,
|
|
348
|
+
"iou_threshold": self.iou_threshold,
|
|
349
|
+
"label": {
|
|
350
|
+
"key": self.label[0],
|
|
351
|
+
"value": self.label[1],
|
|
352
|
+
},
|
|
353
|
+
},
|
|
354
|
+
)
|
|
355
|
+
|
|
356
|
+
def to_dict(self) -> dict:
|
|
357
|
+
return self.metric.to_dict()
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
valor_lite/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
valor_lite/schemas.py,sha256=r4cC10w1xYsA785KmGE4ePeOX3wzEs846vT7QAiVg_I,293
|
|
3
|
+
valor_lite/detection/__init__.py,sha256=WHLHwHoKzXTBjkjC6E1_lhqB7gRWkiGWVWPqkKn-yK8,997
|
|
4
|
+
valor_lite/detection/annotation.py,sha256=ON9iVa33pxysUmZVTCb0wNz-eFX6MDOqDhGDz-ouymc,1466
|
|
5
|
+
valor_lite/detection/computation.py,sha256=L8FIwZ-qxOQnoT7mxgNzLyNyI-Bvga0i-gtbow3hN-o,22575
|
|
6
|
+
valor_lite/detection/manager.py,sha256=Y45Wy3PWi7dQ0VnDERdtpOixUbKVXTZxBcCR92ny0QY,34278
|
|
7
|
+
valor_lite/detection/metric.py,sha256=hHqClS7c71ztoUnfoaW3T7RmGYaVNU1SlM6vUs1P08I,8809
|
|
8
|
+
valor_lite-0.33.2.dist-info/LICENSE,sha256=M0L53VuwfEEqezhHb7NPeYcO_glw7-k4DMLZQ3eRN64,1068
|
|
9
|
+
valor_lite-0.33.2.dist-info/METADATA,sha256=fe-Sj568DB-E9cyC5P8GA_lLjmM1t3MZUHj1f0JF6fM,1842
|
|
10
|
+
valor_lite-0.33.2.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
11
|
+
valor_lite-0.33.2.dist-info/top_level.txt,sha256=9ujykxSwpl2Hu0_R95UQTR_l07k9UUTSdrpiqmq6zc4,11
|
|
12
|
+
valor_lite-0.33.2.dist-info/RECORD,,
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
valor_lite/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
valor_lite/schemas.py,sha256=r4cC10w1xYsA785KmGE4ePeOX3wzEs846vT7QAiVg_I,293
|
|
3
|
-
valor_lite/detection/__init__.py,sha256=vkV907Sjx09tgOHpDaLyR_-aFGfu2c1Kpb7hg220vBY,1099
|
|
4
|
-
valor_lite/detection/annotation.py,sha256=ON9iVa33pxysUmZVTCb0wNz-eFX6MDOqDhGDz-ouymc,1466
|
|
5
|
-
valor_lite/detection/computation.py,sha256=VIYZUeBd3KpwCPDBQCKCa0cY0hVb4mq_yGtY2ZP9gGE,16512
|
|
6
|
-
valor_lite/detection/manager.py,sha256=i-C72aQfuakeYFWsERQX-KoOGdGsDMrKMVQsqN82TnY,31527
|
|
7
|
-
valor_lite/detection/metric.py,sha256=wn9JAZMNbUIXUvH2C79jNKJswca1QEyXrCfs7isi1hU,8144
|
|
8
|
-
valor_lite-0.33.0.dist-info/LICENSE,sha256=M0L53VuwfEEqezhHb7NPeYcO_glw7-k4DMLZQ3eRN64,1068
|
|
9
|
-
valor_lite-0.33.0.dist-info/METADATA,sha256=1JyXg3OdEhmSTMWnzQqm2FBOlrpmex3TuizlnkLvdeE,1842
|
|
10
|
-
valor_lite-0.33.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
11
|
-
valor_lite-0.33.0.dist-info/top_level.txt,sha256=9ujykxSwpl2Hu0_R95UQTR_l07k9UUTSdrpiqmq6zc4,11
|
|
12
|
-
valor_lite-0.33.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|