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

crop_size = min(crop_size, objcenter[0] / width * min_shape * 2. - 1.) so damn hard to understand. #70

Open
jiangtaoo2333 opened this issue Mar 7, 2019 · 2 comments

Comments

@jiangtaoo2333
Copy link

crop_size = min(crop_size, objcenter[0] / width * min_shape * 2. - 1.)
crop_size = min(crop_size, (bimg.shape[1] - objcenter[0]) / width * min_shape * 2. - 1)
crop_size = min(crop_size, objcenter[1] / height * min_shape * 2. - 1.)
crop_size = min(crop_size, (bimg.shape[0] - objcenter[1]) / height * min_shape * 2. - 1)

QAQ can somebody help me

@chenyilun95
Copy link
Owner

It calculates the size of box to be cropped in original image.
There are two restrictions:

  1. It should be inside the image and keep the center fixed.
  2. It should keep the aspect ratio of original image while cropping. So we need to expand the size of box to let the aspect ratio of box be same as the the input of network.

@jiangtaoo2333
Copy link
Author

really appreciate your help.

It calculates the size of box to be cropped in original image.
There are two restrictions:

  1. It should be inside the image and keep the center fixed.
  2. It should keep the aspect ratio of original image while cropping. So we need to expand the size of box to let the aspect ratio of box be same as the the input of network.

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

No branches or pull requests

2 participants