Detrium 模型库 (Model Zoo)
共索引 24 个 Apache-2.0 预设配置(Recipe)。支持按家族筛选,点击任意行查看训练参数、Hub 源与完整展开 YAML。
| 模型别名 | 家族 | 主干网络 | 输入尺寸 | 默认轮次 / Batch | 优化器 | 蒸馏 / Hub |
|---|---|---|---|---|---|---|
rtv4 | HGNetv2-B0 | 640×640 | 96e / bs 32 | MuAdamW | DINOv3TeacherModel | |
rtv4 | HGNetv2-B2 | 640×640 | 72e / bs 32 | MuAdamW | DINOv3TeacherModel | |
rtv4 | HGNetv2-B4 | 640×640 | 50e / bs 32 | MuAdamW | DINOv3TeacherModel | |
rtv4 | HGNetv2-B5 | 640×640 | 50e / bs 32 | MuAdamW | DINOv3TeacherModel | |
deim | HGNetv2-B0 | 640×640 | 136e / bs 128 | MuAdamW | 无教师 | |
deim | HGNetv2-B0 | 640×640 | 96e / bs 32 | MuAdamW | 无教师 | |
deim | HGNetv2-B2 | 640×640 | 72e / bs 32 | MuAdamW | 无教师 | |
deim | HGNetv2-B4 | 640×640 | 50e / bs 32 | MuAdamW | 无教师 | |
deim | HGNetv2-B5 | 640×640 | 50e / bs 32 | MuAdamW | 无教师 | |
deim | PResNet-18 | 640×640 | 100e / bs 16 | MuAdamW | 无教师 | |
deim | PResNet-34 | 640×640 | 100e / bs 16 | MuAdamW | 无教师 | |
deim | PResNet-50 | 640×640 | 52e / bs 16 | MuAdamW | 无教师 | |
deim | PResNet-50 | 640×640 | 52e / bs 16 | MuAdamW | 无教师 | |
deim | PResNet-101 | 640×640 | 52e / bs 16 | MuAdamW | 无教师 | |
dfine | HGNetv2-B0 | 640×640 | 136e / bs 128 | MuAdamW | 无教师 | |
dfine | HGNetv2-B0 | 640×640 | 112e / bs 32 | MuAdamW | 无教师 | |
dfine | HGNetv2-B2 | 640×640 | 112e / bs 32 | MuAdamW | 无教师 | |
dfine | HGNetv2-B4 | 640×640 | 68e / bs 32 | MuAdamW | 无教师 | |
dfine | HGNetv2-B5 | 640×640 | 68e / bs 32 | MuAdamW | 无教师 | |
rtv2 | PResNet-18 | 640×640 | 100e / bs 16 | MuAdamW | 无教师 | |
rtv2 | PResNet-34 | 640×640 | 100e / bs 16 | MuAdamW | 无教师 | |
rtv2 | PResNet-50 | 640×640 | 60e / bs 16 | MuAdamW | 无教师 | |
rtv2 | PResNet-50 | 640×640 | 72e / bs 16 | MuAdamW | 无教师 | |
rtv2 | PResNet-101 | 640×640 | 60e / bs 16 | MuAdamW | 无教师 |
dfine-s
DFINE 主干网络 HGNetv2-B0 · 默认 112 epochs · 全局 Batch 32 · 优化器 MuAdamW · lr 0.0002
from detrium import Detrium
model = Detrium("dfine-s")
metrics = model.train(data="custom.yaml", epochs=112, batch=32, imgsz=640, device="0,1")
results = model.predict("images/", conf=0.25, save=True)
model.export(format="onnx", imgsz=640, dynamic=True)展开完整合并后 YAML 配置(dfine/dfine_hgnetv2_s_coco.yml)
task: detection
evaluator:
type: CocoEvaluator
iou_types:
- bbox
num_classes: 80
remap_mscoco_category: true
train_dataloader:
type: DataLoader
dataset:
type: CocoDetection
img_folder: ./dataset/coco/train2017/
ann_file: ./dataset/coco/annotations/instances_train2017.json
return_masks: false
transforms:
type: Compose
ops:
- type: RandomPhotometricDistort
p: 0.5
- type: RandomZoomOut
fill: 0
- type: RandomIoUCrop
p: 0.8
- type: SanitizeBoundingBoxes
min_size: 1
- type: RandomHorizontalFlip
- type: Resize
size:
- 640
- 640
- type: SanitizeBoundingBoxes
min_size: 1
- type: ConvertPILImage
dtype: float32
scale: true
- type: ConvertBoxes
fmt: cxcywh
normalize: true
policy:
name: stop_epoch
epoch: 100
ops:
- Mosaic
- RandomPhotometricDistort
- RandomZoomOut
- RandomIoUCrop
shuffle: true
num_workers: 8
pin_memory: true
drop_last: true
collate_fn:
type: BatchImageCollateFunction
base_size: 640
base_size_repeat: 20
stop_epoch: 100
ema_restart_decay: 0.9999
total_batch_size: 32
val_dataloader:
type: DataLoader
dataset:
type: CocoDetection
img_folder: ./dataset/coco/val2017/
ann_file: ./dataset/coco/annotations/instances_val2017.json
return_masks: false
transforms:
type: Compose
ops:
- type: Resize
size:
- 640
- 640
- type: ConvertPILImage
dtype: float32
scale: true
shuffle: false
num_workers: 8
pin_memory: true
drop_last: false
collate_fn:
type: BatchImageCollateFunction
total_batch_size: 64
print_freq: 100
output_dir: ./outputs/dfine_hgnetv2_s_coco
checkpoint_freq: 4
sync_bn: true
bn_ema_sync_interval: 1
bn_momentum: null
precise_bn: null
precise_bn_batches: 64
find_unused_parameters: false
use_amp: true
scaler:
type: GradScaler
enabled: true
use_ema: true
ema:
type: ModelEMA
decay: 0.9999
warmups: 1000
start: 0
cuda_ops:
mode: auto
ops:
ms_deform_attn_v2: true
epochs: 112
clip_max_norm: 0.1
optimizer:
type: MuAdamW
include_backbone: false
muon_ratio: 1.0
momentum: 0.95
nesterov: true
ns_steps: 5
ns_scale: 0.2
params:
- params: ^(?=.*backbone)(?!.*norm|bn).*$
lr: 0.0001
- params: ^(?=.*backbone)(?=.*norm|bn).*$
lr: 0.0001
weight_decay: 0.0
- params: ^(?=.*(?:encoder|decoder))(?=.*(?:norm|bn|bias)).*$
weight_decay: 0.0
lr: 0.0002
betas:
- 0.9
- 0.999
weight_decay: 0.0001
lr_scheduler:
type: MultiStepLR
milestones:
- 500
gamma: 0.1
lr_warmup_scheduler:
type: LinearWarmup
warmup_duration: 500
model: RTv4
criterion: RTv4Criterion
postprocessor: PostProcessor
use_focal_loss: true
eval_spatial_size:
- 640
- 640
RTv4:
backbone: HGNetv2
encoder: HybridEncoder
decoder: DFINETransformer
lr_scheduler_type: flatcosine
lr_gamma: 1
warmup_iter: 500
flat_epoch: 4000000
no_aug_epoch: 0
HGNetv2:
pretrained: true
local_model_dir: ./pretrain/hgnetv2/
name: B0
return_idx:
- 1
- 2
- 3
freeze_at: -1
freeze_norm: false
use_lab: true
HybridEncoder:
in_channels:
- 256
- 512
- 1024
feat_strides:
- 8
- 16
- 32
hidden_dim: 256
use_encoder_idx:
- 2
num_encoder_layers: 1
nhead: 8
dim_feedforward: 1024
dropout: 0.0
enc_act: gelu
expansion: 0.5
depth_mult: 0.34
act: silu
DFINETransformer:
feat_channels:
- 256
- 256
- 256
feat_strides:
- 8
- 16
- 32
hidden_dim: 256
num_levels: 3
num_layers: 3
eval_idx: -1
num_queries: 300
num_denoising: 100
label_noise_ratio: 0.5
box_noise_scale: 1.0
reg_max: 32
reg_scale: 4
layer_scale: 1
num_points:
- 3
- 6
- 3
cross_attn_method: default
query_select_method: default
PostProcessor:
num_top_queries: 300
RTv4Criterion:
weight_dict:
loss_vfl: 1
loss_bbox: 5
loss_giou: 2
loss_fgl: 0.15
loss_ddf: 0.0
losses:
- vfl
- boxes
- local
alpha: 0.75
gamma: 2.0
reg_max: 32
matcher:
type: GPUAuctionMatcher
weight_dict:
cost_class: 2
cost_bbox: 5
cost_giou: 2
alpha: 0.25
gamma: 2.0
auction_rounds: 12
auction_eps: 0.015
greedy_passes: 2
disp_passes: 4