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

Update pidray-semantics.py

Browse files
Files changed (1) hide show
  1. pidray-semantics.py +2 -12
pidray-semantics.py CHANGED
@@ -75,8 +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
- '''
79
- for filepath, image in zip(images, label):
80
 
81
  yield idx, {
82
  "pixel_values": {"path": filepath, "bytes": image.read()},
@@ -84,13 +84,3 @@ class pidraySemantics(datasets.GeneratorBasedBuilder):
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
-
 
75
  """This function returns the examples in the raw (text) form."""
76
  idx = 0
77
  # iterate through images
78
+
79
+ for (filepath, image), (filepath2, image2) 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