valor-lite 0.33.9__py3-none-any.whl → 0.33.10__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.
Potentially problematic release.
This version of valor-lite might be problematic. Click here for more details.
- valor_lite/object_detection/computation.py +33 -9
- valor_lite/object_detection/manager.py +6 -1
- valor_lite/object_detection/metric.py +9 -3
- {valor_lite-0.33.9.dist-info → valor_lite-0.33.10.dist-info}/METADATA +1 -1
- {valor_lite-0.33.9.dist-info → valor_lite-0.33.10.dist-info}/RECORD +8 -8
- {valor_lite-0.33.9.dist-info → valor_lite-0.33.10.dist-info}/LICENSE +0 -0
- {valor_lite-0.33.9.dist-info → valor_lite-0.33.10.dist-info}/WHEEL +0 -0
- {valor_lite-0.33.9.dist-info → valor_lite-0.33.10.dist-info}/top_level.txt +0 -0
|
@@ -334,7 +334,10 @@ def compute_metrics(
|
|
|
334
334
|
counts = np.zeros((n_ious, n_scores, n_labels, 7))
|
|
335
335
|
|
|
336
336
|
pd_labels = data[:, 5].astype(int)
|
|
337
|
-
|
|
337
|
+
scores = data[:, 6]
|
|
338
|
+
unique_pd_labels, unique_pd_indices = np.unique(
|
|
339
|
+
pd_labels, return_index=True
|
|
340
|
+
)
|
|
338
341
|
gt_count = label_metadata[:, 0]
|
|
339
342
|
running_total_count = np.zeros(
|
|
340
343
|
(n_ious, n_rows),
|
|
@@ -342,7 +345,6 @@ def compute_metrics(
|
|
|
342
345
|
)
|
|
343
346
|
running_tp_count = np.zeros_like(running_total_count)
|
|
344
347
|
running_gt_count = np.zeros_like(running_total_count)
|
|
345
|
-
pr_curve = np.zeros((n_ious, n_labels, 101))
|
|
346
348
|
|
|
347
349
|
mask_score_nonzero = data[:, 6] > 1e-9
|
|
348
350
|
mask_gt_exists = data[:, 1] >= 0.0
|
|
@@ -475,20 +477,42 @@ def compute_metrics(
|
|
|
475
477
|
out=recall,
|
|
476
478
|
)
|
|
477
479
|
recall_index = np.floor(recall * 100.0).astype(int)
|
|
480
|
+
|
|
481
|
+
# bin precision-recall curve
|
|
482
|
+
pr_curve = np.zeros((n_ious, n_labels, 101, 2))
|
|
478
483
|
for iou_idx in range(n_ious):
|
|
479
484
|
p = precision[iou_idx]
|
|
480
485
|
r = recall_index[iou_idx]
|
|
481
|
-
pr_curve[iou_idx, pd_labels, r] = np.maximum(
|
|
482
|
-
pr_curve[iou_idx, pd_labels, r],
|
|
486
|
+
pr_curve[iou_idx, pd_labels, r, 0] = np.maximum(
|
|
487
|
+
pr_curve[iou_idx, pd_labels, r, 0],
|
|
488
|
+
p,
|
|
489
|
+
)
|
|
490
|
+
pr_curve[iou_idx, pd_labels, r, 1] = np.maximum(
|
|
491
|
+
pr_curve[iou_idx, pd_labels, r, 1],
|
|
492
|
+
scores,
|
|
483
493
|
)
|
|
484
494
|
|
|
485
495
|
# calculate average precision
|
|
486
|
-
|
|
496
|
+
running_max_precision = np.zeros((n_ious, n_labels))
|
|
497
|
+
running_max_score = np.zeros((n_labels))
|
|
487
498
|
for recall in range(100, -1, -1):
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
499
|
+
|
|
500
|
+
# running max precision
|
|
501
|
+
running_max_precision = np.maximum(
|
|
502
|
+
pr_curve[:, :, recall, 0],
|
|
503
|
+
running_max_precision,
|
|
504
|
+
)
|
|
505
|
+
pr_curve[:, :, recall, 0] = running_max_precision
|
|
506
|
+
|
|
507
|
+
# running max score
|
|
508
|
+
running_max_score = np.maximum(
|
|
509
|
+
pr_curve[:, :, recall, 1],
|
|
510
|
+
running_max_score,
|
|
511
|
+
)
|
|
512
|
+
pr_curve[:, :, recall, 1] = running_max_score
|
|
513
|
+
|
|
514
|
+
average_precision += running_max_precision
|
|
515
|
+
|
|
492
516
|
average_precision = average_precision / 101.0
|
|
493
517
|
|
|
494
518
|
# calculate average recall
|
|
@@ -595,7 +595,12 @@ class Evaluator:
|
|
|
595
595
|
|
|
596
596
|
metrics[MetricType.PrecisionRecallCurve] = [
|
|
597
597
|
PrecisionRecallCurve(
|
|
598
|
-
|
|
598
|
+
precisions=pr_curves[iou_idx, label_idx, :, 0]
|
|
599
|
+
.astype(float)
|
|
600
|
+
.tolist(),
|
|
601
|
+
scores=pr_curves[iou_idx, label_idx, :, 1]
|
|
602
|
+
.astype(float)
|
|
603
|
+
.tolist(),
|
|
599
604
|
iou_threshold=iou_threshold,
|
|
600
605
|
label=label,
|
|
601
606
|
)
|
|
@@ -591,8 +591,10 @@ class PrecisionRecallCurve:
|
|
|
591
591
|
|
|
592
592
|
Attributes
|
|
593
593
|
----------
|
|
594
|
-
|
|
594
|
+
precisions : list[float]
|
|
595
595
|
Interpolated precision values corresponding to recalls at 0.0, 0.01, ..., 1.0.
|
|
596
|
+
scores : list[float]
|
|
597
|
+
Maximum prediction score for each point on the interpolated curve.
|
|
596
598
|
iou_threshold : float
|
|
597
599
|
The Intersection over Union (IoU) threshold used to determine true positives.
|
|
598
600
|
label : str
|
|
@@ -606,14 +608,18 @@ class PrecisionRecallCurve:
|
|
|
606
608
|
Converts the instance to a dictionary representation.
|
|
607
609
|
"""
|
|
608
610
|
|
|
609
|
-
|
|
611
|
+
precisions: list[float]
|
|
612
|
+
scores: list[float]
|
|
610
613
|
iou_threshold: float
|
|
611
614
|
label: str
|
|
612
615
|
|
|
613
616
|
def to_metric(self) -> Metric:
|
|
614
617
|
return Metric(
|
|
615
618
|
type=type(self).__name__,
|
|
616
|
-
value=
|
|
619
|
+
value={
|
|
620
|
+
"precisions": self.precisions,
|
|
621
|
+
"scores": self.scores,
|
|
622
|
+
},
|
|
617
623
|
parameters={
|
|
618
624
|
"iou_threshold": self.iou_threshold,
|
|
619
625
|
"label": self.label,
|
|
@@ -8,17 +8,17 @@ valor_lite/classification/manager.py,sha256=7NKk4syQHH5hBEUDWTD0zIFkJSNdOMzJn8a8
|
|
|
8
8
|
valor_lite/classification/metric.py,sha256=m9_zD82YGl0QhuMql943YNKg67NZ6bsrR8ggs6_JZms,11728
|
|
9
9
|
valor_lite/object_detection/__init__.py,sha256=PiKfemo8FkZRzBhPSjhil8ahGURLy0Vk_iV25CB4UBU,1139
|
|
10
10
|
valor_lite/object_detection/annotation.py,sha256=o6VfiRobiB0ljqsNBLAYMXgi32RSIR7uTA-dgxq6zBI,8248
|
|
11
|
-
valor_lite/object_detection/computation.py,sha256=
|
|
12
|
-
valor_lite/object_detection/manager.py,sha256=
|
|
13
|
-
valor_lite/object_detection/metric.py,sha256=
|
|
11
|
+
valor_lite/object_detection/computation.py,sha256=Z9jhiimYm7j3tYAqYN4yZd6Hm5eQYrHmXBsemAltS5M,27530
|
|
12
|
+
valor_lite/object_detection/manager.py,sha256=vb4JpynNF0JcnFwNmReFjls9UGAquigN2hpEbG89J04,38991
|
|
13
|
+
valor_lite/object_detection/metric.py,sha256=tHRVnpBqw_w1VwnNkTCmu1yv7Max9FRlf5uh0wYew4s,24046
|
|
14
14
|
valor_lite/semantic_segmentation/__init__.py,sha256=IdarTHKUuUMDvMBmInQu12Mm_NMCbql6Hf0nL5b56Ak,424
|
|
15
15
|
valor_lite/semantic_segmentation/annotation.py,sha256=CujYFdHS3fgr4Y7mEDs_u1XBmbPJzNU2CdqvjCT_d_A,2938
|
|
16
16
|
valor_lite/semantic_segmentation/computation.py,sha256=iJkEmTNmw9HwQCxSnpJkQsAdVcFriGhhu_WMks6D7tU,5122
|
|
17
17
|
valor_lite/semantic_segmentation/manager.py,sha256=aJk6edWZWKqrzl6hVmEUSZVYhHLuyihxWgAIXsCXkZ0,17361
|
|
18
18
|
valor_lite/semantic_segmentation/metric.py,sha256=Y8M3z92SaABEe9TwBUN37TFsh9DR5WoIxO-TfXVwz8I,6289
|
|
19
19
|
valor_lite/text_generation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
-
valor_lite-0.33.
|
|
21
|
-
valor_lite-0.33.
|
|
22
|
-
valor_lite-0.33.
|
|
23
|
-
valor_lite-0.33.
|
|
24
|
-
valor_lite-0.33.
|
|
20
|
+
valor_lite-0.33.10.dist-info/LICENSE,sha256=M0L53VuwfEEqezhHb7NPeYcO_glw7-k4DMLZQ3eRN64,1068
|
|
21
|
+
valor_lite-0.33.10.dist-info/METADATA,sha256=U_O0KL08ks1p4k7yZnX5Z7ItdcCnDxZZ5xgnu7Skhpw,5632
|
|
22
|
+
valor_lite-0.33.10.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
23
|
+
valor_lite-0.33.10.dist-info/top_level.txt,sha256=9ujykxSwpl2Hu0_R95UQTR_l07k9UUTSdrpiqmq6zc4,11
|
|
24
|
+
valor_lite-0.33.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|