lyuwenyu / RT-DETR

[CVPR 2024] Official RT-DETR (RTDETR paddle pytorch), Real-Time DEtection TRansformer, DETRs Beat YOLOs on Real-time Object Detection. 🔥 🔥 🔥
Apache License 2.0
2.31k stars 258 forks source link

changing backbone #274

Closed hweejuni closed 5 months ago

hweejuni commented 5 months ago

Hi. Thank you for your hard work.

I'm trying to change the backbone (currently resnet50) for further ablation but the part related to manipulating backbone seems complicated. I want to apply torchvision's models or timm models. What is the most efficient way to change backbone? I am struggling. Thanks.

lyuwenyu commented 5 months ago

You should register the torchvision or timm model firstly, then using it in yaml config.

ramonhollands commented 5 months ago

@hweejuni Any success? Would be interesting to hear from!

hweejuni commented 5 months ago

Hi. I imported timm's CSPResNet model (the raw code) and got the training worked. What I did was, I added cspnet.py, added register decorator, adjusted dimension size of the cspnet output, and added cspnet import to init.py (It took me long time to understand how registere works haha).

ramonhollands commented 3 months ago

See https://github.com/lyuwenyu/RT-DETR/issues/332 for adding timm backbones