Datasets:
ivelin
commited on
Commit
·
20d8a42
1
Parent(s):
98fe10f
fix: error when saving multible labels for the same image
Browse files- ui_refexp.py +2 -1
ui_refexp.py
CHANGED
@@ -233,10 +233,11 @@ class UIRefExp(datasets.GeneratorBasedBuilder):
|
|
233 |
if image_id:
|
234 |
image_id = image_id.group(1)
|
235 |
if image_id in files_to_keep:
|
|
|
236 |
for labels in image_labels[image_id]:
|
237 |
bb_json = json.dumps(labels["target_bounding_box"])
|
238 |
yield _id, {
|
239 |
-
"image": {"path": file_path, "bytes":
|
240 |
"image_id": image_id,
|
241 |
"image_file_path": file_path,
|
242 |
"prompt": labels["prompt"],
|
|
|
233 |
if image_id:
|
234 |
image_id = image_id.group(1)
|
235 |
if image_id in files_to_keep:
|
236 |
+
image_bytes = file_obj.read()
|
237 |
for labels in image_labels[image_id]:
|
238 |
bb_json = json.dumps(labels["target_bounding_box"])
|
239 |
yield _id, {
|
240 |
+
"image": {"path": file_path, "bytes": image_bytes},
|
241 |
"image_id": image_id,
|
242 |
"image_file_path": file_path,
|
243 |
"prompt": labels["prompt"],
|