-
Couldn't load subscription status.
- Fork 775
[Fix] Support custom font to visualize some languages (e.g. Korean) #1567
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
Conversation
| colors='k', | ||
| font_sizes=font_size) | ||
| font_sizes=font_size, | ||
| font_families=self.font_families) |
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.
Better to pass font_families into the function
def get_labels_image(xxx, font_familyies='sans-serif'):
self.draw_texts(
labels, (bboxes[:, :2] + bboxes[:, 2:]) / 2,
vertical_alignments='center',
horizontal_alignments='center',
colors='k',
font_sizes=font_size,
font_families=self.font_families)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.
There are other functions that call self.draw_texts();
_draw_edge_label()get_labels_image()
Do you think these function should contains the font_families argument?
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.
Containing will be better
|
Hi, would you polish this PR further? |
|
@gaotongxiao Yes, maybe this week :) |
7a9be75 to
0a98f32
Compare
|
Initially, I tried to add a |
Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.
Motivation
'san-serif' does not support to visualize Korean character.
Modification
before:
configs/textrecog/_base_/default_runtime.pyoutputafter:
configs/textrecog/_base_/default_runtime.pyI added self.font_families to
BaseLocalVisualizerclass.BC-breaking (Optional)
Does the modification introduce changes that break the backward-compatibility of the downstream repositories?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.
Use cases (Optional)
If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.
Checklist
Before PR:
After PR: