a-alnaggar commited on
Commit
369c0cf
·
verified ·
1 Parent(s): 5e94a35

Update khatt-paragraphs.py

Browse files
Files changed (1) hide show
  1. khatt-paragraphs.py +2 -2
khatt-paragraphs.py CHANGED
@@ -55,9 +55,9 @@ class KhattPara(datasets.GeneratorBasedBuilder):
55
  for idx, (filepath, image) in enumerate(images):
56
  text_path = os.path.join("proc_text", str(os.path.basename(filepath)[:-4] + ".txt"))
57
  text = self.read_arabic_text_file(os.path.join(text_archive_path,text_path))
58
- print(type(image))
59
  yield idx, {
60
- "image": {"path": filepath, "bytes": io.BytesIO(ImageOps.invert(Image.open(io.BytesIO(image)).convert("RGB")))},
61
  "text": text,
62
  }
63
 
 
55
  for idx, (filepath, image) in enumerate(images):
56
  text_path = os.path.join("proc_text", str(os.path.basename(filepath)[:-4] + ".txt"))
57
  text = self.read_arabic_text_file(os.path.join(text_archive_path,text_path))
58
+
59
  yield idx, {
60
+ "image": {"path": filepath, "bytes": image.read()},
61
  "text": text,
62
  }
63