Reduce test.py results spacing (#3511)
Browse files
test.py
CHANGED
@@ -95,7 +95,7 @@ def test(data,
|
|
95 |
confusion_matrix = ConfusionMatrix(nc=nc)
|
96 |
names = {k: v for k, v in enumerate(model.names if hasattr(model, 'names') else model.module.names)}
|
97 |
coco91class = coco80_to_coco91_class()
|
98 |
-
s = ('%20s' + '%
|
99 |
p, r, f1, mp, mr, map50, map, t0, t1 = 0., 0., 0., 0., 0., 0., 0., 0., 0.
|
100 |
loss = torch.zeros(3, device=device)
|
101 |
jdict, stats, ap, ap_class, wandb_images = [], [], [], [], []
|
@@ -228,7 +228,7 @@ def test(data,
|
|
228 |
nt = torch.zeros(1)
|
229 |
|
230 |
# Print results
|
231 |
-
pf = '%20s' + '%
|
232 |
print(pf % ('all', seen, nt.sum(), mp, mr, map50, map))
|
233 |
|
234 |
# Print results per class
|
|
|
95 |
confusion_matrix = ConfusionMatrix(nc=nc)
|
96 |
names = {k: v for k, v in enumerate(model.names if hasattr(model, 'names') else model.module.names)}
|
97 |
coco91class = coco80_to_coco91_class()
|
98 |
+
s = ('%20s' + '%11s' * 6) % ('Class', 'Images', 'Labels', 'P', 'R', '[email protected]', '[email protected]:.95')
|
99 |
p, r, f1, mp, mr, map50, map, t0, t1 = 0., 0., 0., 0., 0., 0., 0., 0., 0.
|
100 |
loss = torch.zeros(3, device=device)
|
101 |
jdict, stats, ap, ap_class, wandb_images = [], [], [], [], []
|
|
|
228 |
nt = torch.zeros(1)
|
229 |
|
230 |
# Print results
|
231 |
+
pf = '%20s' + '%11i' * 2 + '%11.3g' * 4 # print format
|
232 |
print(pf % ('all', seen, nt.sum(), mp, mr, map50, map))
|
233 |
|
234 |
# Print results per class
|