From 24ff4def480792fb9a6b8388f3527e01ff9ec5f3 Mon Sep 17 00:00:00 2001 From: Double_V Date: Mon, 15 May 2023 10:57:30 +0800 Subject: [PATCH] Pfhead (#9898) * support min_area_rect crop * add check_install * fix requirement.txt * fix check_install * add lanms-neo for drrg * fix * fix doc * fix * support set gpu_id when inference * fix #8855 * fix #8855 * opt slim doc * fix doc bug * rename * rename --- configs/det/ch_PP-OCRv4/ch_PP-OCRv4_det_student.yml | 2 +- configs/det/ch_PP-OCRv4/ch_PP-OCRv4_det_teacher.yml | 2 +- ppocr/modeling/heads/__init__.py | 4 ++-- ppocr/modeling/heads/det_db_head.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configs/det/ch_PP-OCRv4/ch_PP-OCRv4_det_student.yml b/configs/det/ch_PP-OCRv4/ch_PP-OCRv4_det_student.yml index 60a4700e3f..04caf85088 100644 --- a/configs/det/ch_PP-OCRv4/ch_PP-OCRv4_det_student.yml +++ b/configs/det/ch_PP-OCRv4/ch_PP-OCRv4_det_student.yml @@ -31,7 +31,7 @@ Architecture: out_channels: 96 shortcut: True Head: - name: CBNHeadLocal + name: PFHeadLocal k: 50 mode: "small" diff --git a/configs/det/ch_PP-OCRv4/ch_PP-OCRv4_det_teacher.yml b/configs/det/ch_PP-OCRv4/ch_PP-OCRv4_det_teacher.yml index 83dd55c677..5109f490c8 100644 --- a/configs/det/ch_PP-OCRv4/ch_PP-OCRv4_det_teacher.yml +++ b/configs/det/ch_PP-OCRv4/ch_PP-OCRv4_det_teacher.yml @@ -30,7 +30,7 @@ Architecture: out_channels: 256 intracl: true Head: - name: CBNHeadLocal + name: PFHeadLocal k: 50 mode: "large" diff --git a/ppocr/modeling/heads/__init__.py b/ppocr/modeling/heads/__init__.py index 96ef1a31c9..440d9e0293 100755 --- a/ppocr/modeling/heads/__init__.py +++ b/ppocr/modeling/heads/__init__.py @@ -17,7 +17,7 @@ __all__ = ['build_head'] def build_head(config): # det head - from .det_db_head import DBHead, CBNHeadLocal + from .det_db_head import DBHead, PFHeadLocal from .det_east_head import EASTHead from .det_sast_head import SASTHead from .det_pse_head import PSEHead @@ -56,7 +56,7 @@ def build_head(config): 'TableAttentionHead', 'SARHead', 'AsterHead', 'SDMGRHead', 'PRENHead', 'MultiHead', 'ABINetHead', 'TableMasterHead', 'SPINAttentionHead', 'VLHead', 'SLAHead', 'RobustScannerHead', 'CT_Head', 'RFLHead', - 'DRRGHead', 'CANHead', 'SATRNHead', 'CBNHeadLocal' + 'DRRGHead', 'CANHead', 'SATRNHead', 'PFHeadLocal' ] if config['name'] == 'DRRGHead': diff --git a/ppocr/modeling/heads/det_db_head.py b/ppocr/modeling/heads/det_db_head.py index 968884f747..8db14d7f6f 100644 --- a/ppocr/modeling/heads/det_db_head.py +++ b/ppocr/modeling/heads/det_db_head.py @@ -129,9 +129,9 @@ class LocalModule(nn.Layer): return out -class CBNHeadLocal(DBHead): +class PFHeadLocal(DBHead): def __init__(self, in_channels, k=50, mode='small', **kwargs): - super(CBNHeadLocal, self).__init__(in_channels, k, **kwargs) + super(PFHeadLocal, self).__init__(in_channels, k, **kwargs) self.mode = mode self.up_conv = nn.Upsample(scale_factor=2, mode="nearest", align_mode=1)