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

Mistake in positive anchor box calculation (calc_rpn in data_generator.py) #86

Open
RohanUBagewadi opened this issue Jul 21, 2020 · 1 comment

Comments

@RohanUBagewadi
Copy link

In calc_rpn function of data_generator.py. The width(anchor_x ) and height (anchor_y) for the anchor boxes are calculated based on (self.anchor_box_scales, self.anchor_box_ratios) in config.py file and these values corresponds to the original input image not the resized image. But these anchor boxes are being drawn on the resized image in calc_rpn function.
The script should resize the anchor boxes to the same size.

original:
anchor_x = anchor_sizes[anchor_size_idx] * anchor_ratios[anchor_ratio_idx][0]
anchor_y = anchor_sizes[anchor_size_idx] * anchor_ratios[anchor_ratio_idx][1]

suggested:
anchor_x = anchor_sizes[anchor_size_idx] * anchor_ratios[anchor_ratio_idx][0] * (resized_width / float(width))
anchor_y = anchor_sizes[anchor_size_idx] * anchor_ratios[anchor_ratio_idx][1] * (resized_height / float(height))

Am I correct?
Is this an implementation error?

@TiasM
Copy link

TiasM commented Aug 14, 2020

I think the anchor should be drawn to the resized image because we are working with resized image for the whole training/testing process (which is the way it is implemented). In the original paper the author also resize all the image used for training and testing as a preprocess. Please correct me if i'm wrong

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