Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dcuai
dlexamples
Commits
85529f35
Commit
85529f35
authored
Jul 30, 2022
by
unknown
Browse files
添加openmmlab测试用例
parent
b21b0c01
Changes
977
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
491 additions
and
0 deletions
+491
-0
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/README.md
...st/mmclassification-speed-benchmark/configs/vgg/README.md
+30
-0
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/metafile.yml
...mmclassification-speed-benchmark/configs/vgg/metafile.yml
+120
-0
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/vgg11_b32x8_imagenet.py
...ation-speed-benchmark/configs/vgg/vgg11_b32x8_imagenet.py
+7
-0
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/vgg11bn_b32x8_imagenet.py
...ion-speed-benchmark/configs/vgg/vgg11bn_b32x8_imagenet.py
+5
-0
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/vgg13_b32x8_imagenet.py
...ation-speed-benchmark/configs/vgg/vgg13_b32x8_imagenet.py
+6
-0
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/vgg13bn_b32x8_imagenet.py
...ion-speed-benchmark/configs/vgg/vgg13bn_b32x8_imagenet.py
+5
-0
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/vgg16_b16x8_voc.py
...sification-speed-benchmark/configs/vgg/vgg16_b16x8_voc.py
+25
-0
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/vgg16_b32x8_imagenet.py
...ation-speed-benchmark/configs/vgg/vgg16_b32x8_imagenet.py
+6
-0
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/vgg16bn_b32x8_imagenet.py
...ion-speed-benchmark/configs/vgg/vgg16bn_b32x8_imagenet.py
+5
-0
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/vgg19_b32x8_imagenet.py
...ation-speed-benchmark/configs/vgg/vgg19_b32x8_imagenet.py
+6
-0
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/vgg19bn_b32x8_imagenet.py
...ion-speed-benchmark/configs/vgg/vgg19bn_b32x8_imagenet.py
+5
-0
openmmlab_test/mmclassification-speed-benchmark/configs/vision_transformer/vit_base_patch16_224_finetune_imagenet.py
...ion_transformer/vit_base_patch16_224_finetune_imagenet.py
+10
-0
openmmlab_test/mmclassification-speed-benchmark/configs/vision_transformer/vit_base_patch16_224_pretrain_imagenet.py
...ion_transformer/vit_base_patch16_224_pretrain_imagenet.py
+143
-0
openmmlab_test/mmclassification-speed-benchmark/configs/vision_transformer/vit_base_patch16_384_finetune_imagenet.py
...ion_transformer/vit_base_patch16_384_finetune_imagenet.py
+21
-0
openmmlab_test/mmclassification-speed-benchmark/configs/vision_transformer/vit_base_patch32_384_finetune_imagenet.py
...ion_transformer/vit_base_patch32_384_finetune_imagenet.py
+21
-0
openmmlab_test/mmclassification-speed-benchmark/configs/vision_transformer/vit_large_patch16_224_finetune_imagenet.py
...on_transformer/vit_large_patch16_224_finetune_imagenet.py
+10
-0
openmmlab_test/mmclassification-speed-benchmark/configs/vision_transformer/vit_large_patch16_384_finetune_imagenet.py
...on_transformer/vit_large_patch16_384_finetune_imagenet.py
+21
-0
openmmlab_test/mmclassification-speed-benchmark/configs/vision_transformer/vit_large_patch32_384_finetune_imagenet.py
...on_transformer/vit_large_patch32_384_finetune_imagenet.py
+21
-0
openmmlab_test/mmclassification-speed-benchmark/demo/demo.JPEG
...mlab_test/mmclassification-speed-benchmark/demo/demo.JPEG
+0
-0
openmmlab_test/mmclassification-speed-benchmark/demo/image_demo.py
..._test/mmclassification-speed-benchmark/demo/image_demo.py
+24
-0
No files found.
Too many changes to show.
To preserve performance only
977 of 977+
files are displayed.
Plain diff
Email patch
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/README.md
0 → 100644
View file @
85529f35
# Very Deep Convolutional Networks for Large-Scale Image Recognition
## Introduction
<!-- [ALGORITHM] -->
```
latex
@article
{
simonyan2014very,
title=
{
Very deep convolutional networks for large-scale image recognition
}
,
author=
{
Simonyan, Karen and Zisserman, Andrew
}
,
journal=
{
arXiv preprint arXiv:1409.1556
}
,
year=
{
2014
}
}
```
## Results and models
### ImageNet
| Model | Params(M) | Flops(G) | Top-1 (%) | Top-5 (%) | Config | Download |
|:---------------------:|:---------:|:--------:|:---------:|:---------:|:---------:|:--------:|
| VGG-11 | 132.86 | 7.63 | 68.75 | 88.87 |
[
config
](
https://github.com/open-mmlab/mmclassification/blob/master/configs/vgg/vgg11_b32x8_imagenet.py
)
|
[
model
](
https://download.openmmlab.com/mmclassification/v0/vgg/vgg11_batch256_imagenet_20210208-4271cd6c.pth
)
|
[
log
](
https://download.openmmlab.com/mmclassification/v0/vgg/vgg11_batch256_imagenet_20210208-4271cd6c.log.json
)
|
| VGG-13 | 133.05 | 11.34 | 70.02 | 89.46 |
[
config
](
https://github.com/open-mmlab/mmclassification/blob/master/configs/vgg/vgg13_b32x8_imagenet.py
)
|
[
model
](
https://download.openmmlab.com/mmclassification/v0/vgg/vgg13_batch256_imagenet_20210208-4d1d6080.pth
)
|
[
log
](
https://download.openmmlab.com/mmclassification/v0/vgg/vgg13_batch256_imagenet_20210208-4d1d6080.log.json
)
|
| VGG-16 | 138.36 | 15.5 | 71.62 | 90.49 |
[
config
](
https://github.com/open-mmlab/mmclassification/blob/master/configs/vgg/vgg16_b32x8_imagenet.py
)
|
[
model
](
https://download.openmmlab.com/mmclassification/v0/vgg/vgg16_batch256_imagenet_20210208-db26f1a5.pth
)
|
[
log
](
https://download.openmmlab.com/mmclassification/v0/vgg/vgg16_batch256_imagenet_20210208-db26f1a5.log.json
)
|
| VGG-19 | 143.67 | 19.67 | 72.41 | 90.80 |
[
config
](
https://github.com/open-mmlab/mmclassification/blob/master/configs/vgg/vgg19_b32x8_imagenet.py
)
|
[
model
](
https://download.openmmlab.com/mmclassification/v0/vgg/vgg19_bn_batch256_imagenet_20210208-da620c4f.pth
)
|
[
log
](
https://download.openmmlab.com/mmclassification/v0/vgg/vgg19_bn_batch256_imagenet_20210208-da620c4f.log.json
)
|
| VGG-11-BN | 132.87 | 7.64 | 70.75 | 90.12 |
[
config
](
https://github.com/open-mmlab/mmclassification/blob/master/configs/vgg/vgg11bn_b32x8_imagenet.py
)
|
[
model
](
https://download.openmmlab.com/mmclassification/v0/vgg/vgg11_bn_batch256_imagenet_20210207-f244902c.pth
)
|
[
log
](
https://download.openmmlab.com/mmclassification/v0/vgg/vgg11_bn_batch256_imagenet_20210207-f244902c.log.json
)
|
| VGG-13-BN | 133.05 | 11.36 | 72.15 | 90.71 |
[
config
](
https://github.com/open-mmlab/mmclassification/blob/master/configs/vgg/vgg13bn_b32x8_imagenet.py
)
|
[
model
](
https://download.openmmlab.com/mmclassification/v0/vgg/vgg13_bn_batch256_imagenet_20210207-1a8b7864.pth
)
|
[
log
](
https://download.openmmlab.com/mmclassification/v0/vgg/vgg13_bn_batch256_imagenet_20210207-1a8b7864.log.json
)
|
| VGG-16-BN | 138.37 | 15.53 | 73.72 | 91.68 |
[
config
](
https://github.com/open-mmlab/mmclassification/blob/master/configs/vgg/vgg16_b32x8_imagenet.py
)
|
[
model
](
https://download.openmmlab.com/mmclassification/v0/vgg/vgg16_bn_batch256_imagenet_20210208-7e55cd29.pth
)
|
[
log
](
https://download.openmmlab.com/mmclassification/v0/vgg/vgg16_bn_batch256_imagenet_20210208-7e55cd29.log.json
)
|
| VGG-19-BN | 143.68 | 19.7 | 74.70 | 92.24 |
[
config
](
https://github.com/open-mmlab/mmclassification/blob/master/configs/vgg/vgg19bn_b32x8_imagenet.py
)
|
[
model
](
https://download.openmmlab.com/mmclassification/v0/vgg/vgg19_bn_batch256_imagenet_20210208-da620c4f.pth
)
|
[
log
](
https://download.openmmlab.com/mmclassification/v0/vgg/vgg19_bn_batch256_imagenet_20210208-da620c4f.log.json
)
|
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/metafile.yml
0 → 100644
View file @
85529f35
Collections
:
-
Name
:
VGG
Metadata
:
Training Data
:
ImageNet
Training Techniques
:
-
SGD with Momentum
-
Weight Decay
Training Resources
:
8x Xp GPUs
Epochs
:
100
Batch Size
:
256
Architecture
:
-
VGG
Paper
:
https://arxiv.org/abs/1409.1556
README
:
configs/vgg/README.md
Models
:
-
Config
:
configs/vgg/vgg11_b32x8_imagenet.py
In Collection
:
VGG
Metadata
:
FLOPs
:
7630000000
Parameters
:
132860000
Name
:
vgg11_b32x8_imagenet
Results
:
-
Dataset
:
ImageNet
Metrics
:
Top 1 Accuracy
:
68.75
Top 5 Accuracy
:
88.87
Task
:
Image Classification
Weights
:
https://download.openmmlab.com/mmclassification/v0/vgg/vgg11_batch256_imagenet_20210208-4271cd6c.pth
-
Config
:
configs/vgg/vgg13_b32x8_imagenet.py
In Collection
:
VGG
Metadata
:
FLOPs
:
11340000000
Parameters
:
133050000
Name
:
vgg13_b32x8_imagenet
Results
:
-
Dataset
:
ImageNet
Metrics
:
Top 1 Accuracy
:
70.02
Top 5 Accuracy
:
89.46
Task
:
Image Classification
Weights
:
https://download.openmmlab.com/mmclassification/v0/vgg/vgg13_batch256_imagenet_20210208-4d1d6080.pth
-
Config
:
configs/vgg/vgg16_b32x8_imagenet.py
In Collection
:
VGG
Metadata
:
FLOPs
:
15500000000
Parameters
:
138360000
Name
:
vgg16_b32x8_imagenet
Results
:
-
Dataset
:
ImageNet
Metrics
:
Top 1 Accuracy
:
71.62
Top 5 Accuracy
:
90.49
Task
:
Image Classification
Weights
:
https://download.openmmlab.com/mmclassification/v0/vgg/vgg16_batch256_imagenet_20210208-db26f1a5.pth
-
Config
:
configs/vgg/vgg19_b32x8_imagenet.py
In Collection
:
VGG
Metadata
:
FLOPs
:
19670000000
Parameters
:
143670000
Name
:
vgg19_b32x8_imagenet
Results
:
-
Dataset
:
ImageNet
Metrics
:
Top 1 Accuracy
:
72.41
Top 5 Accuracy
:
90.8
Task
:
Image Classification
Weights
:
https://download.openmmlab.com/mmclassification/v0/vgg/vgg19_bn_batch256_imagenet_20210208-da620c4f.pth
-
Config
:
configs/vgg/vgg11bn_b32x8_imagenet.py
In Collection
:
VGG
Metadata
:
FLOPs
:
7640000000
Parameters
:
132870000
Name
:
vgg11bn_b32x8_imagenet
Results
:
-
Dataset
:
ImageNet
Metrics
:
Top 1 Accuracy
:
70.75
Top 5 Accuracy
:
90.12
Task
:
Image Classification
Weights
:
https://download.openmmlab.com/mmclassification/v0/vgg/vgg11_bn_batch256_imagenet_20210207-f244902c.pth
-
Config
:
configs/vgg/vgg13bn_b32x8_imagenet.py
In Collection
:
VGG
Metadata
:
FLOPs
:
11360000000
Parameters
:
133050000
Name
:
vgg13bn_b32x8_imagenet
Results
:
-
Dataset
:
ImageNet
Metrics
:
Top 1 Accuracy
:
72.15
Top 5 Accuracy
:
90.71
Task
:
Image Classification
Weights
:
https://download.openmmlab.com/mmclassification/v0/vgg/vgg13_bn_batch256_imagenet_20210207-1a8b7864.pth
-
Config
:
configs/vgg/vgg16_b32x8_imagenet.py
In Collection
:
VGG
Metadata
:
FLOPs
:
15530000000
Parameters
:
138370000
Name
:
vgg16_b32x8_imagenet
Results
:
-
Dataset
:
ImageNet
Metrics
:
Top 1 Accuracy
:
73.72
Top 5 Accuracy
:
91.68
Task
:
Image Classification
Weights
:
https://download.openmmlab.com/mmclassification/v0/vgg/vgg16_bn_batch256_imagenet_20210208-7e55cd29.pth
-
Config
:
configs/vgg/vgg19bn_b32x8_imagenet.py
In Collection
:
VGG
Metadata
:
FLOPs
:
19700000000
Parameters
:
143680000
Name
:
vgg19bn_b32x8_imagenet
Results
:
-
Dataset
:
ImageNet
Metrics
:
Top 1 Accuracy
:
74.7
Top 5 Accuracy
:
92.24
Task
:
Image Classification
Weights
:
https://download.openmmlab.com/mmclassification/v0/vgg/vgg19_bn_batch256_imagenet_20210208-da620c4f.pth
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/vgg11_b32x8_imagenet.py
0 → 100644
View file @
85529f35
_base_
=
[
'../_base_/models/vgg11.py'
,
'../_base_/datasets/imagenet_bs32_pil_resize.py'
,
'../_base_/schedules/imagenet_bs256.py'
,
'../_base_/default_runtime.py'
,
]
optimizer
=
dict
(
lr
=
0.01
)
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/vgg11bn_b32x8_imagenet.py
0 → 100644
View file @
85529f35
_base_
=
[
'../_base_/models/vgg11bn.py'
,
'../_base_/datasets/imagenet_bs32_pil_resize.py'
,
'../_base_/schedules/imagenet_bs256.py'
,
'../_base_/default_runtime.py'
]
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/vgg13_b32x8_imagenet.py
0 → 100644
View file @
85529f35
_base_
=
[
'../_base_/models/vgg13.py'
,
'../_base_/datasets/imagenet_bs32_pil_resize.py'
,
'../_base_/schedules/imagenet_bs256.py'
,
'../_base_/default_runtime.py'
]
optimizer
=
dict
(
lr
=
0.01
)
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/vgg13bn_b32x8_imagenet.py
0 → 100644
View file @
85529f35
_base_
=
[
'../_base_/models/vgg13bn.py'
,
'../_base_/datasets/imagenet_bs32_pil_resize.py'
,
'../_base_/schedules/imagenet_bs256.py'
,
'../_base_/default_runtime.py'
]
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/vgg16_b16x8_voc.py
0 → 100644
View file @
85529f35
_base_
=
[
'../_base_/datasets/voc_bs16.py'
,
'../_base_/default_runtime.py'
]
# use different head for multilabel task
model
=
dict
(
type
=
'ImageClassifier'
,
backbone
=
dict
(
type
=
'VGG'
,
depth
=
16
,
num_classes
=
20
),
neck
=
None
,
head
=
dict
(
type
=
'MultiLabelClsHead'
,
loss
=
dict
(
type
=
'CrossEntropyLoss'
,
use_sigmoid
=
True
,
loss_weight
=
1.0
)))
# load model pretrained on imagenet
load_from
=
'https://download.openmmlab.com/mmclassification/v0/vgg/vgg16_batch256_imagenet_20210208-db26f1a5.pth'
# noqa
# optimizer
optimizer
=
dict
(
type
=
'SGD'
,
lr
=
0.001
,
momentum
=
0.9
,
weight_decay
=
0
,
paramwise_cfg
=
dict
(
custom_keys
=
{
'.backbone.classifier'
:
dict
(
lr_mult
=
10
)}))
optimizer_config
=
dict
(
grad_clip
=
None
)
# learning policy
lr_config
=
dict
(
policy
=
'step'
,
step
=
20
,
gamma
=
0.1
)
runner
=
dict
(
type
=
'EpochBasedRunner'
,
max_epochs
=
40
)
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/vgg16_b32x8_imagenet.py
0 → 100644
View file @
85529f35
_base_
=
[
'../_base_/models/vgg16.py'
,
'../_base_/datasets/imagenet_bs32_pil_resize.py'
,
'../_base_/schedules/imagenet_bs256.py'
,
'../_base_/default_runtime.py'
]
optimizer
=
dict
(
lr
=
0.01
)
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/vgg16bn_b32x8_imagenet.py
0 → 100644
View file @
85529f35
_base_
=
[
'../_base_/models/vgg16bn.py'
,
'../_base_/datasets/imagenet_bs32_pil_resize.py'
,
'../_base_/schedules/imagenet_bs256.py'
,
'../_base_/default_runtime.py'
]
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/vgg19_b32x8_imagenet.py
0 → 100644
View file @
85529f35
_base_
=
[
'../_base_/models/vgg19.py'
,
'../_base_/datasets/imagenet_bs32_pil_resize.py'
,
'../_base_/schedules/imagenet_bs256.py'
,
'../_base_/default_runtime.py'
]
optimizer
=
dict
(
lr
=
0.01
)
openmmlab_test/mmclassification-speed-benchmark/configs/vgg/vgg19bn_b32x8_imagenet.py
0 → 100644
View file @
85529f35
_base_
=
[
'../_base_/models/vgg19bn.py'
,
'../_base_/datasets/imagenet_bs32_pil_resize.py'
,
'../_base_/schedules/imagenet_bs256.py'
,
'../_base_/default_runtime.py'
]
openmmlab_test/mmclassification-speed-benchmark/configs/vision_transformer/vit_base_patch16_224_finetune_imagenet.py
0 → 100644
View file @
85529f35
# Refer to pytorch-image-models
_base_
=
[
'../_base_/models/vit_base_patch16_224_finetune.py'
,
'../_base_/datasets/imagenet_bs32_pil_resize.py'
,
'../_base_/schedules/imagenet_bs256_epochstep.py'
,
'../_base_/default_runtime.py'
]
img_norm_cfg
=
dict
(
mean
=
[
127.5
,
127.5
,
127.5
],
std
=
[
127.5
,
127.5
,
127.5
],
to_rgb
=
True
)
openmmlab_test/mmclassification-speed-benchmark/configs/vision_transformer/vit_base_patch16_224_pretrain_imagenet.py
0 → 100644
View file @
85529f35
_base_
=
[
'../_base_/models/vit_base_patch16_224_pretrain.py'
,
'../_base_/datasets/imagenet_bs64_pil_resize.py'
,
'../_base_/schedules/imagenet_bs4096_AdamW.py'
,
'../_base_/default_runtime.py'
]
policies
=
[
[
dict
(
type
=
'Posterize'
,
bits
=
4
,
prob
=
0.4
),
dict
(
type
=
'Rotate'
,
angle
=
30.
,
prob
=
0.6
)
],
[
dict
(
type
=
'Solarize'
,
thr
=
256
/
9
*
4
,
prob
=
0.6
),
dict
(
type
=
'AutoContrast'
,
prob
=
0.5
)
],
[
dict
(
type
=
'Equalize'
,
prob
=
0.8
),
dict
(
type
=
'Equalize'
,
prob
=
0.6
)],
[
dict
(
type
=
'Posterize'
,
bits
=
5
,
prob
=
0.6
),
dict
(
type
=
'Posterize'
,
bits
=
5
,
prob
=
0.6
)
],
[
dict
(
type
=
'Equalize'
,
prob
=
0.4
),
dict
(
type
=
'Solarize'
,
thr
=
256
/
9
*
5
,
prob
=
0.2
)
],
[
dict
(
type
=
'Equalize'
,
prob
=
0.4
),
dict
(
type
=
'Rotate'
,
angle
=
30
/
9
*
8
,
prob
=
0.8
)
],
[
dict
(
type
=
'Solarize'
,
thr
=
256
/
9
*
6
,
prob
=
0.6
),
dict
(
type
=
'Equalize'
,
prob
=
0.6
)
],
[
dict
(
type
=
'Posterize'
,
bits
=
6
,
prob
=
0.8
),
dict
(
type
=
'Equalize'
,
prob
=
1.
)],
[
dict
(
type
=
'Rotate'
,
angle
=
10.
,
prob
=
0.2
),
dict
(
type
=
'Solarize'
,
thr
=
256
/
9
,
prob
=
0.6
)
],
[
dict
(
type
=
'Equalize'
,
prob
=
0.6
),
dict
(
type
=
'Posterize'
,
bits
=
5
,
prob
=
0.6
)
],
[
dict
(
type
=
'Rotate'
,
angle
=
30
/
9
*
8
,
prob
=
0.8
),
dict
(
type
=
'ColorTransform'
,
magnitude
=
0.
,
prob
=
0.4
)
],
[
dict
(
type
=
'Rotate'
,
angle
=
30.
,
prob
=
0.4
),
dict
(
type
=
'Equalize'
,
prob
=
0.6
)
],
[
dict
(
type
=
'Equalize'
,
prob
=
0.0
),
dict
(
type
=
'Equalize'
,
prob
=
0.8
)],
[
dict
(
type
=
'Invert'
,
prob
=
0.6
),
dict
(
type
=
'Equalize'
,
prob
=
1.
)],
[
dict
(
type
=
'ColorTransform'
,
magnitude
=
0.4
,
prob
=
0.6
),
dict
(
type
=
'Contrast'
,
magnitude
=
0.8
,
prob
=
1.
)
],
[
dict
(
type
=
'Rotate'
,
angle
=
30
/
9
*
8
,
prob
=
0.8
),
dict
(
type
=
'ColorTransform'
,
magnitude
=
0.2
,
prob
=
1.
)
],
[
dict
(
type
=
'ColorTransform'
,
magnitude
=
0.8
,
prob
=
0.8
),
dict
(
type
=
'Solarize'
,
thr
=
256
/
9
*
2
,
prob
=
0.8
)
],
[
dict
(
type
=
'Sharpness'
,
magnitude
=
0.7
,
prob
=
0.4
),
dict
(
type
=
'Invert'
,
prob
=
0.6
)
],
[
dict
(
type
=
'Shear'
,
magnitude
=
0.3
/
9
*
5
,
prob
=
0.6
,
direction
=
'horizontal'
),
dict
(
type
=
'Equalize'
,
prob
=
1.
)
],
[
dict
(
type
=
'ColorTransform'
,
magnitude
=
0.
,
prob
=
0.4
),
dict
(
type
=
'Equalize'
,
prob
=
0.6
)
],
[
dict
(
type
=
'Equalize'
,
prob
=
0.4
),
dict
(
type
=
'Solarize'
,
thr
=
256
/
9
*
5
,
prob
=
0.2
)
],
[
dict
(
type
=
'Solarize'
,
thr
=
256
/
9
*
4
,
prob
=
0.6
),
dict
(
type
=
'AutoContrast'
,
prob
=
0.6
)
],
[
dict
(
type
=
'Invert'
,
prob
=
0.6
),
dict
(
type
=
'Equalize'
,
prob
=
1.
)],
[
dict
(
type
=
'ColorTransform'
,
magnitude
=
0.4
,
prob
=
0.6
),
dict
(
type
=
'Contrast'
,
magnitude
=
0.8
,
prob
=
1.
)
],
[
dict
(
type
=
'Equalize'
,
prob
=
0.8
),
dict
(
type
=
'Equalize'
,
prob
=
0.6
)],
]
dataset_type
=
'ImageNet'
img_norm_cfg
=
dict
(
mean
=
[
123.675
,
116.28
,
103.53
],
std
=
[
58.395
,
57.12
,
57.375
],
to_rgb
=
True
)
train_pipeline
=
[
dict
(
type
=
'LoadImageFromFile'
),
dict
(
type
=
'RandomResizedCrop'
,
size
=
224
),
dict
(
type
=
'RandomFlip'
,
flip_prob
=
0.5
,
direction
=
'horizontal'
),
dict
(
type
=
'AutoAugment'
,
policies
=
policies
),
dict
(
type
=
'Normalize'
,
**
img_norm_cfg
),
dict
(
type
=
'ImageToTensor'
,
keys
=
[
'img'
]),
dict
(
type
=
'ToTensor'
,
keys
=
[
'gt_label'
]),
dict
(
type
=
'Collect'
,
keys
=
[
'img'
,
'gt_label'
])
]
test_pipeline
=
[
dict
(
type
=
'LoadImageFromFile'
),
dict
(
type
=
'Resize'
,
size
=
(
256
,
-
1
),
backend
=
'pillow'
),
dict
(
type
=
'CenterCrop'
,
crop_size
=
224
),
dict
(
type
=
'Normalize'
,
**
img_norm_cfg
),
dict
(
type
=
'ImageToTensor'
,
keys
=
[
'img'
]),
dict
(
type
=
'Collect'
,
keys
=
[
'img'
])
]
data
=
dict
(
samples_per_gpu
=
64
,
workers_per_gpu
=
2
,
train
=
dict
(
type
=
dataset_type
,
data_prefix
=
'data/imagenet/train'
,
pipeline
=
train_pipeline
),
val
=
dict
(
type
=
dataset_type
,
data_prefix
=
'data/imagenet/val'
,
ann_file
=
'data/imagenet/meta/val.txt'
,
pipeline
=
test_pipeline
),
test
=
dict
(
# replace `data/val` with `data/test` for standard test
type
=
dataset_type
,
data_prefix
=
'data/imagenet/val'
,
ann_file
=
'data/imagenet/meta/val.txt'
,
pipeline
=
test_pipeline
))
evaluation
=
dict
(
interval
=
1
,
metric
=
'accuracy'
)
openmmlab_test/mmclassification-speed-benchmark/configs/vision_transformer/vit_base_patch16_384_finetune_imagenet.py
0 → 100644
View file @
85529f35
# Refer to pytorch-image-models
_base_
=
[
'../_base_/models/vit_base_patch16_384_finetune.py'
,
'../_base_/datasets/imagenet_bs32_pil_resize.py'
,
'../_base_/schedules/imagenet_bs256_epochstep.py'
,
'../_base_/default_runtime.py'
]
img_norm_cfg
=
dict
(
mean
=
[
127.5
,
127.5
,
127.5
],
std
=
[
127.5
,
127.5
,
127.5
],
to_rgb
=
True
)
test_pipeline
=
[
dict
(
type
=
'LoadImageFromFile'
),
dict
(
type
=
'Resize'
,
size
=
(
384
,
-
1
),
backend
=
'pillow'
),
dict
(
type
=
'CenterCrop'
,
crop_size
=
384
),
dict
(
type
=
'Normalize'
,
**
img_norm_cfg
),
dict
(
type
=
'ImageToTensor'
,
keys
=
[
'img'
]),
dict
(
type
=
'Collect'
,
keys
=
[
'img'
])
]
data
=
dict
(
test
=
dict
(
pipeline
=
test_pipeline
))
openmmlab_test/mmclassification-speed-benchmark/configs/vision_transformer/vit_base_patch32_384_finetune_imagenet.py
0 → 100644
View file @
85529f35
# Refer to pytorch-image-models
_base_
=
[
'../_base_/models/vit_base_patch32_384_finetune.py'
,
'../_base_/datasets/imagenet_bs32_pil_resize.py'
,
'../_base_/schedules/imagenet_bs256_epochstep.py'
,
'../_base_/default_runtime.py'
]
img_norm_cfg
=
dict
(
mean
=
[
127.5
,
127.5
,
127.5
],
std
=
[
127.5
,
127.5
,
127.5
],
to_rgb
=
True
)
test_pipeline
=
[
dict
(
type
=
'LoadImageFromFile'
),
dict
(
type
=
'Resize'
,
size
=
(
384
,
-
1
),
backend
=
'pillow'
),
dict
(
type
=
'CenterCrop'
,
crop_size
=
384
),
dict
(
type
=
'Normalize'
,
**
img_norm_cfg
),
dict
(
type
=
'ImageToTensor'
,
keys
=
[
'img'
]),
dict
(
type
=
'Collect'
,
keys
=
[
'img'
])
]
data
=
dict
(
test
=
dict
(
pipeline
=
test_pipeline
))
openmmlab_test/mmclassification-speed-benchmark/configs/vision_transformer/vit_large_patch16_224_finetune_imagenet.py
0 → 100644
View file @
85529f35
# Refer to pytorch-image-models
_base_
=
[
'../_base_/models/vit_large_patch16_224_finetune.py'
,
'../_base_/datasets/imagenet_bs32_pil_resize.py'
,
'../_base_/schedules/imagenet_bs256_epochstep.py'
,
'../_base_/default_runtime.py'
]
img_norm_cfg
=
dict
(
mean
=
[
127.5
,
127.5
,
127.5
],
std
=
[
127.5
,
127.5
,
127.5
],
to_rgb
=
True
)
openmmlab_test/mmclassification-speed-benchmark/configs/vision_transformer/vit_large_patch16_384_finetune_imagenet.py
0 → 100644
View file @
85529f35
# Refer to pytorch-image-models
_base_
=
[
'../_base_/models/vit_large_patch16_384_finetune.py'
,
'../_base_/datasets/imagenet_bs32_pil_resize.py'
,
'../_base_/schedules/imagenet_bs256_epochstep.py'
,
'../_base_/default_runtime.py'
]
img_norm_cfg
=
dict
(
mean
=
[
127.5
,
127.5
,
127.5
],
std
=
[
127.5
,
127.5
,
127.5
],
to_rgb
=
True
)
test_pipeline
=
[
dict
(
type
=
'LoadImageFromFile'
),
dict
(
type
=
'Resize'
,
size
=
(
384
,
-
1
),
backend
=
'pillow'
),
dict
(
type
=
'CenterCrop'
,
crop_size
=
384
),
dict
(
type
=
'Normalize'
,
**
img_norm_cfg
),
dict
(
type
=
'ImageToTensor'
,
keys
=
[
'img'
]),
dict
(
type
=
'Collect'
,
keys
=
[
'img'
])
]
data
=
dict
(
test
=
dict
(
pipeline
=
test_pipeline
))
openmmlab_test/mmclassification-speed-benchmark/configs/vision_transformer/vit_large_patch32_384_finetune_imagenet.py
0 → 100644
View file @
85529f35
# Refer to pytorch-image-models
_base_
=
[
'../_base_/models/vit_large_patch32_384_finetune.py'
,
'../_base_/datasets/imagenet_bs32_pil_resize.py'
,
'../_base_/schedules/imagenet_bs256_epochstep.py'
,
'../_base_/default_runtime.py'
]
img_norm_cfg
=
dict
(
mean
=
[
127.5
,
127.5
,
127.5
],
std
=
[
127.5
,
127.5
,
127.5
],
to_rgb
=
True
)
test_pipeline
=
[
dict
(
type
=
'LoadImageFromFile'
),
dict
(
type
=
'Resize'
,
size
=
(
384
,
-
1
),
backend
=
'pillow'
),
dict
(
type
=
'CenterCrop'
,
crop_size
=
384
),
dict
(
type
=
'Normalize'
,
**
img_norm_cfg
),
dict
(
type
=
'ImageToTensor'
,
keys
=
[
'img'
]),
dict
(
type
=
'Collect'
,
keys
=
[
'img'
])
]
data
=
dict
(
test
=
dict
(
pipeline
=
test_pipeline
))
openmmlab_test/mmclassification-speed-benchmark/demo/demo.JPEG
0 → 100644
View file @
85529f35
107 KB
openmmlab_test/mmclassification-speed-benchmark/demo/image_demo.py
0 → 100644
View file @
85529f35
from
argparse
import
ArgumentParser
from
mmcls.apis
import
inference_model
,
init_model
,
show_result_pyplot
def
main
():
parser
=
ArgumentParser
()
parser
.
add_argument
(
'img'
,
help
=
'Image file'
)
parser
.
add_argument
(
'config'
,
help
=
'Config file'
)
parser
.
add_argument
(
'checkpoint'
,
help
=
'Checkpoint file'
)
parser
.
add_argument
(
'--device'
,
default
=
'cuda:0'
,
help
=
'Device used for inference'
)
args
=
parser
.
parse_args
()
# build the model from a config file and a checkpoint file
model
=
init_model
(
args
.
config
,
args
.
checkpoint
,
device
=
args
.
device
)
# test a single image
result
=
inference_model
(
model
,
args
.
img
)
# show the results
show_result_pyplot
(
model
,
args
.
img
,
result
)
if
__name__
==
'__main__'
:
main
()
Prev
1
…
6
7
8
9
10
11
12
13
14
…
49
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment