-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert conditional-detr and dn-detr pretrained weights (#210)
* add cond-detr r50&r101 dc5 models * refine readme * add DN-DETR converted weights
- Loading branch information
Showing
11 changed files
with
136 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
projects/conditional_detr/configs/conditional_detr_r101_dc5_50ep.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from .conditional_detr_r50_50ep import ( | ||
train, | ||
dataloader, | ||
optimizer, | ||
lr_multiplier, | ||
) | ||
from .models.conditional_detr_r50_dc5 import model | ||
|
||
# modify training config | ||
train.init_checkpoint = "https://download.pytorch.org/models/resnet101-63fe2227.pth" | ||
train.output_dir = "./output/conditional_detr_r101_dc5_50ep" | ||
|
||
# modify model | ||
model.backbone.name = "resnet101" |
11 changes: 11 additions & 0 deletions
11
projects/conditional_detr/configs/conditional_detr_r50_dc5_50ep.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from .conditional_detr_r50_50ep import ( | ||
train, | ||
dataloader, | ||
optimizer, | ||
lr_multiplier, | ||
) | ||
from .models.conditional_detr_r50_dc5 import model | ||
|
||
# modify training config | ||
train.init_checkpoint = "https://download.pytorch.org/models/resnet50-0676ba61.pth" | ||
train.output_dir = "./output/conditional_detr_r50_dc5_50ep" |
12 changes: 12 additions & 0 deletions
12
projects/conditional_detr/configs/models/conditional_detr_r50_dc5.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from detectron2.config import LazyCall as L | ||
from detrex.modeling.backbone.torchvision_resnet import TorchvisionResNet | ||
|
||
from .conditional_detr_r50 import model | ||
|
||
|
||
model.backbone=L(TorchvisionResNet)( | ||
name="resnet50", | ||
train_backbone=True, | ||
dilation=True, | ||
return_layers={"layer4": "res5"} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from .dn_detr_r50_50ep import ( | ||
train, | ||
dataloader, | ||
optimizer, | ||
lr_multiplier, | ||
) | ||
from .models.dn_detr_r50_dc5 import model | ||
|
||
# modify training config | ||
train.init_checkpoint = "https://download.pytorch.org/models/resnet50-0676ba61.pth" | ||
train.output_dir = "./output/dab_detr_r50_dc5_50ep" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from detectron2.config import LazyCall as L | ||
from detrex.modeling.backbone.torchvision_resnet import TorchvisionResNet | ||
|
||
from .dn_detr_r50 import model | ||
|
||
|
||
model.backbone=L(TorchvisionResNet)( | ||
name="resnet50", | ||
train_backbone=True, | ||
dilation=True, | ||
return_layers={"layer4": "res5"} | ||
) |