alkzar90 commited on
Commit
4a804e2
1 Parent(s): 7376c1e

Add condition to check if an image path belong to train-val-set

Browse files
Files changed (1) hide show
  1. NIH-Chest-X-ray-dataset.py +1 -2
NIH-Chest-X-ray-dataset.py CHANGED
@@ -113,8 +113,7 @@ class XChest(datasets.GeneratorBasedBuilder):
113
  logger.info(f"Batch for data_files: {batch}")
114
  path_files = dl_manager.iter_files(batch)
115
  for img in path_files:
116
- print(img)
117
- if img in train_val_list:
118
  train_files.append(img)
119
  else:
120
  test_files.append(img)
 
113
  logger.info(f"Batch for data_files: {batch}")
114
  path_files = dl_manager.iter_files(batch)
115
  for img in path_files:
116
+ if img.split('/')[-1] in train_val_list:
 
117
  train_files.append(img)
118
  else:
119
  test_files.append(img)