alkzar90 commited on
Commit
ae09461
1 Parent(s): 111c532

Update CC6204-Hackaton-Cub-Dataset.py

Browse files
Files changed (1) hide show
  1. CC6204-Hackaton-Cub-Dataset.py +3 -2
CC6204-Hackaton-Cub-Dataset.py CHANGED
@@ -60,7 +60,7 @@ for row in train_test_split:
60
  idx, train_bool = row.split(" ")
61
  # 1: train, 0: test
62
  if train_bool == "1":
63
- _TRAIN_IDX_SET.add(idx)
64
 
65
 
66
  class CubDataset(datasets.GeneratorBasedBuilder):
@@ -93,7 +93,8 @@ class CubDataset(datasets.GeneratorBasedBuilder):
93
  path_files = dl_manager.iter_files(batch)
94
  for img in path_files:
95
  logger.info(f"img: {img}")
96
- if _IMGNAME2ID[os.path.basename(img)] in _TRAIN_IDX_SET:
 
97
  train_files.append(img)
98
  else:
99
  test_files.append(img)
 
60
  idx, train_bool = row.split(" ")
61
  # 1: train, 0: test
62
  if train_bool == "1":
63
+ _TRAIN_IDX_SET.add([idx])
64
 
65
 
66
  class CubDataset(datasets.GeneratorBasedBuilder):
 
93
  path_files = dl_manager.iter_files(batch)
94
  for img in path_files:
95
  logger.info(f"img: {img}")
96
+ img_idx = _IMGNAME2ID[os.path.basename(img)]
97
+ if img_idx in _TRAIN_IDX_SET:
98
  train_files.append(img)
99
  else:
100
  test_files.append(img)