Skip to content

rec_pphgnetv2.py 对大于320的文本长度,比如640时候 F.adaptive_avg_pool2d(x, [1, 40])强制输出(1,40)大小不会损失特征? #17816

@cqray1990

Description

@cqray1990

🔎 Search before asking

  • I have searched the PaddleOCR Docs and found no similar bug report.
  • I have searched the PaddleOCR Issues and found no similar bug report.
  • I have searched the PaddleOCR Discussions and found no similar bug report.

🐛 Bug (问题描述)

因为320对文长文本太短了,想增加长度,是否可以直接增加到1024之类的

        def forward(self, x):
            x = self.stem(x)
            out = []
            for i, stage in enumerate(self.stages):
                x = stage(x)
                if self.det and i in self.out_indices:
                    out.append(x)
            if self.det:
                return out
    
            if self.text_rec:
                if self.training:
                    x = F.adaptive_avg_pool2d(x, [1, 40])
                else:
                    x = F.avg_pool2d(x, [3, 2])
            return x

🏃‍♂️ Environment (运行环境)

ubantu 20

🌰 Minimal Reproducible Example (最小可复现问题的Demo)

paddleocrv5

@changdazhou @jzhang533

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions