Skip to content

Commit 41c7bc9

Browse files
committed
update
1 parent 8ffa7be commit 41c7bc9

File tree

4 files changed

+115
-3
lines changed

4 files changed

+115
-3
lines changed

config/plain_detr_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
'backbone_norm': 'FrozeBN',
1010
'res5_dilation': False,
1111
'pretrained': True,
12-
'pretrained_weight': 'spark_resnet50',
12+
'pretrained_weight': 'spark_resnet50', # Cls: imagenet1k_v2; MIM: spark_resnet50
1313
'max_stride': 32,
1414
'out_stride': 16,
1515
# Transformer Ecndoer

config/rtdetr_config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,13 @@
180180
'lr_epoch': [33], # 1x
181181
# ----------------- Input -----------------
182182
## Transforms
183-
'train_min_size': [640, 640], # short edge of image
183+
'train_min_size': [[640, 640]], # short edge of image
184184
'train_min_size2': [[400, 400], [500, 500], [600, 600]],
185185
'train_max_size': 640,
186-
'test_min_size': [640, 640],
186+
'test_min_size': [[640, 640]],
187187
'test_max_size': 640,
188188
'random_crop_size': [320, 600],
189+
'random_size': [480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800],
189190
## Pixel mean & std
190191
'pixel_mean': [0.485, 0.456, 0.406],
191192
'pixel_std': [0.229, 0.224, 0.225],
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# PlainDETR
2+
3+
Our `PlainDETR-R50-1x` baseline on COCO-val:
4+
```Shell
5+
```
6+
7+
## Results on COCO
8+
9+
| Model | Scale | Pretrained | FPS | AP<sup>val<br>0.5:0.95 | AP<sup>val<br>0.5 | Weight | Logs |
10+
| --------------- | ---------- | ------------ | ----- | ---------------------- | --------------- | ------ | ----- |
11+
| PlainDETR-R50 | 800,1333 | IN1K-Cls | | | | | |
12+
| PlainDETR-R50 | 800,1333 | IN1K-MIM | | | | | |
13+
14+
- We explore whether PlainDETR can still be powerful when using ResNet as the backbone.
15+
- We set up two comparative experiments, using the ResNet-50 pre-trained for the IN1K classification task and the ResNet-50 pre-trained by IN1K's MIM as the backbone of PlainDETR. Among them, we used the MIM pre-trained ResNet-50 provided by [SparK](https://github.com/keyu-tian/SparK).
16+
17+
18+
## Train PlainDETR
19+
### Single GPU
20+
Taking training **PlainDETR** on COCO as the example,
21+
```Shell
22+
python main.py --cuda -d coco --root path/to/coco -m plain_detr_r50 --batch_size 16 --eval_epoch 2
23+
```
24+
25+
### Multi GPU
26+
Taking training **PlainDETR** on COCO as the example,
27+
```Shell
28+
python -m torch.distributed.run --nproc_per_node=8 train.py --cuda -dist -d coco --root path/to/coco -m plain_detr_r50 --batch_size 16 --eval_epoch 2
29+
```
30+
31+
## Test PlainDETR
32+
Taking testing **PlainDETR** on COCO-val as the example,
33+
```Shell
34+
python test.py --cuda -d coco --root path/to/coco -m plain_detr_r50 --weight path/to/plain_detr_r50.pth -vt 0.4 --show
35+
```
36+
37+
## Evaluate PlainDETR
38+
Taking evaluating **PlainDETR** on COCO-val as the example,
39+
```Shell
40+
python main.py --cuda -d coco --root path/to/coco -m plain_detr_r50 --resume path/to/plain_detr_r50.pth --eval_first
41+
```
42+
43+
## Demo
44+
### Detect with Image
45+
```Shell
46+
python demo.py --mode image --path_to_img path/to/image_dirs/ --cuda -m plain_detr_r50 --weight path/to/weight -vt 0.4 --show
47+
```
48+
49+
### Detect with Video
50+
```Shell
51+
python demo.py --mode video --path_to_vid path/to/video --cuda -m plain_detr_r50 --weight path/to/weight -vt 0.4 --show --gif
52+
```
53+
54+
### Detect with Camera
55+
```Shell
56+
python demo.py --mode camera --cuda -m plain_detr_r50 --weight path/to/weight -vt 0.4 --show --gif
57+
```

models/detectors/rtdetr/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Real-time DETR
2+
3+
Our `RT-DETR` baseline on COCO-val:
4+
```Shell
5+
```
6+
7+
## Results on COCO
8+
9+
| Model | Scale | FPS | AP<sup>val<br>0.5:0.95 | AP<sup>val<br>0.5 | Weight | Logs |
10+
| ------------- | ---------- | ----- | ---------------------- | --------------- | ------ | ----- |
11+
| RT-DETR-R18 | 800,1333 | | | | | |
12+
| RT-DETR-R50 | 800,1333 | | | | | |
13+
14+
15+
## Train RT-DETR
16+
### Single GPU
17+
Taking training **RT-DETR** on COCO as the example,
18+
```Shell
19+
python main.py --cuda -d coco --root path/to/coco -m rtdetr_r50 --batch_size 16 --eval_epoch 2
20+
```
21+
22+
### Multi GPU
23+
Taking training **RT-DETR** on COCO as the example,
24+
```Shell
25+
python -m torch.distributed.run --nproc_per_node=8 train.py --cuda -dist -d coco --root path/to/coco -m rtdetr_r50 --batch_size 16 --eval_epoch 2
26+
```
27+
28+
## Test RT-DETR
29+
Taking testing **RT-DETR** on COCO-val as the example,
30+
```Shell
31+
python test.py --cuda -d coco --root path/to/coco -m rtdetr_r50 --weight path/to/rtdetr_r50.pth -vt 0.4 --show
32+
```
33+
34+
## Evaluate RT-DETR
35+
Taking evaluating **RT-DETR** on COCO-val as the example,
36+
```Shell
37+
python main.py --cuda -d coco --root path/to/coco -m rtdetr_r50 --resume path/to/rtdetr_r50.pth --eval_first
38+
```
39+
40+
## Demo
41+
### Detect with Image
42+
```Shell
43+
python demo.py --mode image --path_to_img path/to/image_dirs/ --cuda -m rtdetr_r50 --weight path/to/weight -vt 0.4 --show
44+
```
45+
46+
### Detect with Video
47+
```Shell
48+
python demo.py --mode video --path_to_vid path/to/video --cuda -m rtdetr_r50 --weight path/to/weight -vt 0.4 --show --gif
49+
```
50+
51+
### Detect with Camera
52+
```Shell
53+
python demo.py --mode camera --cuda -m rtdetr_r50 --weight path/to/weight -vt 0.4 --show --gif
54+
```

0 commit comments

Comments
 (0)