Update SLR.py
Browse files
SLR.py
CHANGED
|
@@ -118,8 +118,9 @@ class SLR(datasets.GeneratorBasedBuilder):
|
|
| 118 |
word=item['text']
|
| 119 |
ner_tags.append(labels)
|
| 120 |
words.append(word)
|
|
|
|
| 121 |
#for item in data['annotations']:
|
| 122 |
#bbox=item['bbox']
|
| 123 |
-
|
| 124 |
|
| 125 |
yield guid, {"id": str(guid), "words": words , "bboxes": bboxes, "ner_tags": ner_tags, "image_path": image_path, "image": image}
|
|
|
|
| 118 |
word=item['text']
|
| 119 |
ner_tags.append(labels)
|
| 120 |
words.append(word)
|
| 121 |
+
bboxes.append(normalize_bbox(item['box'],size))
|
| 122 |
#for item in data['annotations']:
|
| 123 |
#bbox=item['bbox']
|
| 124 |
+
|
| 125 |
|
| 126 |
yield guid, {"id": str(guid), "words": words , "bboxes": bboxes, "ner_tags": ner_tags, "image_path": image_path, "image": image}
|