PekingU/rtdetr_r50vd
Original42.9Mparameters
Fixture10.9Mparameters
Layer stacks10compared
Findings0to review
✓ Same architecture, smaller
Every module class, layer kind and checked property of the original is in the fixture.
Model tester (advisory)
The model's own small test config in its ModelTester (39 literal values, 39 set by the model's own tester, the rest generic base-tester defaults). Testers are usually representative but not always, so these notes are for review, not rules.
- encoder_hidden_dim kept at the checkpoint's 256; the model tester uses 32
Layer stacks
One square per layer, colored by kind: the layer's module classes and type attributes. Hover a square for its index and kind.
model.backbone.model.encoder.stages
Original · 4
Fixture · 4
| Kind | Original | Fixture | |
|---|---|---|---|
| no AvgPool2d | 1 | 1 | ✓ kept |
| AvgPool2d | 3 | 3 | ✓ kept |
model.encoder_input_proj
Original · 3
Fixture · 3
| Kind | Original | Fixture | |
|---|---|---|---|
| Conv2d | 3 | 3 | ✓ kept |
model.encoder.aifi
Original · 1
Fixture · 1
| Kind | Original | Fixture | |
|---|---|---|---|
| AIFILayer | 1 | 1 | ✓ kept |
model.encoder.lateral_convs
Original · 2
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| ConvNormLayer | 2 | 2 | ✓ kept |
model.encoder.fpn_blocks
Original · 2
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| RepVggBlock | 2 | 2 | ✓ kept |
model.encoder.downsample_convs
Original · 2
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| ConvNormLayer | 2 | 2 | ✓ kept |
model.encoder.pan_blocks
Original · 2
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| RepVggBlock | 2 | 2 | ✓ kept |
model.decoder_input_proj
Original · 3
Fixture · 3
| Kind | Original | Fixture | |
|---|---|---|---|
| Conv2d | 3 | 3 | ✓ kept |
model.decoder.layers
Original · 6
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| DecoderLayer | 6 | 2 | ✓ kept |
model.decoder.bbox_embed
Original · 6
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| Linear | 6 | 2 | ✓ kept |
Where the parameters are
Share of each model's parameters per component. Vocabulary and patch sizes are kept, so embeddings usually take a larger share of the fixture.
Original
Fixture
| Component | Original | Share | Fixture | Share |
|---|---|---|---|---|
| model.backbone.model.encoder.stages | 23.4M | 54.7% | 32.4K | 0.3% |
| model.decoder.layers | 6.0M | 13.9% | 102.6K | 0.9% |
| model.encoder.fpn_blocks | 4.5M | 10.4% | 4.5M | 40.9% |
| model.encoder.pan_blocks | 4.5M | 10.4% | 4.5M | 40.9% |
| model.encoder.downsample_convs | 1.2M | 2.8% | 1.2M | 10.8% |
| model.encoder_input_proj | 919.0K | 2.1% | 58.9K | 0.5% |
| model.decoder.bbox_embed | 795.7K | 1.9% | 17.2K | 0.2% |
| 9 others | 1.6M | 3.8% | 582.8K | 5.3% |
Preserved properties
| Config | Property | Original | Fixture | |
|---|---|---|---|---|
| model | model_type | rt_detr | rt_detr | ✓ kept |
| backbone_config | model_type | rt_detr_resnet | rt_detr_resnet | ✓ kept |
| backbone_config | hidden_act | relu | relu | ✓ kept |
| backbone_config | num_channels | 3 | 3 | ✓ kept |
Module classes
Instances of each class in the built model (prefix RTDetr omitted).
| Class | Original | Fixture |
|---|---|---|
| Conv2d | 97 | 61 |
| Linear | 97 | 41 |
| ReLU | 57 | 17 |
| Identity | 56 | 32 |
| FrozenBatchNorm2d | 55 | 19 |
| ResNetConvLayer | 51 | 15 |
| BatchNorm2d | 42 | 42 |
| ConvNormLayer | 36 | 36 |
| Sequential | 35 | 23 |
| SiLUActivation | 24 | 24 |
| LayerNorm | 21 | 9 |
| ModuleList | 20 | 16 |
| ResNetBottleNeckLayer | 16 | 4 |
| RepVggBlock | 12 | 12 |
| MLPPredictionHead | 8 | 4 |
| MLP | 7 | 3 |
| SelfAttention | 7 | 3 |
| MultiScaleDeformableAttention | 6 | 2 |
| DecoderLayer | 6 | 2 |
| MultiscaleDeformableAttention | 6 | 2 |
| CSPRepLayer | 4 | 4 |
| ResNetShortCut | 4 | 4 |
| ResNetStage | 4 | 4 |
| AvgPool2d | 3 | 3 |
| Embedding | 1 | 1 |
| GELUActivation | 1 | 1 |
| MaxPool2d | 1 | 1 |
| AIFILayer | 1 | 1 |
| ConvEncoder | 1 | 1 |
| Decoder | 1 | 1 |
| EncoderLayer | 1 | 1 |
| ForObjectDetection | 1 | 1 |
| HybridEncoder | 1 | 1 |
| Model | 1 | 1 |
| ResNetBackbone | 1 | 1 |
| ResNetEmbeddings | 1 | 1 |
| ResNetEncoder | 1 | 1 |
| SinePositionEmbedding | 1 | 1 |
Config changes
9 fields changed, 71 unchanged.
| Field | Original | Fixture |
|---|---|---|
| backbone_config.depths | [3, 4, 6, 3] | [1, 1, 1, 1] |
| backbone_config.hidden_sizes | [256, 512, 1024, 2048] | [16, 32, 64, 128] |
| d_model | 256 | 64 |
| decoder_attention_heads | 8 | 4 |
| decoder_ffn_dim | 1024 | 128 |
| decoder_layers | 6 | 2 |
| encoder_attention_heads | 8 | 4 |
| encoder_ffn_dim | 1024 | 128 |
| encoder_in_channels | [512, 1024, 2048] | [32, 64, 128] |