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

输入尺寸和输出尺寸的问题 #30

Open
LanWong1 opened this issue Sep 10, 2020 · 3 comments
Open

输入尺寸和输出尺寸的问题 #30

LanWong1 opened this issue Sep 10, 2020 · 3 comments

Comments

@LanWong1
Copy link

我并没有看到在输入端把图像resize到1024512,仅仅是把短边等比例缩放到512,长边并没有固定到1024,为何输出的时候,就直接缩放到1024512呢?
class Decoder (nn.Module):
def init(self, num_classes):
super().init()

    self.apn = APN_Module(in_ch=128,out_ch=20)
    # self.upsample = Interpolate(size=(512, 1024), mode="bilinear")
    # self.output_conv = nn.ConvTranspose2d(16, num_classes, kernel_size=4, stride=2, padding=1, output_padding=0, bias=True)
    # self.output_conv = nn.ConvTranspose2d(16, num_classes, kernel_size=3, stride=2, padding=1, output_padding=1, bias=True)
    # self.output_conv = nn.ConvTranspose2d(16, num_classes, kernel_size=2, stride=2, padding=0, output_padding=0, bias=True)

def forward(self, input):
    
    output = self.apn(input)
    out = interpolate(output, size=(512, 1024), mode="bilinear", align_corners=True)
    # out = self.upsample(output)
    # print(out.shape)
    return out
@Benjiaminh
Copy link

我并没有看到在输入端把图像resize到1024_512,仅仅是把短边等比例缩放到512,长边并没有固定到1024,为何输出的时候,就直接缩放到1024_512呢?
class Decoder (nn.Module):
def init(self, num_classes):
super().init()

    self.apn = APN_Module(in_ch=128,out_ch=20)
    # self.upsample = Interpolate(size=(512, 1024), mode="bilinear")
    # self.output_conv = nn.ConvTranspose2d(16, num_classes, kernel_size=4, stride=2, padding=1, output_padding=0, bias=True)
    # self.output_conv = nn.ConvTranspose2d(16, num_classes, kernel_size=3, stride=2, padding=1, output_padding=1, bias=True)
    # self.output_conv = nn.ConvTranspose2d(16, num_classes, kernel_size=2, stride=2, padding=0, output_padding=0, bias=True)

def forward(self, input):
    
    output = self.apn(input)
    out = interpolate(output, size=(512, 1024), mode="bilinear", align_corners=True)
    # out = self.upsample(output)
    # print(out.shape)
    return out

可以相互交流下不,我最近也在看这个,但是也有些问题,我的qq联系方式1602356172

@Vieeo
Copy link

Vieeo commented Jan 7, 2021

LEDNet‘paras is 0.94M?Why I get 2.3M?About you?

@HKQX
Copy link

HKQX commented Mar 14, 2021

Resize函数会将另外一边按照原先图像比例乘以512 实际另外一边是2048%1024*512=1024,具体可以看函数说明

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

4 participants