-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Reconstitution] Improve reconstitution #1750
base: main
Are you sure you want to change the base?
[Reconstitution] Improve reconstitution #1750
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1750 +/- ##
==========================================
+ Coverage 96.46% 96.54% +0.07%
==========================================
Files 164 164
Lines 7869 7895 +26
==========================================
+ Hits 7591 7622 +31
+ Misses 278 273 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Closes: #1692 |
# test with a smiley which can't be rendered by unidecode | ||
pages_one_line["blocks"][0]["lines"][0]["words"][0]["text"] = "🤯" | ||
render_one_line = reconstitution.synthesize_page(pages_one_line, draw_proba=True) | ||
assert isinstance(render_one_line, np.ndarray) | ||
assert render_one_line.shape == (*pages[0].dimensions, 3) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, it didn't work ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It worked but i was not able to reach the line where it breaks d.draw because d.draw was also able to draw it (not correctly - only as question mark - because the default font supports it but it would with a supporting font) xDDD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the idea was to cover the unicode error also where it falls back to anyascii xD I tried with chinese symbols, smileys but everything worked also without anyascii
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but i would still keep it as fallback only for the case 😅
This PR:
Still not perfect but looks much better as before :)
Any feedback is welcome 🤗
Old: (Lots of overlapping / clipping)
New:
New without line: