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

MORN question~ #69

Closed
JingLiJJ opened this issue Apr 27, 2019 · 8 comments
Closed

MORN question~ #69

JingLiJJ opened this issue Apr 27, 2019 · 8 comments

Comments

@JingLiJJ
Copy link

您好。我想问一下,在MORN里
图片过了CNN出来的size为什么是1311,而不是paper上写的2311呢?
还有,

MORAN_v2/models/morn.py

Lines 66 to 69 in 1eb6988

offsets_grid = nn.functional.grid_sample(offsets_pool, grid)
offsets_grid = offsets_grid.permute(0, 2, 3, 1).contiguous()
offsets_x = torch.cat([grid_x, grid_y + offsets_grid], 3)
x_rectified = nn.functional.grid_sample(x, offsets_x)

为什么只对y轴进行了矫正呢?还是我理解错了?

@Canjie-Luo
Copy link
Owner

您好,MORAN v1用的是两个维度的,即xy,但是我们发现cropped text基本没有水平位移的问题,所以MORAN v2去掉了x维度,只在竖直方向上纠正字符,能应用于大多数场景,同时也更好端到端训练,毕竟解空间变小了。

@JingLiJJ
Copy link
Author

JingLiJJ commented May 6, 2019 via email

@Canjie-Luo
Copy link
Owner

您说的不定长指的是?

@JingLiJJ
Copy link
Author

JingLiJJ commented May 6, 2019 via email

@Canjie-Luo
Copy link
Owner

这个是可以实现的,您可以按照CRNN写一个alignCollate(dataset.py中),或者在MORN中随机缩放target_W。

@JingLiJJ
Copy link
Author

JingLiJJ commented May 8, 2019 via email

@tanhui2975
Copy link

请问第80行的代码应该是x_rectified = nn.functional.grid_sample(x, offsets_x)
还是x_rectified = nn.functional.grid_sample(x_rectified, offsets_x) ? @Canjie-Luo

MORAN_v2/models/morn.py

Lines 66 to 80 in 1eb6988

offsets_grid = nn.functional.grid_sample(offsets_pool, grid)
offsets_grid = offsets_grid.permute(0, 2, 3, 1).contiguous()
offsets_x = torch.cat([grid_x, grid_y + offsets_grid], 3)
x_rectified = nn.functional.grid_sample(x, offsets_x)
for iteration in range(enhance):
offsets = self.cnn(x_rectified)
offsets_posi = nn.functional.relu(offsets, inplace=False)
offsets_nega = nn.functional.relu(-offsets, inplace=False)
offsets_pool = self.pool(offsets_posi) - self.pool(offsets_nega)
offsets_grid += nn.functional.grid_sample(offsets_pool, grid).permute(0, 2, 3, 1).contiguous()
offsets_x = torch.cat([grid_x, grid_y + offsets_grid], 3)
x_rectified = nn.functional.grid_sample(x, offsets_x)

@Canjie-Luo
Copy link
Owner

Canjie-Luo commented Jul 19, 2019 via email

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

3 participants