Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Why using 'F.grid_sample()' in class RandomShiftsAug? #30

Open
Guozheng-Ma opened this issue Dec 17, 2022 · 0 comments
Open

Why using 'F.grid_sample()' in class RandomShiftsAug? #30

Guozheng-Ma opened this issue Dec 17, 2022 · 0 comments

Comments

@Guozheng-Ma
Copy link

Guozheng-Ma commented Dec 17, 2022

Actually, for the random shift operation, we can easily choose two random variable as the shift axis like this:

assert origin_image.shape=(512,3,84,84)
assert pad_image.shape=(512,3,92,92)
shift_x = random.randint(0,92-84-1)
shift_y = random.randint(0,92-84-1)
aug_image = pad_image[:,:,x:x+84,y:y+84]

Then we can get the augmented image.

I guess interpolation is the reason you guys choose F.grid_sample()?

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

No branches or pull requests

1 participant