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

Set line width and label font size proportional to image size #9

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

PetervanLunteren
Copy link

Pull request to set line width and label font size proportional to image size. Helpful when processing large images.

  • The line width of the bounding box will be set to 1/150th of the image width or height, whichever is smaller. If this value is smaller than the previous default value of 2, 2 will be chosen.
  • Same for the label font size. This will be set to 1/40th of the image width or height, whichever is smaller. If this value is smaller than the previous default value of 15, 15 will be chosen.

See examples below. Large images have improved, small are the same.

BEFORE:
bird_bb
clarifloue_bb
khatia_bb
nao-romeo-pepper_bb
paragliders_bb
pobb_bb
Screenshot 2023-11-23 at 11 47 10
Screenshot 2023-11-23 at 11 47 24
Screenshot 2023-11-23 at 11 47 34
selfie_bb
ski-paraglider_bb
winton_bb

AFTER:
bird_bb
clarifloue_bb
khatia_bb
nao-romeo-pepper_bb
paragliders_bb
pobb_bb
Screenshot 2023-11-23 at 11 48 16
Screenshot 2023-11-23 at 11 48 24
Screenshot 2023-11-23 at 11 48 34
selfie_bb
ski-paraglider_bb
winton_bb

The line width of the bounding box will be set to 1/150th of the image width or height, whichever is smaller. If this value is smaller than the previous default value of 2, 2 will be chosen.

Same for the label font size. This will be set to 1/40th of the image width or height, whichever is smaller. If this value is smaller than the previous default value of 15, 15 will be chosen.
@PetervanLunteren
Copy link
Author

Please let me know if you decide to accept this pull request and update the PyPi package. For the time being I will adjust my project (EcoAssist) to use my fork instead.

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

Successfully merging this pull request may close these issues.

1 participant