xyupeng / ContrastiveCrop

[CVPR 2022 Oral] Crafting Better Contrastive Views for Siamese Representation Learning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question about the cropping candidate regions

yanzipei opened this issue · comments

In the ContrastiveCrop.py file:
Line 44 to 47:

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

the upper bounds ch1 and cw1 may be wrong?
It should be the addition instead of the subtraction? From my understanding, it ch1 and cw1 give the upper bounds (the maximum of the cropping region). Or I misunderstand the cropping candidate regions.

···
ch1 = min(int(height * h1) + h//2, height - h)
···
cw1 = min(int(width * w1) + w//2, width - w)

Thanks in advance.