diff --git a/libs/yolo_io.py b/libs/yolo_io.py index 192e2c785..0dadd5c9c 100644 --- a/libs/yolo_io.py +++ b/libs/yolo_io.py @@ -94,7 +94,11 @@ def __init__(self, file_path, image, class_list_path=None): # print (file_path, self.class_list_path) - classes_file = open(self.class_list_path, 'r') + try: + classes_file = open(self.class_list_path, 'r') + except FileNotFoundError: + classes_file = open(os.path.join(os.path.dirname(__file__), "..", "data", "predefined_classes.txt"), 'r') + self.classes = classes_file.read().strip('\n').split('\n') # print (self.classes)