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

数据处理 #2

Open
marnie007 opened this issue Mar 16, 2020 · 5 comments
Open

数据处理 #2

marnie007 opened this issue Mar 16, 2020 · 5 comments

Comments

@marnie007
Copy link

为什么hr那里就需要插值,不是就下采样后再进行插值作为输入吗,那里训练集的处理不太懂

@rangoXTY
Copy link

如果原始图片尺寸不能被下采样系数整除的话,下采样之后再上采样会导致上采样后的图片大小和原图不一致,所以一开始需要先对输入图片进行处理(个人意见)

@tongchangD
Copy link

tongchangD commented Jul 29, 2021

我没有看懂 自己处理数据 时
for i in range(0, lr.shape[0] - args.patch_size + 1, args.stride):

for j in range(0, lr.shape[1] - args.patch_size + 1, args.stride):

lr_patches.append(lr[i:i + args.patch_size, j:j + args.patch_size])
hr_patches.append(hr[i:i + args.patch_size, j:j + args.patch_size])

这里的操作意思,跪求讲解一哈.

@huang-hz
Copy link

我没有看懂 自己处理数据 时 for i in range(0, lr.shape[0] - args.patch_size + 1, args.stride):

for j in range(0, lr.shape[1] - args.patch_size + 1, args.stride):

lr_patches.append(lr[i:i + args.patch_size, j:j + args.patch_size])
hr_patches.append(hr[i:i + args.patch_size, j:j + args.patch_size])

这里的操作意思,跪求讲解一哈.

在图像两个维度获得的图像块数量分别为 lr.shape[0] - args.patch_size + 1, lr.shape[1] - args.patch_size + 1

@tongchangD
Copy link

我没有看懂 自己处理数据 时 for i in range(0, lr.shape[0] - args.patch_size + 1, args.stride):

for j in range(0, lr.shape[1] - args.patch_size + 1, args.stride):

lr_patches.append(lr[i:i + args.patch_size, j:j + args.patch_size])
hr_patches.append(hr[i:i + args.patch_size, j:j + args.patch_size])

这里的操作意思,跪求讲解一哈.

在图像两个维度获得的图像块数量分别为 lr.shape[0] - args.patch_size + 1, lr.shape[1] - args.patch_size + 1

谢谢,我应该是没有在这代码上深挖,刚刚回来看竟然一眼就看懂了,哈哈哈哈,感谢。

@tongyang-218
Copy link

UserWarning: Using a target size (torch.Size([16, 1, 20, 20])) that is different to the input size (torch.Size([16, 12, 12]))
RuntimeError:The size of tensor a (12) must match the size of tensor b (20) at non-singleton dimension 3
why?

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

5 participants