ziq commited on
Commit
0a92020
·
1 Parent(s): 24b5b70

Update RSNA-ATD2023.py

Browse files
Files changed (1) hide show
  1. RSNA-ATD2023.py +6 -6
RSNA-ATD2023.py CHANGED
@@ -62,17 +62,17 @@ class RSNAATD(datasets.GeneratorBasedBuilder):
62
  ),
63
  ]
64
 
65
- def sort_key(self, x):
66
- patient_id, series_id, frame_id = (
67
- x[0][0].replace("images/", "").replace(".png", "").split("_")
68
- )
69
- return int(patient_id), int(series_id), int(frame_id)
70
 
71
  def _generate_examples(self, images, masks, metadata):
72
  df = pd.read_csv(metadata)
73
 
74
  for idx, ((image_path, image), (mask_path, mask)) in enumerate(
75
- sorted(zip(images, masks), key=self.sort_key)
76
  ):
77
  row = df.loc[df["path"] == image_path.lower().replace("images/", "")]
78
 
 
62
  ),
63
  ]
64
 
65
+ # def sort_key(self, x):
66
+ # patient_id, series_id, frame_id = (
67
+ # x[0][0].replace("images/", "").replace(".png", "").split("_")
68
+ # )
69
+ # return int(patient_id), int(series_id), int(frame_id)
70
 
71
  def _generate_examples(self, images, masks, metadata):
72
  df = pd.read_csv(metadata)
73
 
74
  for idx, ((image_path, image), (mask_path, mask)) in enumerate(
75
+ zip(images, masks)
76
  ):
77
  row = df.loc[df["path"] == image_path.lower().replace("images/", "")]
78