-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Deformable-DETR-Box-Refinement results (#102)
* refine README * update model zoo Co-authored-by: ntianhe ren <rentianhe@dgx061.scc.idea>
- Loading branch information
Showing
3 changed files
with
19 additions
and
5 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
16 changes: 15 additions & 1 deletion
16
projects/deformable_detr/configs/deformable_detr_r50_with_box_refinement_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 |
---|---|---|
@@ -1,8 +1,22 @@ | ||
from .deformable_detr_r50_50ep import train, dataloader, optimizer, lr_multiplier, model | ||
|
||
# modify model config | ||
# set loss_class to 1.0 brings better results for deformable-detr-box-refinement under lr=1e-4 | ||
model.with_box_refine = True | ||
model.criterion.weight_dict = { | ||
"loss_class": 1.0, | ||
"loss_bbox": 5.0, | ||
"loss_giou": 2.0, | ||
} | ||
if model.aux_loss: | ||
weight_dict = model.criterion.weight_dict | ||
aux_weight_dict = {} | ||
for i in range(model.transformer.decoder.num_layers - 1): | ||
aux_weight_dict.update({k + f"_{i}": v for k, v in weight_dict.items()}) | ||
aux_weight_dict.update({k + "_enc": v for k, v in weight_dict.items()}) | ||
weight_dict.update(aux_weight_dict) | ||
model.criterion.weight_dict = weight_dict | ||
|
||
# modify training config | ||
train.init_checkpoint = "detectron2://ImageNetPretrained/torchvision/R-50.pkl" | ||
train.output_dir = "./output/deformable_detr_with_box_refinement_50ep" | ||
train.output_dir = "./output/deformable_detr_with_box_refinement_50ep" |