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

數據預處理 #3

Open
ccqedq opened this issue May 10, 2022 · 3 comments
Open

數據預處理 #3

ccqedq opened this issue May 10, 2022 · 3 comments

Comments

@ccqedq
Copy link

ccqedq commented May 10, 2022

在train.py 裏直接加載的預處理後的數據,但預處理直接按最大邊等比縮放到600,對於不同長寬比的數據這樣處理不太合適吧,感覺padding應該更好一點

@fire717
Copy link
Owner

fire717 commented May 10, 2022

数据增强里有padding

img = A.OneOf([A.PadIfNeeded(min_height=min_size, min_width=min_size,
border_mode=3, value=0, mask_value=0,
always_apply=False, p=0.7),
A.PadIfNeeded(min_height=min_size, min_width=min_size,
border_mode=0, value=0, mask_value=0,
always_apply=False, p=0.3)],
p=1.0)(image=img)['image']

@ccqedq
Copy link
Author

ccqedq commented May 10, 2022

min_size = max(img.shape[:2])

img = A.OneOf([A.PadIfNeeded(min_height=min_size, min_width=min_size,
border_mode=3, value=0, mask_value=0,
always_apply=False, p=0.7),
A.PadIfNeeded(min_height=min_size, min_width=min_size,
border_mode=0, value=0, mask_value=0,
always_apply=False, p=0.3)],
p=1.0)(image=img)['image']
這裏不應該padding到self.h,self.w嗎

@fire717
Copy link
Owner

fire717 commented May 10, 2022

假如你输入的是1000x2000的图 不先按最大边等比缩放到300x600再padding 你怎么直接padding到600x600?
这些问题你把每一步图片保存下来看看就知道了

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