@@ -134,7 +134,7 @@ def info(self) -> EvaluatorInfo:
134134 def generate_meta (
135135 dataset : ds .Dataset ,
136136 labels_override : dict [int , str ] | None ,
137- ) -> tuple [dict [int , str ], NDArray [np .uint64 ], EvaluatorInfo , ]:
137+ ) -> tuple [dict [int , str ], NDArray [np .uint64 ], EvaluatorInfo ]:
138138 """
139139 Generate cache statistics.
140140
@@ -191,19 +191,21 @@ def generate_meta(
191191 # get gt labels
192192 gt_label_ids = ids [:, 3 ]
193193 gt_label_ids , gt_indices = np .unique (
194- gt_label_ids [ gt_label_ids >= 0 ] , return_index = True
194+ gt_label_ids , return_index = True
195195 )
196196 gt_labels = tbl ["gt_label" ].take (gt_indices ).to_pylist ()
197197 gt_labels = dict (zip (gt_label_ids .astype (int ).tolist (), gt_labels ))
198+ gt_labels .pop (- 1 , None )
198199 labels .update (gt_labels )
199200
200201 # get pd labels
201202 pd_label_ids = ids [:, 4 ]
202203 pd_label_ids , pd_indices = np .unique (
203- pd_label_ids [ pd_label_ids >= 0 ] , return_index = True
204+ pd_label_ids , return_index = True
204205 )
205206 pd_labels = tbl ["pd_label" ].take (pd_indices ).to_pylist ()
206207 pd_labels = dict (zip (pd_label_ids .astype (int ).tolist (), pd_labels ))
208+ pd_labels .pop (- 1 , None )
207209 labels .update (pd_labels )
208210
209211 # count gts per label
0 commit comments