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

rec_r45_abinet.yml add max_length and image_size #10744

Merged
merged 2 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
image_shape to image_size
  • Loading branch information
xlg-go committed Aug 28, 2023
commit 84031d1c6c3ed550290b18c0c94f9f419968b782
2 changes: 1 addition & 1 deletion configs/rec/rec_r45_abinet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Architecture:
use_lang: True
iter_size: 3
max_length: *max_text_length
image_shape: [ &h 32, &w 128 ] # [ h, w ]
image_size: [ &h 32, &w 128 ] # [ h, w ]


Loss:
Expand Down
4 changes: 2 additions & 2 deletions ppocr/modeling/heads/rec_abinet_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ def __init__(self,
max_length=25,
use_lang=False,
iter_size=1,
image_shape=(32, 128)):
image_size=(32, 128)):
super().__init__()
self.max_length = max_length + 1
h, w = image_shape[0] // 4, image_shape[1] // 4
h, w = image_size[0] // 4, image_size[1] // 4
self.pos_encoder = PositionalEncoding(
dropout=0.1, dim=d_model, max_len=h * w)
self.encoder = nn.LayerList([
Expand Down