Datasets:
fix: script
Browse files- basketball_tracking.py +9 -2
basketball_tracking.py
CHANGED
|
@@ -62,8 +62,12 @@ class BasketballTracking(datasets.GeneratorBasedBuilder):
|
|
| 62 |
|
| 63 |
for idx, ((image_path, image),
|
| 64 |
(mask_path, mask)) in enumerate(zip(images, boxes)):
|
|
|
|
| 65 |
yield idx, {
|
| 66 |
-
'
|
|
|
|
|
|
|
|
|
|
| 67 |
"image": {
|
| 68 |
"path": image_path,
|
| 69 |
"bytes": image.read()
|
|
@@ -72,5 +76,8 @@ class BasketballTracking(datasets.GeneratorBasedBuilder):
|
|
| 72 |
"path": mask_path,
|
| 73 |
"bytes": mask.read()
|
| 74 |
},
|
| 75 |
-
'
|
|
|
|
|
|
|
|
|
|
| 76 |
}
|
|
|
|
| 62 |
|
| 63 |
for idx, ((image_path, image),
|
| 64 |
(mask_path, mask)) in enumerate(zip(images, boxes)):
|
| 65 |
+
file_name = '/'.join(image_path.split('/')[-2:])
|
| 66 |
yield idx, {
|
| 67 |
+
'image_id':
|
| 68 |
+
annotations_df.loc[
|
| 69 |
+
annotations_df['image_name'] == file_name]
|
| 70 |
+
['image_id'].values[0],
|
| 71 |
"image": {
|
| 72 |
"path": image_path,
|
| 73 |
"bytes": image.read()
|
|
|
|
| 76 |
"path": mask_path,
|
| 77 |
"bytes": mask.read()
|
| 78 |
},
|
| 79 |
+
'shapes':
|
| 80 |
+
annotations_df.loc[
|
| 81 |
+
annotations_df['image_name'] == file_name]
|
| 82 |
+
['shapes'].values[0]
|
| 83 |
}
|