Comments (2)
First you need to prepare Arabic corpus file and font files.
Put text file (.txt) in resources/corpus
path and font files (.ttf) in resources/font
path.
Next, run font preprocessing script.
python tools/extract_font_charset.py -w 4 resources/font
And then, you need to edit config file.
Change corpus file path to prepared corpus file path.
https://github.com/clovaai/synthtiger/blob/master/examples/synthtiger/config_horizontal.yaml#L14-L15
- paths: [resources/corpus/arabic.txt]
weights: [1]
You can change other parameter values (e.g. min_length: null
, max_length: null
, augmentation: 0
).
Finally, run this command to generate the Arabic dataset.
synthtiger -o results -w 4 -v examples/synthtiger/template.py SynthTiger examples/synthtiger/config_horizontal.yaml
NOTE:
Arial
font is good for generating Arabic text images. But, other Arabic fonts may not be supported.
This problem is related to SynthTiger.
If you want to use other Arabic fonts now, you should change code as below (172, 196 line in template.py
).
Note that if you change this code, you can't render curved text.
synthtiger/examples/synthtiger/template.py
Line 172 in 87f6de8
synthtiger/examples/synthtiger/template.py
Line 196 in 87f6de8
# chars = utils.split_text(label, reorder=True)
chars = [label]
And then, run this command to generate the Arabic dataset.
python -m synthtiger -o results -w 4 -v examples/synthtiger/template.py SynthTiger examples/synthtiger/config_horizontal.yaml
from synthtiger.
thanks a lot for your fast replaying and your instructions
from synthtiger.
Related Issues (20)
- Why the value of mask is between 0 and 255 for foreground stroke?
- Improving documentation
- Issue with synthtiger_v1.1.zip HOT 1
- ERROR in Generating Greek language images HOT 6
- How to choose background?
- The coords.txt file created after generating the images is not very interpretable. I can understand a 4-point coordinate system.
- The coords.txt file created after generating the images is not very interpretable. HOT 1
- Vertical, Horizontal, Inverted, Curved images
- Thanks you
- RuntimeError when draw sample with backslash HOT 2
- Images having characters with different font size
- Text rotation
- How to get object of cv2/pillow for the generate image?
- Slow creation for single page.
- Is there any way (templates) to generate book pages?
- Is there any way to gengerate multiline datas with various backgrounds(not white) and styles?
- 'FreeTypeFont' object has no attribute 'getsize' HOT 2
- Add new Pillow support?
- Specify text from right to left
- Characters are being cut
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from synthtiger.