question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

generate handwriting process is successful but no image appears

See original GitHub issue

Hello @Belval and community,

I run this code for generate handwritten images in colab. Process is successfull but no image appears in the output directory. When I generate an image with some kind of font without -hw, the image appears in the output directory image

Anyone can help?

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
RickyGunawan09commented, Aug 22, 2022

I make the following modifications, it works fine~

185     ¦   ##############################################################
186     ¦   # Comparing average pixel value of text and background image #
187     ¦   ##############################################################
188     ¦   try:
189     ¦   ¦   resized_img_st = ImageStat.Stat(resized_img, resized_mask.split()[2])
190     ¦   ¦   background_img_st = ImageStat.Stat(background_img)
191 
192     ¦   ¦   if is_handwritten:
193     ¦   ¦   ¦   resized_img_px_mean = 25
194     ¦   ¦   else:
195     ¦   ¦   ¦   resized_img_px_mean = sum(resized_img_st.mean[:2]) / 3
196 #            print(resized_img_px_mean)
197     ¦   ¦   background_img_px_mean = sum(background_img_st.mean) / 3                                                                                                                                                                                                   
198 #            print(background_img_px_mean)
199 

I tried your fix and I can get the image, but I find another issue with the width for handwriting. it’s always generated an image with a resolution of 37x32 for every word. did you edit another line of code?

edit: I can resize it using size parameter. so my question is what did # Comparing average pixel value of text and background image # actually do? it’s okay if we use hardcode like you did @simmerken ?

0reactions
meminbakircommented, Oct 4, 2022

Actually, there happens a ZeroDivision error but since it is caught, it is not visible. So far, the solution suggested at this issue helped me to solve the problem. I hope the author applies the suggested solution and saves many from headache…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handwriting Without Tears
See the Handwriting Without Tears Process​​ Our instructional methods are designed for success. Explore the teaching strategies that have helped students make ......
Read more >
The Importance of Teaching Handwriting - Reading Rockets
Most critically, children should be able to use at least one form to produce legible, reasonably effortless writing, and instruction should focus on...
Read more >
Writing process - Department of Education and Training Victoria
Planning and rehearsing: the generation, selection and sorting of ideas to write about, consideration of purpose and audience which will ...
Read more >
The effects of handwriting experience on functional brain ...
Here we present evidence that brain activation during letter perception is influenced in different, important ways by previous handwriting of letters versus ...
Read more >
What's Lost as Handwriting Fades - The New York Times
Even as the emphasis shifts to the keyboard, experts say that learning to write by hand improves motor skills, memory and creativity.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found