Skip to content

Commit

Permalink
Update Deformable-DETR-Box-Refinement results (#102)
Browse files Browse the repository at this point in the history
* refine README

* update model zoo

Co-authored-by: ntianhe ren <rentianhe@dgx061.scc.idea>
  • Loading branch information
rentainhe and ntianhe ren committed Oct 16, 2022
1 parent 27830b6 commit da7a935
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/source/tutorials/Model_Zoo.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Here we provides our pretrained baselines in `detrex beta v0.1.0`. And more pret
<td align="center">R50</td>
<td align="center">IN1k</td>
<td align="center">50</td>
<td align="center">46.32</td>
<td align="center"> <a href="https://github.com/IDEA-Research/detrex-storage/releases/download/v0.1.0/deformable_detr_with_box_refinement_50ep.pth"> model </a></td>
<td align="center">46.99</td>
<td align="center"> <a href="https://github.com/IDEA-Research/detrex-storage/releases/download/v0.1.1/deformable_detr_with_box_refinement_50ep_new.pth"> model </a></td>
</tr>
<tr><td align="left"> <a href="https://github.com/IDEA-Research/detrex/blob/main/projects/deformable_detr/configs/deformable_detr_r50_two_stage_50ep.py"> Deformable-DETR + Box Refinement + Two Stage </a> </td>
<td align="center">R50</td>
Expand Down
4 changes: 2 additions & 2 deletions projects/deformable_detr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Here we provide the pretrained `Deformable-DETR` weights based on detrex.
<td align="center">R-50</td>
<td align="center">IN1k</td>
<td align="center">50</td>
<td align="center">46.32</td>
<td align="center"> <a href="https://github.com/IDEA-Research/detrex-storage/releases/download/v0.1.0/deformable_detr_with_box_refinement_50ep.pth">model</a></td>
<td align="center">46.99</td>
<td align="center"> <a href="https://github.com/IDEA-Research/detrex-storage/releases/download/v0.1.1/deformable_detr_with_box_refinement_50ep_new.pth">model</a></td>
</tr>
<!-- ROW: deformable_detr_r50_two_stage_50ep -->
<tr><td align="left"><a href="configs/deformable_detr_r50_two_stage_50ep.py">Deformable-DETR-R50 + Box-Refinement + Two-Stage</a></td>
Expand Down
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"

0 comments on commit da7a935

Please sign in to comment.