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

A question about pseudocode #18

Open
yafangna opened this issue Oct 13, 2022 · 5 comments
Open

A question about pseudocode #18

yafangna opened this issue Oct 13, 2022 · 5 comments

Comments

@yafangna
Copy link

What does Bx0 and Bx1 stand for in pseudocode

@xyupeng
Copy link
Owner

xyupeng commented Oct 14, 2022

Hi, B is defined in Eq. (2) as the bounding box, and B_{x0}/B_{x1} is the x coordinate of the left/right side of B.

@yafangna
Copy link
Author

Thank you for your reply

@Wenqi-Wang27
Copy link

Wenqi-Wang27 commented Oct 31, 2022

Thanks for the source code! What do lines 44 to 47 of the code stand for in "datasets.transforms.ContrastiveCrop.py" ?

ch0 = min(max(int(height * h0) - h//2, 0), height - h)
ch1 = min(max(int(height * h1) - h//2, 0), height - h)
cw0 = min(max(int(width * w0) - w//2, 0), width - w)
cw1 = min(max(int(width * w1) - w//2, 0), width - w)

#16 & #17

@xyupeng
Copy link
Owner

xyupeng commented Dec 21, 2022

Thanks for the source code! What do lines 44 to 47 of the code stand for in "datasets.transforms.ContrastiveCrop.py" ?

ch0 = min(max(int(height * h0) - h//2, 0), height - h)
ch1 = min(max(int(height * h1) - h//2, 0), height - h)
cw0 = min(max(int(width * w0) - w//2, 0), width - w)
cw1 = min(max(int(width * w1) - w//2, 0), width - w)

#16 & #17

These lines generate the operable region for box center.
ch0 is the minimum h, ch1 is the maximum h, and similar for cw0, cw1.
min(max(...)) is to ensure the whole box is fully inside the image.

@Wenqi-Wang27
Copy link

Thank you for your reply!

Thanks for the source code! What do lines 44 to 47 of the code stand for in "datasets.transforms.ContrastiveCrop.py" ?

ch0 = min(max(int(height * h0) - h//2, 0), height - h)
ch1 = min(max(int(height * h1) - h//2, 0), height - h)
cw0 = min(max(int(width * w0) - w//2, 0), width - w)
cw1 = min(max(int(width * w1) - w//2, 0), width - w)

#16 & #17

These lines generate the operable region for box center. ch0 is the minimum h, ch1 is the maximum h, and similar for cw0, cw1. min(max(...)) is to ensure the whole box is fully inside the image.

Thank you for your reply!

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

3 participants