NawinCom commited on
Commit
36e11cd
·
1 Parent(s): 4ca34e9

Update CommyTesting.py

Browse files
Files changed (1) hide show
  1. CommyTesting.py +5 -5
CommyTesting.py CHANGED
@@ -24,7 +24,7 @@ train = pd.read_csv('Train.csv')
24
  lis1 = train['id_code']
25
  lis2 = train['diagnosis']
26
  dic = dict(zip(lis1, lis2))
27
- classes = [0] * 4209
28
 
29
  # TODO: Name of the dataset usually matches the script name with CamelCase instead of snake_case
30
  class ImagesDemo(datasets.GeneratorBasedBuilder):
@@ -71,12 +71,12 @@ class ImagesDemo(datasets.GeneratorBasedBuilder):
71
 
72
  # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
73
  def _generate_examples(self, images):
74
- idx = 0
75
  for filepath, image in images:
76
  print(filepath)
77
- # check = filepath.split('/')[-1].replace('.jpg', '')
78
  yield idx, {
79
  "image" : {"path": filepath, "bytes": image.read()},
80
- "label" : classes[idx]
81
  }
82
- idx+=1
 
24
  lis1 = train['id_code']
25
  lis2 = train['diagnosis']
26
  dic = dict(zip(lis1, lis2))
27
+ # classes = [0] * 4209
28
 
29
  # TODO: Name of the dataset usually matches the script name with CamelCase instead of snake_case
30
  class ImagesDemo(datasets.GeneratorBasedBuilder):
 
71
 
72
  # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
73
  def _generate_examples(self, images):
74
+ # idx = 0
75
  for filepath, image in images:
76
  print(filepath)
77
+ check = filepath.split('/')[-1].replace('.jpg', '')
78
  yield idx, {
79
  "image" : {"path": filepath, "bytes": image.read()},
80
+ "label" : dic[check]
81
  }
82
+ # idx+=1