Vadzim Kashko commited on
Commit
6067c9e
1 Parent(s): ed2b499

fix: pd bug

Browse files
Files changed (1) hide show
  1. 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.rsplit('/', 1)[-1].split('.')[0])
62
  yield idx, {
63
- 'image_id': annotations_df['image_id'].iloc[file_name],
 
 
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': annotations_df['shapes'].iloc[file_name]
 
 
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
  }