Coder Social home page Coder Social logo

Comments (15)

JarveeLee avatar JarveeLee commented on August 27, 2024 1

Ah ha your solution works pretty nice!Thanks~
After your suggestion averagely it just takes me 6 seconds to select and place text on 1 image with better appearance ! It was bad and took 60 seconds per image yesterday.....

from synthtext.

JarveeLee avatar JarveeLee commented on August 27, 2024

Like this pic,it will place some chinese character around the narrow edge,but I want to add to the broad white space.This situation frequently happens.
figure_1-2

from synthtext.

JarveeLee avatar JarveeLee commented on August 27, 2024

figure_2
sometime like this , I think it is good but this situation seldom happens.

from synthtext.

JarveeLee avatar JarveeLee commented on August 27, 2024

I don't know how to solve this problem....I guess I should change something in text_util.py in line 118
def render_multiline(self,font,text):

But don't know exactly what to do

from synthtext.

JarveeLee avatar JarveeLee commented on August 27, 2024

figure_3
Maybe it is the problem about depth prediction?

from synthtext.

ankush-me avatar ankush-me commented on August 27, 2024

@JarveeLee : The segmentation regions are randomly selected for placing text (check here). If you remove this, and instead go through the regions in sequence, the regions should be ordered in decreasing order of their areas -- so then the largest region (as found in the segmentation step), should be selected first for placing text.

Next, regarding rendering multiple lines:
You can change this line, so that text_type is always PARA, which should select multiple lines containing multiple words, based on the dimensions of the segmentation region and the font-size.

from synthtext.

clscy avatar clscy commented on August 27, 2024

Hi, @JarveeLee , I want to generate Chinese scene images through SynthText, I have generated char_freq.cp and font_px2pt.cp based on newsgroup.txt, but it comes somes mistakes.

Traceback (most recent call last):
File "/home/chengls/data/SynthText_06.05/synthgen.py", line 661, in render_text
regions['homography_inv'][ireg])
File "/home/chengls/data/SynthText_06.05/synthgen.py", line 501, in place_text
render_res = self.text_renderer.render_sample(font,collision_mask)
File "/home/chengls/data/SynthText_06.05/text_utils.py", line 366, in render_sample
text = self.text_source.sample(nline,nchar,text_type)
File "/home/chengls/data/SynthText_06.05/text_utils.py", line 606, in sample
return self.fdictkind
File "/home/chengls/data/SynthText_06.05/text_utils.py", line 652, in sample_para
lines = self.get_lines(nline, nword, nchar_max, f=0.35)
File "/home/chengls/data/SynthText_06.05/text_utils.py", line 584, in get_lines
lines = h_lines(niter=100)
File "/home/chengls/data/SynthText_06.05/text_utils.py", line 576, in h_lines
line_start = np.random.choice(len(self.txt)-nline)
File "mtrand.pyx", line 1391, in mtrand.RandomState.choice (numpy/random/mtrand/mtrand.c:14900)
ValueError: a must be greater than 0

So could you tell how to generate Chinese scene images in details? Thank you.

from synthtext.

JarveeLee avatar JarveeLee commented on August 27, 2024

@clscy generate own font_px2pt.cp by adding more chinese fonts which end with .tff,and run invert_font_size.py . And update char_freq.cp based on newsgroup.txt. And you should fix all chinese utf-8 coding problem both in OS and python...

from synthtext.

ankush-me avatar ankush-me commented on August 27, 2024

@JarveeLee is it possible for you to share your code / data with the changes you made for generating Chinese text? It would be very useful for a lot of users. Thanks!

from synthtext.

JarveeLee avatar JarveeLee commented on August 27, 2024

@ankush-me I can email to you my code next week when go back to company.

from synthtext.

yash0307 avatar yash0307 commented on August 27, 2024

@JarveeLee, would it be possible for you to share code and data with me ? It will be of great help for my ongoing project.

from synthtext.

ankush-me avatar ankush-me commented on August 27, 2024

@JarveeLee : Is it possible to share it openly, e.g. on GitHub?

from synthtext.

JarveeLee avatar JarveeLee commented on August 27, 2024

@ankush-me I will do this ....Busy with final exam these days...

from synthtext.

JarveeLee avatar JarveeLee commented on August 27, 2024

@ankush-me https://github.com/JarveeLee/SynthText_Chinese_version

from synthtext.

ankush-me avatar ankush-me commented on August 27, 2024

@JarveeLee Thanks a lot!

from synthtext.

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.