tkianai commited on
Commit
542833c
·
unverified ·
1 Parent(s): e71fd0e

Filter the None labels (#705)

Browse files

* the value should be a list to unpacking

* filter the None labels

Files changed (1) hide show
  1. utils/datasets.py +1 -1
utils/datasets.py CHANGED
@@ -375,7 +375,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
375
  pbar = tqdm(self.label_files)
376
  for i, file in enumerate(pbar):
377
  l = self.labels[i] # label
378
- if l.shape[0]:
379
  assert l.shape[1] == 5, '> 5 label columns: %s' % file
380
  assert (l >= 0).all(), 'negative labels: %s' % file
381
  assert (l[:, 1:] <= 1).all(), 'non-normalized or out of bounds coordinate labels: %s' % file
 
375
  pbar = tqdm(self.label_files)
376
  for i, file in enumerate(pbar):
377
  l = self.labels[i] # label
378
+ if l is not None and l.shape[0]:
379
  assert l.shape[1] == 5, '> 5 label columns: %s' % file
380
  assert (l >= 0).all(), 'negative labels: %s' % file
381
  assert (l[:, 1:] <= 1).all(), 'non-normalized or out of bounds coordinate labels: %s' % file