Comments (1)
@yingning
I was trying to make from my own modification too (based on ankush-me/SynthText).
Here are some tips:
- Prepair your own fonts, and put it in
data/font/
, adding them in thefontlist.txt
- Modify the
data/models/font_px2pt.cp
. This is a pickle file of adict
object. You know what key to add once you got a error aboutkey not found
. text_utils.py
, line 518. This should be the__init__
ofTextSource
class. You should changewith open(fn, 'r') as f:
towith open(fc, 'r', encoding='utf8')
. Maybe it won't be 'utf8' for Arabic, I don't know.- Add your own text in
data/newsgroup/newsgroup.txt
. It is lines of text where words are separated by space. There is a little problem with Chinese for that words are not separated by space in Chinsese. I don't know how Arabic works, but be careful with it. text_utils.py
, line 130, there should be something likeline_bounds = font.get_rect...
. I got an errorglyph not found for id 3
here. The reason seems to be that additional space is add round the text inlines
. So I addline = lines[np.argmax(lengths)].strip()
to fix it. But I still don't understand why space matters. Maybe something is wrong with the fonts file.
That's all I do to make it work for Chinese. Just run it over and over again along with bug fixing.
from synthtext_chinese_version.
Related Issues (20)
- 请问代码在GPU环境下能加速么?还是仅仅需要CPU运行? HOT 1
- The text is mirrored.
- Time out, problem. Only get frame on picture not text
- ValueError: conversion from RGB to HSV not supported
- 请问支持python3吗?
- 用自己的深度图合成
- about dataset
- For help how to run the code. HOT 1
- 'NoneType' object is not subscriptable
- opencv error HOT 2
- 合成样本时有些汉字生成不出来 HOT 2
- Font with shadow
- No module named multiarray
- 如何合成文档文字图片,而不是自然场景背景图片 HOT 2
- UnicodeDecodeError:'utf-8' codec can't decode byte 0xab in position 45:invalide start byte HOT 4
- argument 2 must be sequence of length 2, not 3
- TypeError: 'numpy.float64' object cannot be interpreted as an integer
- what
- UnicodeDecodeError: 'ascii' codec can't decode byte 0xf7 in position 2: ordinal not in range(128) HOT 1
- operands could not be broadcast together with shapes HOT 9
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 synthtext_chinese_version.