Skip to content

Commit

Permalink
Release detrex v0.2.0 (#127)
Browse files Browse the repository at this point in the history
* set training seed

* add 900 queries config for dab-deformable

* add dab-deformable-detr new baseline

* refine dab-deformable-detr configs

* refine training results

* refine ModelZoo

* refine README

* refine changelog

Co-authored-by: ntianhe ren <[email protected]>
Co-authored-by: ntianhe ren <[email protected]>
  • Loading branch information
3 people authored Nov 13, 2022
1 parent a11157f commit 3362af4
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 29 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,12 @@ The repo name detrex has several interpretations:
- <font color=#008000> <b> de-t.rex </b> </font>: de means 'the' in Dutch. T.rex, also called Tyrannosaurus Rex, means 'king of the tyrant lizards' and connects to our research work 'DINO', which is short for Dinosaur.

## What's New
v0.1.1 was released on 18/10/2022:
- Add model analysis tools and benchmark in [tools](./tools/).
- Support visualization on COCO eval results and annotations in [tools](./tools/)
- Support [Group-DETR](./projects/group_detr/).
- Release more DINO training results including `DINO-R50-24epochs`, `DINO-R101`, `DINO-Swin-Tiny`, `DINO-Swin-Small`, `DINO-Swin-Base`, `DINO-Swin-Large` in [DINO](./projects/dino/).
- Release better `Deformable-DETR` baselines with **48.2 AP** on COCO dataset in [Deformable-DETR](./projects/deformable_detr/).

v0.2.0 was released on 13/11/2022:
- Release new baselines for `DINO-R50-12ep`, `DINO-Swin-Large-36ep`, `DAB-Deformable-DETR-R50-50ep`, `DAB-Deformable-DETR-R50-Two-Stage`, please check [Model Zoo](https://detrex.readthedocs.io/en/latest/tutorials/Model_Zoo.html).
- Rebuild a clearer config files for projects.
- Support [H-Deformable-DETR](./projects/h_deformable_detr/)
- Release H-Deformable-DETR pretrained weights including `H-Deformable-DETR-R50`, `H-Deformable-DETR-Swin-Tiny`, `H-Deformable-DETR-Swin-Large` in [H-Deformable-DETR](./projects/h_deformable_detr/)
- Add demo for visualizing customized input images or videos using pretrained weights in [demo](./demo/)

Please see [changelog.md](./changlog.md) for details and release history.

Expand Down
8 changes: 8 additions & 0 deletions changlog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## Change Log

### v0.2.0 (13/11/2022)
#### New Features
- Rebuild a clearer config files for projects [#107](https://github.com/IDEA-Research/detrex/pull/107)
- Support [H-Deformable-DETR](https://github.com/IDEA-Research/detrex/tree/main/projects/h_deformable_detr) [#110](https://github.com/IDEA-Research/detrex/pull/110)
- Release H-Deformable-DETR pretrained weights including `H-Deformable-DETR-R50`, `H-Deformable-DETR-Swin-Tiny`, `H-Deformable-DETR-Swin-Large`.
- Add demo for visualizing customized input images or videos using pretrained weights [#119](https://github.com/IDEA-Research/detrex/pull/119)
- Release new baselines for `DINO-Swin-Large-36ep`, `DAB-Deformable-DETR-R50-50ep`, `DAB-Deformable-DETR-Two-Stage-50ep`, `H-DETR`.

### v0.1.1 (18/10/2022)
#### New Features
- Add model analyze tools for detrex [#79](https://github.com/IDEA-Research/detrex/pull/79)
Expand Down
8 changes: 8 additions & 0 deletions docs/source/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## Change Log

### v0.2.0 (13/11/2022)
#### New Features
- Rebuild a clearer config files for projects [#107](https://github.com/IDEA-Research/detrex/pull/107)
- Support [H-Deformable-DETR](https://github.com/IDEA-Research/detrex/tree/main/projects/h_deformable_detr) [#110](https://github.com/IDEA-Research/detrex/pull/110)
- Release H-Deformable-DETR pretrained weights including `H-Deformable-DETR-R50`, `H-Deformable-DETR-Swin-Tiny`, `H-Deformable-DETR-Swin-Large`.
- Add demo for visualizing customized input images or videos using pretrained weights [#119](https://github.com/IDEA-Research/detrex/pull/119)
- Release new baselines for `DINO-Swin-Large-36ep`, `DAB-Deformable-DETR-R50-50ep`, `DAB-Deformable-DETR-Two-Stage-50ep`, `H-DETR`.

### v0.1.1 (18/10/2022)
#### New Features
- Add model analyze tools for detrex [#79](https://github.com/IDEA-Research/detrex/pull/79)
Expand Down
12 changes: 6 additions & 6 deletions docs/source/tutorials/Model_Zoo.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ Here we provides our pretrained baselines with **detrex**. And more pretrained w
<td align="center">R50</td>
<td align="center">IN1k</td>
<td align="center">50</td>
<td align="center">48.87</td>
<td align="center"> <a href="https://github.com/IDEA-Research/detrex-storage/releases/download/v0.1.0/dab_deformable_r50_50ep.pth"> model </a></td>
<td align="center">49.01</td>
<td align="center"> <a href="https://github.com/IDEA-Research/detrex-storage/releases/download/v0.2.0/dab_deformable_detr_r50_50ep_49AP.pth"> model </a></td>
</tr>
<tr><td align="left"> <a href="https://github.com/IDEA-Research/detrex/blob/main/projects/dab_deformable_detr/configs/dab_deformable_detr_r50_two_stage_50ep.py"> DAB-Deformable-DETR-R50-Two-Stage </a> </td>
<td align="center">R50</td>
<td align="center">IN1k</td>
<td align="center">50</td>
<td align="center">49.54</td>
<td align="center"> <a href="https://github.com/IDEA-Research/detrex-storage/releases/download/v0.1.0/dab_deformable_r50_two_stage_50ep.pth"> model </a></td>
<td align="center">49.70</td>
<td align="center"> <a href="https://github.com/IDEA-Research/detrex-storage/releases/download/v0.2.0/dab_deformable_detr_r50_two_stage_49_7AP.pth"> model </a></td>
</tr>
</tbody></table>

Expand Down Expand Up @@ -143,8 +143,8 @@ Here we provides our pretrained baselines with **detrex**. And more pretrained w
<td align="center">IN1k</td>
<td align="center">12</td>
<td align="center">100</td>
<td align="center">49.05</td>
<td align="center"> <a href="https://github.com/IDEA-Research/detrex-storage/releases/download/v0.1.0/dino_r50_4scale_12ep.pth"> model </a></td>
<td align="center">49.19</td>
<td align="center"> <a href="https://github.com/IDEA-Research/detrex-storage/releases/download/v0.2.0/dino_r50_4scale_12ep_49_2AP.pth"> model </a></td>
</tr>
<tr><td align="left"> <a href="https://github.com/IDEA-Research/detrex/blob/main/projects/dino/configs/dino_r50_4scale_12ep_300dn.py"> DINO-R50-4Scale </a> </td>
<td align="center">R50</td>
Expand Down
8 changes: 4 additions & 4 deletions projects/dab_deformable_detr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ Here we provide the pretrained `DAB-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">48.87</td>
<td align="center"> <a href="https://github.com/IDEA-Research/detrex-storage/releases/download/v0.1.0/dab_deformable_r50_50ep.pth">model</a></td>
<td align="center">49.01</td>
<td align="center"> <a href="https://github.com/IDEA-Research/detrex-storage/releases/download/v0.2.0/dab_deformable_detr_r50_50ep_49AP.pth">model</a></td>
</tr>
<!-- ROW: dab_deformable_detr_r50_two_stage_50ep -->
<tr><td align="left"><a href="configs/dab_deformable_detr_r50_two_stage_50ep.py">DAB-Deformable-DETR-R50-Two-Stage</a></td>
<td align="center">R-50</td>
<td align="center">IN1k</td>
<td align="center">50</td>
<td align="center">49.54</td>
<td align="center"> <a href="https://github.com/IDEA-Research/detrex-storage/releases/download/v0.1.0/dab_deformable_r50_two_stage_50ep.pth">model</a></td>
<td align="center">49.70</td>
<td align="center"> <a href="https://github.com/IDEA-Research/detrex-storage/releases/download/v0.2.0/dab_deformable_detr_r50_two_stage_49_7AP.pth">model</a></td>
</tr>
</tbody></table>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
train.init_checkpoint = "detectron2://ImageNetPretrained/torchvision/R-50.pkl"
train.output_dir = "./output/dab_deformable_detr_r50_50ep"

# set training seed
train.seed = 42

# max training iterations
train.max_iter = 375000

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,18 @@
model,
)

# modify model config
model.as_two_stage = True

# modify training config
train.init_checkpoint = "detectron2://ImageNetPretrained/torchvision/R-50.pkl"
train.output_dir = "./output/dab_deformable_detr_r50_two_stage_50ep"

# modify model config
model.as_two_stage = True

# modify loss weight dict
# this is an hack implementation which will be improved in the future
aux_weight_dict = {
"loss_class_enc": 1.0,
"loss_bbox_enc": 5.0,
"loss_giou_enc": 2.0,
}
model.criterion.weight_dict.update(aux_weight_dict)
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from .dab_deformable_detr_r50_50ep import (
train,
dataloader,
optimizer,
lr_multiplier,
model,
)

# modify training config
train.init_checkpoint = "detectron2://ImageNetPretrained/torchvision/R-50.pkl"
train.output_dir = "./output/dab_deformable_detr_r50_two_stage_50ep"

# add query nums
model.num_queries = 900

# modify model config
model.as_two_stage = True

# modify loss weight dict
# this is an hack implementation which will be improved in the future
aux_weight_dict = {
"loss_class_enc": 1.0,
"loss_bbox_enc": 5.0,
"loss_giou_enc": 2.0,
}
model.criterion.weight_dict.update(aux_weight_dict)
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,3 @@
weight_dict.update(aux_weight_dict)
model.criterion.weight_dict = weight_dict

if model.as_two_stage:
weight_dict = model.criterion.weight_dict
aux_weight_dict = {}
aux_weight_dict.update({k + "_enc": v for k, v in base_weight_dict.items()})
weight_dict.update(aux_weight_dict)
model.criterion.weight_dict = weight_dict
4 changes: 2 additions & 2 deletions projects/dino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Here we provide the pretrained `DINO` weights based on detrex.
<td align="center">IN1k</td>
<td align="center">12</td>
<td align="center">100</td>
<td align="center">49.05</td>
<td align="center"> <a href="https://github.com/IDEA-Research/detrex-storage/releases/download/v0.1.0/dino_r50_4scale_12ep.pth">model</a></td>
<td align="center">49.19</td>
<td align="center"> <a href="https://github.com/IDEA-Research/detrex-storage/releases/download/v0.2.0/dino_r50_4scale_12ep_49_2AP.pth">model</a></td>
</tr>
<!-- ROW: dino_r50_4scale_12ep -->
<tr><td align="left"><a href="configs/dino_r50_4cale_12ep.py">DINO-R50-4scale</a></td>
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from torch.utils.cpp_extension import CUDA_HOME, CppExtension, CUDAExtension

# detrex version info
version = "0.1.1"
version = "0.2.0"
package_name = "detrex"
cwd = os.path.dirname(os.path.abspath(__file__))

Expand Down

0 comments on commit 3362af4

Please sign in to comment.