Code Monkey home page Code Monkey logo

Comments (2)

moonbings avatar moonbings commented on July 28, 2024 3

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.

chars = utils.split_text(label, reorder=True)

chars = utils.split_text(label, reorder=True)

# 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.

Mahmuod1 avatar Mahmuod1 commented on July 28, 2024

thanks a lot for your fast replaying and your instructions

from synthtiger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.