fix: pd bug
Browse files- pose_estimation.py +7 -3
pose_estimation.py
CHANGED
@@ -58,9 +58,11 @@ class PoseEstimation(datasets.GeneratorBasedBuilder):
|
|
58 |
annotations_df = pd.read_csv(annotations, sep=',')
|
59 |
for idx, ((image_path, image),
|
60 |
(mask_path, mask)) in enumerate(zip(images, masks)):
|
61 |
-
int(image_path.
|
62 |
yield idx, {
|
63 |
-
'image_id':
|
|
|
|
|
64 |
"image": {
|
65 |
"path": image_path,
|
66 |
"bytes": image.read()
|
@@ -69,5 +71,7 @@ class PoseEstimation(datasets.GeneratorBasedBuilder):
|
|
69 |
"path": mask_path,
|
70 |
"bytes": mask.read()
|
71 |
},
|
72 |
-
'shapes':
|
|
|
|
|
73 |
}
|
|
|
58 |
annotations_df = pd.read_csv(annotations, sep=',')
|
59 |
for idx, ((image_path, image),
|
60 |
(mask_path, mask)) in enumerate(zip(images, masks)):
|
61 |
+
file_name = int(image_path.split('.')[0].split('/')[-1])
|
62 |
yield idx, {
|
63 |
+
'image_id':
|
64 |
+
annotations_df.loc[annotations_df['image_id'] == file_name]
|
65 |
+
['image_id'].values[0],
|
66 |
"image": {
|
67 |
"path": image_path,
|
68 |
"bytes": image.read()
|
|
|
71 |
"path": mask_path,
|
72 |
"bytes": mask.read()
|
73 |
},
|
74 |
+
'shapes':
|
75 |
+
annotations_df.loc[annotations_df['image_id'] == file_name]
|
76 |
+
['shapes'].values[0],
|
77 |
}
|