Skip to content
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

How to reduce the font size of inference detection categories and values? #2550

Closed
zxsitu opened this issue Mar 22, 2021 · 2 comments
Closed
Labels
question Further information is requested

Comments

@zxsitu
Copy link

zxsitu commented Mar 22, 2021

❔Question

Hello author, I am using detect.py to infer using images smaller than 640 pixels, and my image is 256 pixels. The inference process is successful, I would like to know how to reduce the font size of the detection results (detection category and detection value), they are filling up my graph and blocking a large area, how to solve it well?

Additional context

None.

@zxsitu zxsitu added the question Further information is requested label Mar 22, 2021
@adrianholovaty
Copy link
Contributor

You can reduce the line thickness by changing this line in detect.py:

plot_one_box(xyxy, im0, label=label, color=colors[int(cls)], line_thickness=3)

Try changing it to line_thickness=2 or line_thickness=1.

The font size is determined relative to that line_thickness value. That code lives in plot_one_box() in utils/plots.py.

@zxsitu
Copy link
Author

zxsitu commented Mar 22, 2021

@adrianholovaty Thank you! Very quick reply, I'll give it a try!
Otherwise the color of the detection box is different every time I test and I'm fainting...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants