Skip to content

Commit

Permalink
Update val.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hukaixuan19970627 authored Jan 16, 2022
1 parent 1f4a99a commit bcffd1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions val.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def run(data,
iouv = torch.linspace(0.5, 0.95, 10).to(device) # iou vector for [email protected]:0.95
niou = iouv.numel()

names = {k: v for k, v in enumerate(model.names if hasattr(model, 'names') else model.module.names)}
names = model.names if hasattr(model, 'names') else model.module.names
# Dataloader
if not training:
model.warmup(imgsz=(1, 3, imgsz, imgsz), half=half) # warmup
Expand All @@ -169,7 +169,7 @@ def run(data,

seen = 0
confusion_matrix = ConfusionMatrix(nc=nc)
# names = {k: v for k, v in enumerate(model.names if hasattr(model, 'names') else model.module.names)}
names = {k: v for k, v in enumerate(model.names if hasattr(model, 'names') else model.module.names)}
class_map = coco80_to_coco91_class() if is_coco else list(range(1000))
s = ('%20s' + '%11s' * 6) % ('Class', 'Images', 'Labels', 'P', 'R', '[email protected]', '[email protected]:.95')
dt, p, r, f1, mp, mr, map50, map = [0.0, 0.0, 0.0], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
Expand Down

0 comments on commit bcffd1f

Please sign in to comment.