From 9802b9340dd45ee133620dcd60c344423d2d7ae4 Mon Sep 17 00:00:00 2001 From: weishengyu Date: Tue, 15 Dec 2020 23:30:03 +0800 Subject: [PATCH] update doc --- StyleText/README_ch.md | 23 ++++++++++++++--------- StyleText/doc/images/7.jpg | Bin 0 -> 1819 bytes StyleText/doc/images/8.jpg | Bin 0 -> 1306 bytes 3 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 StyleText/doc/images/7.jpg create mode 100644 StyleText/doc/images/8.jpg diff --git a/StyleText/README_ch.md b/StyleText/README_ch.md index 9f628686..9a8eb2d2 100644 --- a/StyleText/README_ch.md +++ b/StyleText/README_ch.md @@ -5,7 +5,7 @@ - [二、环境配置](#环境配置) - [三、快速上手](#快速上手) - [四、应用案例](#应用案例) -- [五、项目结构](#项目结构) +- [五、代码结构](#代码结构) ### 一、工具简介 @@ -54,14 +54,15 @@ fusion_generator: ### 三、快速上手 -- 合成单张图 -运行tools/synth_image,合成单张图片: +#### 合成单张图 +输入一张风格图和一段文字语料,运行tools/synth_image,合成单张图片: ```python python3 -m tools.synth_image -c configs/config.yml --style_image examples/style_images/2.jpg --text_corpus PaddleOCR --language en ``` +* 注意:语言选项和语料相对应,目前我们支持英文、简体中文和韩语。 例如,输入如下图片和语料"PaddleOCR":
- +
得到结果fake_fusion.jpg:
@@ -69,11 +70,15 @@ python3 -m tools.synth_image -c configs/config.yml --style_image examples/style_
除此之外,程序还会生成并保存中间结果: * `fake_bg.jpg`:为风格参考图去掉文字后的背景; +
+ +
* `fake_text.jpg`:是用提供的字符串,仿照风格参考图中文字的风格,生成在灰色背景上的文字图片。 +
+ +
- * 注意:语言选项和语料相对应,目前我们支持英文、简体中文和韩语。 - -- 批量合成 +#### 批量合成 在实际应用场景中,经常需要批量合成图片,补充到训练集中。StyleText可以使用一批风格图片和语料,批量合成数据。合成过程如下: 首先,需要风格图片作为合成图片的参考依据,这些数据可以是用作训练OCR识别模型的数据集。本例中使用带有标注文件的数据集作为风格图片. @@ -121,8 +126,8 @@ python3 -m tools.synth_image -c configs/config.yml --style_image examples/style_ | 随机背景 | 韩语 | 5631 | 1230 | 0.3012 | 100000 | 0.5057 | 20% | - -### 五、项目结构 + +### 五、代码结构 ``` style_text_rec |-- arch diff --git a/StyleText/doc/images/7.jpg b/StyleText/doc/images/7.jpg new file mode 100644 index 0000000000000000000000000000000000000000..60a4e0ee6ae3d42cc43c43747d72a837bc170f9d GIT binary patch literal 1819 zcmbV}X;ji#7{>qb7Z5WGwNT3}!!oT*rBX{R7g8H74O}uO(@c>T!!0qV&}<kc-&2XtiL)n%%!iqI?zzvo_uTj1^Zf2B@07m<7Q5kG zaR3AY01(9hI>A= zl^f+FKdwSyAP7@Kz!Bd|{*%dH04P;J2cUouLja0`fGCJu02nB8!oJ5-g#9516jXu1 z5sDZK6b0pr74bn(5gMjQtf)>cJr34R@OF-PR_VpF0O9-@C0ukU%&mqheM8ph7rRfqoQMC zPsLG^&Ly9}aPbn2m6m?>TE_JoH*eqJJHMOQEQ> zt-YhOtGj>T-Qaui(D2CU#AoTGY-)ODc23C!0l*(v3jaqgl!6PY>;Xc_1%bvYCWumj ztulve?({?)I;mx7K~>duV6uz($kmo!<4c0bEow_K*nXo4CE9nge+QQMzsUXq`z4Djp%0@ntUQODrDy{5(b7Y75r&_KYxHn!X z2VlbwiD9cNs6kSl<#(+yb3=52Pk^@B!qN<;Tkk`Bh@cAXc^NG;4oV!z7aDDGDOIYsx&CL-aIw;OQHuE7nYPB)XI9^ zi{~BgFpVir>?SlawoPNGvA#zdArz_XOKgAoTR=cqE&~5RXnrx z*khj@_}ZwLp0Fp>JT=d8&E#In`Ms3TD&MDVw|5Agt1zs#eM5 zk;iRiT^J4F=>bgrA^PYh?pjVAh2>W0Z<@P$M}6l<=wzEH{b%VTI6D!6O$cCzW!c>-a6ML38*Nl62zhAy z6Wz`aomljNnL@BGm#9B&l4AG`ns2rE&6^Py(SNiFyvNPDB&fqws&(irStB9BzP^w> z@J7w*&B@pb$A)|$a9W>Kav)>c%Q`6gOAuOzTsLHa=(CF9g%l9``&cB_0mpEkn;lUSUu&W!CTLu*mu7_Z@Rl z7CP^a7KASIkqv&fnYQcI#)|~_TRt0v7fRh@(9S}t;RrWQTPq`Q8So_=AqVbrT920v z=aGD6Fin#&MxI8~srt1!fpJ(*@4;LN_5sgA%wb&)S<{Z~)M?ya@={l-=i;(4!C`8} z(CcDZLkp#b7@Q!WN|){h$pAnv^Yk?l#=0L5D8KA~U9&cH`pzbod{#B=rsYhg@mJGD zKBA;XqXzd#6YxrJK-`TF*~l8ZbWe}MLY8YRmMhuz+%c#9K6ZFDQx2R;GpOWCnZuhr za0v;{eeNLaIclNR3W!rkf4X`KJz{6`Ls?;b!v?+4G5`Ey>18ZSb4@c$=3I+&bW1u*@$V}O IugJUp1V~*idjJ3c literal 0 HcmV?d00001 diff --git a/StyleText/doc/images/8.jpg b/StyleText/doc/images/8.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fbed5a7bb5368090e612933bba8f57ec1a74a4c4 GIT binary patch literal 1306 zcmex=iF;N$`UAd82aiwDF383NJD#LCRf%Eivc4pu@E@&5pWAP0j4LlrZl5(ASU zBeNjm|04|YKzFi&odL?6mQqXwbzED#l4gO`Kd};u4Zls%q*Qnp!5NX66=_R?aT2 zZtfnQUcn)uVc`*xQOPN(Y3Ui6S;Zx#W#tu>Rn0A}ZS5VMU6UqHnL2IyjG40*Enc#8 z+42=DS8dw7W$U)>J9h3mboj{8W5-XNJay^vm8;jT-?(|};iJb-o<4j2;^nK4pFV&2 z`tAFVpT9u3cne5k^_L*fUreAlU=!0ld(M2vX6_bamA3H*V9+~gDP)T{bz_0c<}4;B(s`{2jnX|AA}q{+!mR)NPEiz z)?<8phR4?$Id@lFt&*94eEE-%-xkNC@9O`M+k5=n?F~&5(NCk7o=Fzb?T{~wFSoaMa~p@R)gNeo;x}VKTnl*m+AZYO>L2^R+g%CW|}~5pL=NMh309@@^j6) zv@Jb%t6x|hIm!C4p31}+ivW%wg95`J0pA&yf8MhoJcE_^tbD^tc65r>yZ*R5DNHYsP zcjYkKi%R>)t|HZu{~6*dG#2D zYMN$Yx+h0gIZb)lC&T&6t8$9A6p1J9F)Lqbo3W@rTkXP>fSucz6;tfrOk#iSknyM8 t$s?`c0PEwP-@h-q%3ZymBD2WlH?wleYQDSuYt6c}VrF|9O|t)g6997o4FmuH literal 0 HcmV?d00001 -- GitLab