collect_env.py 703 Bytes
Newer Older
dingchang's avatar
dingchang committed
1
# Copyright (c) OpenMMLab. All rights reserved.
2
3
from mmcv.utils import collect_env as collect_base_env
from mmcv.utils import get_git_hash
zhangwenwei's avatar
zhangwenwei committed
4
5

import mmdet
6
import mmdet3d
7
import mmseg
VVsssssk's avatar
VVsssssk committed
8
from mmdet3d.ops.spconv import IS_SPCONV2_AVAILABLE
zhangwenwei's avatar
zhangwenwei committed
9
10
11


def collect_env():
12
13
    """Collect the information of the running environments."""
    env_info = collect_base_env()
14
    env_info['MMDetection'] = mmdet.__version__
15
    env_info['MMSegmentation'] = mmseg.__version__
16
    env_info['MMDetection3D'] = mmdet3d.__version__ + '+' + get_git_hash()[:7]
VVsssssk's avatar
VVsssssk committed
17
    env_info['spconv2.0'] = IS_SPCONV2_AVAILABLE
zhangwenwei's avatar
zhangwenwei committed
18
19
20
21
22
    return env_info


if __name__ == '__main__':
    for name, val in collect_env().items():
23
        print(f'{name}: {val}')