Showing
1 changed file
with
5 additions
and
5 deletions
... | @@ -43,10 +43,10 @@ def parse_tfrecord(data): | ... | @@ -43,10 +43,10 @@ def parse_tfrecord(data): |
43 | def parse_record(features): | 43 | def parse_record(features): |
44 | # tfrecord parser for TFRecordIterator (primitive data) | 44 | # tfrecord parser for TFRecordIterator (primitive data) |
45 | 45 | ||
46 | - index = int(features['index']) | 46 | + index = int(features['index'][0]) |
47 | - encoded_image = np.frombuffer(features['image'], dtype = np.uint8) | 47 | + encoded_image = np.frombuffer(features['image'][0], dtype = np.uint8) |
48 | - width = int(features['width']) | 48 | + width = int(features['width'][0]) |
49 | - height = int(features['height']) | 49 | + height = int(features['height'][0]) |
50 | boxes = features['boxes'] | 50 | boxes = features['boxes'] |
51 | 51 | ||
52 | assert len(boxes) % 5 == 0, 'Annotation error occured in box array.' | 52 | assert len(boxes) % 5 == 0, 'Annotation error occured in box array.' |
... | @@ -56,7 +56,7 @@ def parse_record(features): | ... | @@ -56,7 +56,7 @@ def parse_record(features): |
56 | labels = [] | 56 | labels = [] |
57 | 57 | ||
58 | for i in range(box_cnt): | 58 | for i in range(box_cnt): |
59 | - label, x_min, y_min, x_max, y_max = int(boxes[i * 5]), float(boxes[i * 5 + 1]), float(boxes[i * 5 + 2]), float(boxes[i * 5 + 3]) | 59 | + label, x_min, y_min, x_max, y_max = int(boxes[i * 5]), float(boxes[i * 5 + 1]), float(boxes[i * 5 + 2]), float(boxes[i * 5 + 3]), float(boxes[i * 5 + 4]) |
60 | aligned_boxes.append([x_min, y_min, x_max, y_max]) | 60 | aligned_boxes.append([x_min, y_min, x_max, y_max]) |
61 | labels.append(label) | 61 | labels.append(label) |
62 | 62 | ... | ... |
-
Please register or login to post a comment