glenn-jocher commited on
Commit
6649770
1 Parent(s): d40e478

--rect test bug fix

Browse files
Files changed (2) hide show
  1. test.py +1 -1
  2. utils/datasets.py +1 -0
test.py CHANGED
@@ -59,7 +59,7 @@ def test(data,
59
  _ = model(img.half() if half else img) if device.type != 'cpu' else None # run once
60
  path = data['test'] if opt.task == 'test' else data['val'] # path to val/test images
61
  dataloader = create_dataloader(path, imgsz, batch_size, model.stride.max(), opt,
62
- hyp=None, augment=False, cache=False, pad=0.5, rect=False)[0]
63
 
64
  seen = 0
65
  names = model.names if hasattr(model, 'names') else model.module.names
 
59
  _ = model(img.half() if half else img) if device.type != 'cpu' else None # run once
60
  path = data['test'] if opt.task == 'test' else data['val'] # path to val/test images
61
  dataloader = create_dataloader(path, imgsz, batch_size, model.stride.max(), opt,
62
+ hyp=None, augment=False, cache=False, pad=0.5, rect=True)[0]
63
 
64
  seen = 0
65
  names = model.names if hasattr(model, 'names') else model.module.names
utils/datasets.py CHANGED
@@ -343,6 +343,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
343
  irect = ar.argsort()
344
  self.img_files = [self.img_files[i] for i in irect]
345
  self.label_files = [self.label_files[i] for i in irect]
 
346
  self.shapes = s[irect] # wh
347
  ar = ar[irect]
348
 
 
343
  irect = ar.argsort()
344
  self.img_files = [self.img_files[i] for i in irect]
345
  self.label_files = [self.label_files[i] for i in irect]
346
+ self.labels = [self.labels[i] for i in irect]
347
  self.shapes = s[irect] # wh
348
  ar = ar[irect]
349