Spaces:
Sleeping
Sleeping
franzi2505
commited on
Commit
•
4f17999
1
Parent(s):
2b24bc8
minor
Browse files- PanopticQuality.py +4 -4
PanopticQuality.py
CHANGED
@@ -184,13 +184,13 @@ class PQMetric(evaluate.Metric):
|
|
184 |
result = result.T
|
185 |
result_dict["scores"] = {id2label[numeric_label]: result[i].tolist() \
|
186 |
for i, numeric_label in enumerate(things_stuffs)}
|
187 |
-
result_dict["scores"].update({"
|
188 |
result_dict["numbers"] = {id2label[numeric_label]: [tp[i].item(), fp[i].item(), fn[i].item(), iou[i].item()] \
|
189 |
for i, numeric_label in enumerate(things_stuffs)}
|
190 |
-
result_dict["numbers"].update({"
|
191 |
else:
|
192 |
-
result_dict["scores"] = {"
|
193 |
-
result_dict["numbers"] = {"
|
194 |
|
195 |
return result_dict
|
196 |
|
|
|
184 |
result = result.T
|
185 |
result_dict["scores"] = {id2label[numeric_label]: result[i].tolist() \
|
186 |
for i, numeric_label in enumerate(things_stuffs)}
|
187 |
+
result_dict["scores"].update({"ALL": result.mean(axis=0).tolist()})
|
188 |
result_dict["numbers"] = {id2label[numeric_label]: [tp[i].item(), fp[i].item(), fn[i].item(), iou[i].item()] \
|
189 |
for i, numeric_label in enumerate(things_stuffs)}
|
190 |
+
result_dict["numbers"].update({"ALL": [tp.sum().item(), fp.sum().item(), fn.sum().item(), iou.sum().item()]})
|
191 |
else:
|
192 |
+
result_dict["scores"] = {"ALL": result.tolist() if self.split_sq_rq else [result.tolist()]}
|
193 |
+
result_dict["numbers"] = {"ALL": [tp.sum().item(), fp.sum().item(), fn.sum().item(), iou.sum().item()]}
|
194 |
|
195 |
return result_dict
|
196 |
|