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

关于moran网络输入图片尺寸 #93

Closed
yourblinggirl opened this issue Sep 9, 2019 · 1 comment
Closed

关于moran网络输入图片尺寸 #93

yourblinggirl opened this issue Sep 9, 2019 · 1 comment

Comments

@yourblinggirl
Copy link

代码中moran网络的输入为:(32,100),但是代码中imgH和imgW为64和200,从图片的输入到网络输入,没见到对输入图片尺寸的处理,,,

@Canjie-Luo
Copy link
Owner

Canjie-Luo commented Sep 11, 2019

MORAN_v2/models/morn.py

Lines 26 to 38 in 2cd40c4

h_list = np.arange(self.targetH)*2./(self.targetH-1)-1
w_list = np.arange(self.targetW)*2./(self.targetW-1)-1
grid = np.meshgrid(
w_list,
h_list,
indexing='ij'
)
grid = np.stack(grid, axis=-1)
grid = np.transpose(grid, (1, 0, 2))
grid = np.expand_dims(grid, 0)
grid = np.tile(grid, [maxBatch, 1, 1, 1])
grid = torch.from_numpy(grid).type(self.inputDataType)

这个grid能够将(64,200)的图采样为(32,100)。

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