Refactor code for speed and clarity
This commit is contained in:
Glenn Jocher authored and GitHub committed 2024-06-30 12:34:04 +02:00
1 parent 05e59bdec1
commit b9019671f4
13 files changed
+29 -5

No files matched your search

+6
View File
@@ -55,6 +55,9 @@ def ap_per_class_box_and_mask(
class Metric:
def __init__(self) -> None:
"""Initializes performance metric attributes for precision, recall, F1 score, average precision, and class
indices.
"""
self.p = [] # (nc, )
self.r = [] # (nc, )
self.f1 = [] # (nc, )
@@ -151,6 +154,9 @@ class Metrics:
"""Metric for boxes and masks."""
def __init__(self) -> None:
"""Initializes Metric objects for bounding boxes and masks to compute performance metrics in the Metrics
class.
"""
self.metric_box = Metric()
self.metric_mask = Metric()