mirror of
https://github.com/open-mmlab/mmclassification.git
synced 2025-06-03 21:53:55 +08:00
* [Feature]: Add caption * [Feature]: Update scienceqa * [CI] Add test mim CI. (#879) * refactor imagenet dataset * refactor imagenet dataset * refactor imagenet dataset * update imagenet21k * update configs * update mnist * update dataset_prepare.md * fix sun397 url and update user_guides/dataset_prepare.md * update dataset_prepare.md * fix sun397 dataset * fix sun397 * update chinese dataset_prepare.md * update dataset_prepare.md * [Refactor] update voc dataset * [Refactor] update voc dataset * refactor imagenet * refactor imagenet * use mmengine.fileio --------- Co-authored-by: liuyuan <3463423099@qq.com> Co-authored-by: Ma Zerun <mzr1996@163.com> Co-authored-by: Ezra-Yu <18586273+Ezra-Yu@users.noreply.github.com>
29 lines
722 B
Python
29 lines
722 B
Python
# dataset settings
|
|
dataset_type = 'ImageNet21k'
|
|
data_preprocessor = dict(
|
|
num_classes=21842,
|
|
# RGB format normalization parameters
|
|
mean=[123.675, 116.28, 103.53],
|
|
std=[58.395, 57.12, 57.375],
|
|
# convert image from BGR to RGB
|
|
to_rgb=True,
|
|
)
|
|
|
|
train_pipeline = [
|
|
dict(type='LoadImageFromFile'),
|
|
dict(type='RandomResizedCrop', scale=224),
|
|
dict(type='RandomFlip', prob=0.5, direction='horizontal'),
|
|
dict(type='PackInputs'),
|
|
]
|
|
|
|
train_dataloader = dict(
|
|
batch_size=128,
|
|
num_workers=5,
|
|
dataset=dict(
|
|
type=dataset_type,
|
|
data_root='data/imagenet21k',
|
|
split='train',
|
|
pipeline=train_pipeline),
|
|
sampler=dict(type='DefaultSampler', shuffle=True),
|
|
)
|