mmclassification/tests/test_configs.py
Yixiao Fang 89000c10eb
[Refactor] Refactor configs and metafile (#1369)
* update base datasets

* update base

* update barlowtwins

* update with new convention

* update

* update

* update

* add schedule

* add densecl

* add eva

* add mae

* add maskfeat

* add milan and mixmim

* add moco

* add swav simclr

* add simmim and simsiam

* refine

* update

* add to model index

* update config inheritance

* fix error in metafile

* Update pre-commit and metafile check script

* update metafile

* fix name error

* Fix classification model name and config name

---------

Co-authored-by: mzr1996 <mzr1996@163.com>
2023-02-23 11:17:16 +08:00

26 lines
642 B
Python

# Copyright (c) OpenMMLab. All rights reserved.
import os
import os.path as osp
from mmengine.config import Config
def get_config_list(path, file_list):
files = os.listdir(path)
for f in files:
tmp_path = osp.join(path, f)
if osp.isdir(tmp_path):
get_config_list(tmp_path, file_list)
elif f[-2:] == 'py':
file_list.append(tmp_path)
def test_configs():
path = osp.join(osp.dirname(__file__), '..', 'configs')
config_list = []
get_config_list(path, config_list)
for config in config_list:
cfg = Config.fromfile(config)
assert isinstance(cfg, Config)