这个项目是基于开源项目https://github.com/ankush-me/SynthText修改的
This project is based on the open-source project https://github.com/ankush-me/SynthText
原项目仅仅提供英文的文字的生成
It only provides the method to generate English text images in the original project
我在这里增加了中文的生成方法,添加了中文字库
I add the method to generate Chinese ones.
以及在cut.py中,会将文字裁剪出来,并且将其对应的label保存下来
cut.py can cut text out as isolate images and save their corresponding labels.
裁剪好的样例图片存放在cut-pics压缩包中
Sample cut-out images could be seen in tar "cut-pics"
-By CatWang
以下原内容
#SynthText
Code for generating synthetic text images as described in ["Synthetic Data for Text Localisation in Natural Images", Ankush Gupta, Andrea Vedaldi, Andrew Zisserman, CVPR 2016](http://www.robots.ox.ac.uk/~vgg/data/scenetext/).
**Synthetic Scene-Text Image Samples**
![Synthetic Scene-Text Samples](samples.png "Synthetic Samples")
The library is written in Python. The main dependencies are:
```
pygame, opencv (cv2), PIL (Image), numpy, matplotlib, h5py, scipy
```
###Generating samples
```
python gen.py --viz
```
This will download a data file (~56M) to the `data` directory. This data file includes:
- **dset.h5**: This is a sample h5 file which contains a set of 5 images along with their depth and segmentation information. Note, this is just given as an example; you are encouraged to add more images (along with their depth and segmentation information) to this database for your own use.
- **data/fonts**: three sample fonts (add more fonts to this folder and then update `fonts/fontlist.txt` with their paths).
- **data/newsgroup**: Text-source (from the News Group dataset). This can be subsituted with any text file. Look inside `text_utils.py` to see how the text inside this file is used by the renderer.
- **data/models/colors_new.cp**: Color-model (foreground/background text color model), learnt from the IIIT-5K word dataset.
- **data/models**: Other cPickle files (**char\_freq.cp**: frequency of each character in the text dataset; **font\_px2pt.cp**: conversion from pt to px for various fonts: If you add a new font, make sure that the corresponding model is present in this file, if not you can add it by adapting `invert_font_size.py`).
This script will generate random scene-text image samples and store them in an h5 file in `results/SynthText.h5`. If the `--viz` option is specified, the generated output will be visualized as the script is being run; omit the `--viz` option to turn-off the visualizations. If you want to visualize the results stored in `results/SynthText.h5` later, run:
```
python visualize_results.py
```
### Pre-generated Dataset
A dataset with approximately 800000 synthetic scene-text images generated with this code can be found [here](http://www.robots.ox.ac.uk/~vgg/data/scenetext/).
### Further Information
Please refer to the paper for more information, or contact me (email address in the paper).
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
一个比较复杂的生成真实场景文字的Python项目。原项目只能生成英文。 经过修改之后能够生成中文。 并且我也添加了图片中文字的切割和对应label的保存代码。 软件开发设计:应用软件开发、系统软件开发、移动应用开发、网站开发C++、Java、python、web、C#等语言的项目开发与学习资料 硬件与设备:单片机、EDA、proteus、RTOS、包括计算机硬件、服务器、网络设备、存储设备、移动设备等 操作系统:LInux、树莓派、安卓开发、微机操作系统、网络操作系统、分布式操作系统等。此外,还有嵌入式操作系统、智能操作系统等。 网络与通信:数据传输、信号处理、网络协议、网络与通信硬件、网络安全网络与通信是一个非常广泛的领域,它涉及到计算机科学、电子工程、数学等多个学科的知识。 云计算与大数据:包括云计算平台、大数据分析、人工智能、机器学习等,云计算是一种基于互联网的计算方式,通过这种方式,共享的软硬件资源和信息可以按需提供给计算机和其他设备。
资源推荐
资源详情
资源评论
收起资源包目录
一个比较复杂的生成真实场景文字的Python项目。原项目只能生成英文。 经过修改之后能够生成中文。 并且我也添加了图片中文字的切割和对应label的保存代码。.zip (63个子文件)
222
samples.png 708KB
visualize_results.py 2KB
data
newsgroup
data 11.97MB
._newsgroup.txt 171B
.r 0B
models
.DS_Store 6KB
colors_new.cp 1.46MB
font_px2pt.cp 79KB
._.DS_Store 120B
char_freq.cp 4KB
dset.h5 20.01MB
fonts
ubuntu
3.ttf 14.03MB
5.ttf 14.01MB
Ubuntu-Bold-BK.ttf 326KB
2.ttf 11.73MB
1.ttf 10.58MB
Ubuntu-Bold.ttf 10.58MB
4.ttf 14.35MB
ubuntumono
UbuntuMono-Regular-bbb.ttf 201KB
微软vista楷体2.ttf 11.73MB
UbuntuMono-Regular.ttf 10.58MB
UbuntuMono-Regular-Bk.ttf 14.03MB
微软vista雅黑.ttf 14.35MB
微软vista雅黑Bold.ttf 14.01MB
fontlist.txt 101B
ubuntucondensed
3.ttf 14.03MB
5.ttf 14.01MB
UbuntuCondensed-Regular-BK.ttf 342KB
2.ttf 11.73MB
1.ttf 10.58MB
UbuntuCondensed-Regular.ttf 11.73MB
4.ttf 14.35MB
text_utils.py 23KB
README-CatWang~ 683B
poisson_reconstruct.py 7KB
.idea
SynthText.iml 568B
vcs.xml 180B
workspace.xml 49KB
misc.xml 798B
inspectionProfiles
Project_Default.xml 562B
profiles_settings.xml 235B
modules.xml 270B
cut.py 5KB
ransac.py 3KB
demo_image
2.jpg 2KB
6.jpg 1KB
1.jpg 1KB
5.jpg 1KB
0.jpg 1KB
8.jpg 1KB
3.jpg 2KB
7.jpg 2KB
4.jpg 2KB
colorize3_poisson.py 17KB
common.py 1KB
synth_utils.py 9KB
synthgen.py 24KB
gen.py 4KB
.gitignore 1KB
README.md~ 3KB
results
.r 0B
README.md 3KB
invert_font_size.py 699B
共 63 条
- 1
资源评论
妄北y
- 粉丝: 1w+
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功