Skip to content

Commit

Permalink
Filter the None labels (ultralytics#705)
Browse files Browse the repository at this point in the history
* the value should be a list to unpacking

* filter the None labels
  • Loading branch information
tkianai committed Aug 11, 2020
1 parent 0c1371e commit 100e806
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def __init__(self, path, img_size=640, batch_size=16, augment=False, hyp=None, r
pbar = tqdm(self.label_files)
for i, file in enumerate(pbar):
l = self.labels[i] # label
if l.shape[0]:
if l is not None and l.shape[0]:
assert l.shape[1] == 5, '> 5 label columns: %s' % file
assert (l >= 0).all(), 'negative labels: %s' % file
assert (l[:, 1:] <= 1).all(), 'non-normalized or out of bounds coordinate labels: %s' % file
Expand Down

0 comments on commit 100e806

Please sign in to comment.