Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding RTDETRv2 #34773

Merged
merged 59 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
457ec3c
cookiecutter add rtdetrv2
Nov 15, 2024
53dd35b
make modular working
Nov 15, 2024
0dcc0c5
working modelgit add .
Nov 16, 2024
13ed8e5
working modelgit add .
Nov 16, 2024
f1cf051
finalize moduar inheritence
Nov 16, 2024
40e4c20
finalize moduar inheritence
Nov 16, 2024
52e9d8f
Update src/transformers/models/rtdetrv2/modular_rtdetrv2.py
jadechoghari Nov 21, 2024
1cb8414
update modular and add rename
jadechoghari Nov 21, 2024
dae9513
remove output ckpt
jadechoghari Nov 21, 2024
e940d27
define loss_kwargs
jadechoghari Nov 21, 2024
45349a6
fix CamelCase naming
jadechoghari Nov 23, 2024
cd6ffca
fix naming + files
Nov 27, 2024
d762677
fix modular and convert file
jadechoghari Dec 27, 2024
03bb2cc
additional changes
jadechoghari Dec 27, 2024
6135be4
Merge branch 'main' into rtdetrv2
jadechoghari Dec 27, 2024
350cafe
fix modular
jadechoghari Dec 29, 2024
db724d9
fix import error (switch to lazy)
jadechoghari Dec 29, 2024
8d37be4
fix autobackbone
jadechoghari Dec 29, 2024
d773a97
make style
jadechoghari Dec 29, 2024
35f8db7
add
jadechoghari Dec 30, 2024
bc5c5b0
update testing
jadechoghari Dec 30, 2024
859f367
fix loss
jadechoghari Jan 1, 2025
cfb9ea4
remove old folder
jadechoghari Jan 1, 2025
9a9e9f1
fix testing for v2
jadechoghari Jan 1, 2025
a29eed2
update docstring
jadechoghari Jan 2, 2025
7e1d4dd
fix docstring
jadechoghari Jan 2, 2025
032b916
add resnetv2 (with modular bug to fix)
jadechoghari Jan 3, 2025
5e00df2
remove resnetv2 backbone
jadechoghari Jan 6, 2025
f212548
fix changes
jadechoghari Jan 10, 2025
d868782
small fixes
jadechoghari Jan 11, 2025
b267a20
remove rtdetrv2resnetconfig
jadechoghari Jan 11, 2025
42b7ca5
Merge branch 'main' into rtdetrv2
jadechoghari Jan 11, 2025
d766434
add rtdetrv2 name to convert
jadechoghari Jan 11, 2025
d12e03a
make style
jadechoghari Jan 11, 2025
b2cea40
Update docs/source/en/model_doc/rt_detr_v2.md
jadechoghari Jan 14, 2025
8ed6f75
Update src/transformers/models/rt_detr_v2/modular_rt_detr_v2.py
jadechoghari Jan 14, 2025
d296af1
Update src/transformers/models/rt_detr_v2/modular_rt_detr_v2.py
jadechoghari Jan 14, 2025
73274c9
fix modular typo after review
Jan 14, 2025
60a74d3
add reviewed changes
jadechoghari Jan 18, 2025
1f4c082
add final review changes
jadechoghari Jan 20, 2025
959ee76
Update docs/source/en/model_doc/rt_detr_v2.md
jadechoghari Jan 22, 2025
cef9935
Update src/transformers/models/rt_detr_v2/__init__.py
jadechoghari Jan 22, 2025
77f455e
Update src/transformers/models/rt_detr_v2/convert_rt_detr_v2_weights_…
jadechoghari Jan 22, 2025
f56f195
add review changes
jadechoghari Jan 22, 2025
859e37a
remove rtdetrv2 resnet
jadechoghari Jan 22, 2025
2869cf3
removing this weird project change
jadechoghari Jan 31, 2025
152d7df
Merge branch 'main' into rtdetrv2
jadechoghari Jan 31, 2025
75ac690
change ckpt name from jadechoghari to author
jadechoghari Feb 1, 2025
6bfdc76
Merge branch 'main' into rtdetrv2
jadechoghari Feb 3, 2025
fed0d54
implement review and update testing
jadechoghari Feb 4, 2025
8d93109
Merge branch 'rtdetrv2' of https://github.com/jadechoghari/transforme…
jadechoghari Feb 4, 2025
cb7bf37
update naming and remove wrong ckpt
jadechoghari Feb 5, 2025
83711d4
name
jadechoghari Feb 5, 2025
d306d92
make fix-copies
jadechoghari Feb 5, 2025
f344181
Merge branch 'main' into rtdetrv2
jadechoghari Feb 6, 2025
ade4e3f
Fix RT-DETR loss
qubvel Feb 6, 2025
dd3c155
Add resources, fix name
qubvel Feb 6, 2025
aedcf12
Fix repo in docs
qubvel Feb 6, 2025
13b1c47
Fix table name
qubvel Feb 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/source/en/_toctree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,8 @@
title: ResNet
- local: model_doc/rt_detr
title: RT-DETR
- local: model_doc/rt_detr_v2
title: RTDetrv2
- local: model_doc/segformer
title: SegFormer
- local: model_doc/seggpt
Expand Down
57 changes: 57 additions & 0 deletions docs/source/en/model_doc/rt_detr_v2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!--Copyright 2024 The HuggingFace Team. All rights reserved.

jadechoghari marked this conversation as resolved.
Show resolved Hide resolved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.

⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be
rendered properly in your Markdown viewer.

-->

# RTDetrv2

## Overview

The RTDetrv2 model was proposed in [<INSERT PAPER NAME HERE>](<INSERT PAPER LINK HERE>) by <INSERT AUTHORS HERE>.
<INSERT SHORT SUMMARY HERE>

The abstract from the paper is the following:

*<INSERT PAPER ABSTRACT HERE>*

Tips:

<INSERT TIPS ABOUT MODEL HERE>

This model was contributed by [INSERT YOUR HF USERNAME HERE](https://huggingface.co/<INSERT YOUR HF USERNAME HERE>).
The original code can be found [here](<INSERT LINK TO GITHUB REPO HERE>).


## RTDetrv2Config

jadechoghari marked this conversation as resolved.
Show resolved Hide resolved
[[autodoc]] RTDetrv2Config

## RTDetrv2ResNetConfig

[[autodoc]] RTDetrv2ResNetConfig

## RTDetrv2Model

[[autodoc]] RTDetrv2Model
- forward

## RTDetrv2ForObjectDetection

[[autodoc]] RTDetrv2ForObjectDetection
- forward

## RTDetrv2ResNetBackbone

[[autodoc]] RTDetrv2ResNetBackbone
- forward
21 changes: 21 additions & 0 deletions src/transformers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@
"RoFormerTokenizer",
],
"models.rt_detr": ["RTDetrConfig", "RTDetrResNetConfig"],
"models.rtdetrv2": ["RTDetrv2Config", "RTDetrv2ResNetConfig"],
"models.rwkv": ["RwkvConfig"],
"models.sam": [
"SamConfig",
Expand Down Expand Up @@ -3269,6 +3270,15 @@
"RTDetrResNetPreTrainedModel",
]
)
_import_structure["models.rtdetrv2"].extend(
[
"RTDetrv2ForObjectDetection",
"RTDetrv2Model",
"RTDetrv2PreTrainedModel",
"RTDetrv2ResNetBackbone",
"RTDetrv2ResNetPreTrainedModel",
]
)
_import_structure["models.rwkv"].extend(
[
"RwkvForCausalLM",
Expand Down Expand Up @@ -5616,6 +5626,10 @@
RTDetrConfig,
RTDetrResNetConfig,
)
from .models.rtdetrv2 import (
RTDetrv2Config,
RTDetrv2ResNetConfig,
)
from .models.rwkv import RwkvConfig
from .models.sam import (
SamConfig,
Expand Down Expand Up @@ -7798,6 +7812,13 @@
RTDetrResNetBackbone,
RTDetrResNetPreTrainedModel,
)
from .models.rtdetrv2 import (
RTDetrv2ForObjectDetection,
RTDetrv2Model,
RTDetrv2PreTrainedModel,
RTDetrv2ResNetBackbone,
RTDetrv2ResNetPreTrainedModel,
)
from .models.rwkv import (
RwkvForCausalLM,
RwkvModel,
Expand Down
1 change: 1 addition & 0 deletions src/transformers/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@
roc_bert,
roformer,
rt_detr,
rtdetrv2,
rwkv,
sam,
seamless_m4t,
Expand Down
2 changes: 2 additions & 0 deletions src/transformers/models/auto/configuration_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@
("roc_bert", "RoCBertConfig"),
("roformer", "RoFormerConfig"),
("rt_detr", "RTDetrConfig"),
("rt_detr_v2", "RTDetrv2Config"),
("rt_detr_resnet", "RTDetrResNetConfig"),
("rwkv", "RwkvConfig"),
("sam", "SamConfig"),
Expand Down Expand Up @@ -556,6 +557,7 @@
("roc_bert", "RoCBert"),
("roformer", "RoFormer"),
("rt_detr", "RT-DETR"),
("rt_detr_v2", "RTDetrv2v2"),
("rt_detr_resnet", "RT-DETR-ResNet"),
("rwkv", "RWKV"),
("sam", "SAM"),
Expand Down
2 changes: 2 additions & 0 deletions src/transformers/models/auto/modeling_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@
("roc_bert", "RoCBertModel"),
("roformer", "RoFormerModel"),
("rt_detr", "RTDetrModel"),
("rt_detr_v2", "RTDetrv2Model"),
jadechoghari marked this conversation as resolved.
Show resolved Hide resolved
("rwkv", "RwkvModel"),
("sam", "SamModel"),
("seamless_m4t", "SeamlessM4TModel"),
Expand Down Expand Up @@ -846,6 +847,7 @@
("deta", "DetaForObjectDetection"),
("detr", "DetrForObjectDetection"),
("rt_detr", "RTDetrForObjectDetection"),
("rt_detr_v2", "RTDetrv2ForObjectDetection"),
("table-transformer", "TableTransformerForObjectDetection"),
("yolos", "YolosForObjectDetection"),
]
Expand Down
Loading