ppp121386 commited on
Commit
f85133e
·
1 Parent(s): ecf98d1

Update Image-demo.py

Browse files
Files changed (1) hide show
  1. Image-demo.py +2 -2
Image-demo.py CHANGED
@@ -57,10 +57,10 @@ class ImageSet(datasets.GeneratorBasedBuilder):
57
  def _generate_examples(self, images, filepath):
58
  """ This function returns the examples in the raw (text) form."""
59
  _CAPTION = json.load(open(filepath, 'r'))
60
- for idx, (filepath, image) in enumerate(images):
61
  # description = filepath.split('/')[-1][:-4]
62
  # description = description.replace('_', ' ')
63
  yield idx, {
64
- "image": {"path": filepath, "bytes": image.read()},
65
  "text": _CAPTION[idx],
66
  }
 
57
  def _generate_examples(self, images, filepath):
58
  """ This function returns the examples in the raw (text) form."""
59
  _CAPTION = json.load(open(filepath, 'r'))
60
+ for idx, (imgpath, image) in enumerate(images):
61
  # description = filepath.split('/')[-1][:-4]
62
  # description = description.replace('_', ' ')
63
  yield idx, {
64
+ "image": {"path": imgpath, "bytes": image.read()},
65
  "text": _CAPTION[idx],
66
  }