diff --git a/utils/utils.py b/utils/utils.py index 4ae1cc91..cafd1252 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -22,9 +22,9 @@ def load_classes(path): """ Loads class labels at 'path' """ - fp = open(path, 'r') - names = fp.read().split('\n')[:-1] - return names + fp = open('data/coco.names', 'r') + names = fp.read().split('\n') + return list(filter(None, names)) # filter removes empty strings (such as last line) def model_info(model): # Plots a line-by-line description of a PyTorch model