pixxu commited on
Commit
5a6fbb7
·
verified ·
1 Parent(s): 853299e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +24 -1
README.md CHANGED
@@ -45,7 +45,7 @@ from datasets import load_dataset
45
  from PIL import Image
46
  from io import BytesIO
47
 
48
- dataset = load_dataset("pixxu/ViTextRender-500K")
49
  print(dataset)
50
 
51
  # Access a sample
@@ -59,6 +59,29 @@ img.show()
59
  # display(img)
60
  ```
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  ## Applications
63
 
64
  - Fine-tuning text-to-image models for better text rendering on Vietnamese language.
 
45
  from PIL import Image
46
  from io import BytesIO
47
 
48
+ dataset = load_dataset("pixxu/ViTextRender-500K") #Whole dataset include simple & complex images
49
  print(dataset)
50
 
51
  # Access a sample
 
59
  # display(img)
60
  ```
61
 
62
+ If you want to load only simple or complex images:
63
+
64
+ ```python
65
+ from datasets import load_dataset
66
+ from PIL import Image
67
+ from io import BytesIO
68
+
69
+ dataset = load_dataset("pixxu/ViTextRender-500K", name="simple", split="train") #For simple images
70
+ # For complex images, use: dataset = load_dataset("pixxu/ViTextRender-500K", name="complex", split="train")
71
+ print(dataset)
72
+
73
+ # Access a sample
74
+ sample = dataset[0]
75
+ print(sample['text'])
76
+ img = Image.open(BytesIO(sample['image']))
77
+ img.show()
78
+
79
+ # If you use Google Colab
80
+ # img = Image.open(BytesIO(sample['image'])).convert("RGB")
81
+ # display(img)
82
+ ```
83
+
84
+
85
  ## Applications
86
 
87
  - Fine-tuning text-to-image models for better text rendering on Vietnamese language.