未验证 提交 203ad52b 编写于 作者: F Feng Ni 提交者: GitHub

Support FocalNet backbone and dino_focalnet (#7856)

* add raw codes

* add pretrained weights

* fix reader

* fix

* fix focalnet codes coments and format

* fix focalnet codes coments and format

* fix focalnet format
上级 716755d2
architecture: DETR
# pretrain_weights: # rewrite in FocalNet.pretrained in ppdet/modeling/backbones/focalnet.py
pretrain_weights: https://bj.bcebos.com/v1/paddledet/models/pretrained/focalnet_large_lrf_384_fl4_pretrained.pdparams
hidden_dim: 256
use_focal_loss: True
DETR:
backbone: FocalNet
transformer: DINOTransformer
detr_head: DINOHead
post_process: DETRBBoxPostProcess
FocalNet:
arch: 'focalnet_L_384_22k_fl4'
out_indices: [1, 2, 3]
pretrained: https://bj.bcebos.com/v1/paddledet/models/pretrained/focalnet_large_lrf_384_fl4_pretrained.pdparams
DINOTransformer:
num_queries: 900
position_embed_type: sine
num_levels: 4
nhead: 8
num_encoder_layers: 6
num_decoder_layers: 6
dim_feedforward: 2048
dropout: 0.0
activation: relu
pe_temperature: 20
pe_offset: 0.0
num_denoising: 100
label_noise_ratio: 0.5
box_noise_scale: 1.0
learnt_init_query: True
DINOHead:
loss:
name: DINOLoss
loss_coeff: {class: 1, bbox: 5, giou: 2}
aux_loss: True
matcher:
name: HungarianMatcher
matcher_coeff: {class: 2, bbox: 5, giou: 2}
DETRBBoxPostProcess:
num_top_queries: 300
......@@ -69,7 +69,7 @@ class DETR(BaseArch):
body_feats = self.backbone(self.inputs)
# Transformer
pad_mask = self.inputs['pad_mask'] if self.training else None
pad_mask = self.inputs.get('pad_mask', None)
out_transformer = self.transformer(body_feats, pad_mask, self.inputs)
# DETR Head
......
......@@ -35,6 +35,7 @@ from . import convnext
from . import vision_transformer
from . import mobileone
from . import trans_encoder
from . import focalnet
from .vgg import *
from .resnet import *
......@@ -57,6 +58,6 @@ from .cspresnet import *
from .csp_darknet import *
from .convnext import *
from .vision_transformer import *
from .vision_transformer import *
from .mobileone import *
from .trans_encoder import *
from .focalnet import *
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册