jaradat commited on
Commit
6cfe7da
·
1 Parent(s): a63a31d

Update pidray-semantics.py

Browse files
Files changed (1) hide show
  1. pidray-semantics.py +12 -1
pidray-semantics.py CHANGED
@@ -75,7 +75,8 @@ class pidraySemantics(datasets.GeneratorBasedBuilder):
75
  """This function returns the examples in the raw (text) form."""
76
  idx = 0
77
  # iterate through images
78
- for filepath, image, filepath2, image2 in (images, label):
 
79
 
80
  yield idx, {
81
  "pixel_values": {"path": filepath, "bytes": image.read()},
@@ -83,3 +84,13 @@ class pidraySemantics(datasets.GeneratorBasedBuilder):
83
  #"label": {"path": label[idx]['path'], "bytes": label[idx]['bytes'].read()},
84
  }
85
  idx += 1
 
 
 
 
 
 
 
 
 
 
 
75
  """This function returns the examples in the raw (text) form."""
76
  idx = 0
77
  # iterate through images
78
+ '''
79
+ for filepath, image in zip(images, label):
80
 
81
  yield idx, {
82
  "pixel_values": {"path": filepath, "bytes": image.read()},
 
84
  #"label": {"path": label[idx]['path'], "bytes": label[idx]['bytes'].read()},
85
  }
86
  idx += 1
87
+ '''
88
+ for var1, var2 in zip(images, label):
89
+
90
+ yield idx, {
91
+ "pixel_values": {"path": var1['filepath'], "bytes": var1['image'].read()},
92
+ "label": {"path": var2['filepath'], "bytes": var2['image'].read()},
93
+ #"label": {"path": label[idx]['path'], "bytes": label[idx]['bytes'].read()},
94
+ }
95
+ idx += 1
96
+