def get_objects_from_label(label_file): '''returns a list of objects in the scene (label file given) each has it's attributes like bounding box measures and etc. ''' with open(label_file, 'r') as f: lines = f.readlines() objects = [object3d.Object3d(line) for line in lines] return objects
def get_objects_from_label(label_file): # Opens a label file, and passes the object to Object3d object, Read the json GT labels f = open(label_file) label_data = json.load(f) objects = [object3d.Object3d(data) for data in label_data] return objects
def get_objects_from_label(label_file): with open(label_file, 'r') as f: lines = f.readlines() objects = [object3d.Object3d(line) for line in lines] #### print(objects) #### Example. sample id = 000003 : [<lib.utils.object3d.Object3d object at 0x7f5777026a20>, <lib.utils.object3d.Object3d object at 0x7f5777026a90>, <lib.utils.object3d.Object3d object at 0x7f5777026ac8>] #### objects in each scene return objects
def get_label_with_frame_id(self, label_file, frame_id): if isinstance(frame_id, str): frame_id = int(frame_id) with open(label_file, 'r') as f: lines = f.readlines() objects = [] for line in lines: label = line.strip().split(' ') line_frame_id = int(label[0]) if line_frame_id == frame_id: objects.append(object3d.Object3d(" ".join(label[2:]))) return objects
def get_objects_from_label(label_file): with open(label_file, 'r') as f: lines = f.readlines() objects = [object3d.Object3d(line) for line in lines] return objects