Skip to content

fix export dbnet input shape from 640x640 to 732x1280. change crnn he… #189

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

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

SamitHuang
Copy link
Collaborator

@SamitHuang SamitHuang commented Apr 17, 2023

…ad output shape in inference [BS, W, C]

Thank you for your contribution to the MindOCR repo.
Before submitting this PR, please make sure:

Motivation

(Write your motivation for proposed changes here.)

Test Plan

(How should this PR be tested? Do you require special setup to run the test or repro the fixed bug?)

Related Issues and PRs

(Is this PR part of a group of changes? Link the other relevant PRs and Issues here. Use https://help.github.com/en/articles/closing-issues-using-keywords for help on GitHub syntax)

@SamitHuang SamitHuang requested review from hqkate and liangxhao April 17, 2023 06:22
@@ -77,6 +78,7 @@ def construct(self, x):
if not self.training:
#h = ops.softmax(h, axis=2) # not support on ms 1.8.1
h = ops.Softmax(axis=2)(h)
h = ops.Transpose()(h, (1, 0, 2))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

h.transpose((1, 0, 2))?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

@@ -27,7 +27,7 @@ def export(name, task='rec', pretrained=True, ckpt_load_path="", save_dir=""):
if task=='rec':
c, h, w = 3, 32, 100
else:
c, h, w = 3, 640, 640
c, h, w = 3, 736, 1280
Copy link
Collaborator

@CaitinZhao CaitinZhao Apr 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export的shape在python文件里写死是不是不太好?应该是个参数?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

识别crnn模型输入的高必须是32。其他情况可以input_shape指定。

@HaoyangLee HaoyangLee merged commit 7a349d7 into mindspore-lab:main Apr 17, 2023
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

Successfully merging this pull request may close these issues.

4 participants