alkzar90 commited on
Commit
4767376
1 Parent(s): ae09461

Update CC6204-Hackaton-Cub-Dataset.py

Browse files
Files changed (1) hide show
  1. CC6204-Hackaton-Cub-Dataset.py +4 -2
CC6204-Hackaton-Cub-Dataset.py CHANGED
@@ -53,14 +53,16 @@ for row in imgpath_to_ids:
53
 
54
  # Create TRAIN_IDX_SET
55
  train_test_split = get(_URLS["train_test_split"]).iter_lines()
56
- _TRAIN_IDX_SET = set()
57
  for row in train_test_split:
58
  row = row.decode("UTF8")
59
  if row != "":
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):
 
53
 
54
  # Create TRAIN_IDX_SET
55
  train_test_split = get(_URLS["train_test_split"]).iter_lines()
56
+ _TRAIN_IDX_SET = []
57
  for row in train_test_split:
58
  row = row.decode("UTF8")
59
  if row != "":
60
  idx, train_bool = row.split(" ")
61
  # 1: train, 0: test
62
  if train_bool == "1":
63
+ _TRAIN_IDX_SET.append(idx)
64
+
65
+ _TRAIN_IDX_SET = set(_TRAIN_IDX_SET)
66
 
67
 
68
  class CubDataset(datasets.GeneratorBasedBuilder):