Datasets:
ivelin
commited on
Commit
·
98fe10f
1
Parent(s):
08d324d
fix: add more metadata for images
Browse filesSigned-off-by: ivelin <[email protected]>
- ui_refexp.py +6 -2
ui_refexp.py
CHANGED
|
@@ -138,7 +138,9 @@ class UIRefExp(datasets.GeneratorBasedBuilder):
|
|
| 138 |
def _info(self):
|
| 139 |
features = datasets.Features(
|
| 140 |
{
|
| 141 |
-
"
|
|
|
|
|
|
|
| 142 |
# click the search button next to menu drawer at the top of the screen
|
| 143 |
"prompt": datasets.Value("string"),
|
| 144 |
# json: {xmin, ymin, xmax, ymax}, normalized screen reference values between 0 and 1
|
|
@@ -234,7 +236,9 @@ class UIRefExp(datasets.GeneratorBasedBuilder):
|
|
| 234 |
for labels in image_labels[image_id]:
|
| 235 |
bb_json = json.dumps(labels["target_bounding_box"])
|
| 236 |
yield _id, {
|
| 237 |
-
"
|
|
|
|
|
|
|
| 238 |
"prompt": labels["prompt"],
|
| 239 |
"target_bounding_box": bb_json
|
| 240 |
}
|
|
|
|
| 138 |
def _info(self):
|
| 139 |
features = datasets.Features(
|
| 140 |
{
|
| 141 |
+
"image": datasets.Image(),
|
| 142 |
+
"image_id": datasets.Value("string"),
|
| 143 |
+
"image_file_path": datasets.Value("string"),
|
| 144 |
# click the search button next to menu drawer at the top of the screen
|
| 145 |
"prompt": datasets.Value("string"),
|
| 146 |
# json: {xmin, ymin, xmax, ymax}, normalized screen reference values between 0 and 1
|
|
|
|
| 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": file_obj.read()},
|
| 240 |
+
"image_id": image_id,
|
| 241 |
+
"image_file_path": file_path,
|
| 242 |
"prompt": labels["prompt"],
|
| 243 |
"target_bounding_box": bb_json
|
| 244 |
}
|