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

V4Rec code pr #9725

Merged
merged 9 commits into from
Apr 19, 2023
Merged

V4Rec code pr #9725

merged 9 commits into from
Apr 19, 2023

Conversation

Topdu
Copy link
Collaborator

@Topdu Topdu commented Apr 14, 2023

No description provided.

@paddle-bot
Copy link

paddle-bot bot commented Apr 14, 2023

Thanks for your contribution!

Copy link
Collaborator

@tink2123 tink2123 left a comment

Choose a reason for hiding this comment

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

补充下配置文件

@@ -57,6 +91,9 @@ def __init__(self, in_channels, out_channels_list, **kwargs):
'{} is not supported in MultiHead yet'.format(name))

def forward(self, x, targets=None):
if self.use_pool: # for svtr backbone
# bs h*w c -> # bs c h//3 w//2
x = self.pool(x.reshape([0, 3, 80, -1]).transpose([0, 3, 1, 2]))
Copy link
Collaborator

Choose a reason for hiding this comment

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

试下不写死,或者先不支持svtr

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

那先删除吧

import paddle.nn.functional as F


class NRTRLoss(nn.Layer):
Copy link
Collaborator

Choose a reason for hiding this comment

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

和之前的nrtr loss区别是?能合并成一个吗

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

NRTRLoss是把rec_ce_loss里的nrtr部分单独拿出来了,这样更直观一点,蒸馏也需要NRTRLoss的单独文件

Copy link
Collaborator

@tink2123 tink2123 left a comment

Choose a reason for hiding this comment

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

LGTM

@tink2123 tink2123 merged commit 43abe2f into PaddlePaddle:dygraph Apr 19, 2023
TuanBC added a commit to TuanBC/PaddleOCR that referenced this pull request Apr 26, 2023
* v4rec code

* v4rec add nrtrloss

* Add V4rec backbone file

* Add V4Rec config file.

* Fix V4rec reparameters when export_model

* convert lvnetv3

* fix codestyle

* fix infer_rec v4rec
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.

None yet

2 participants