collect_env.py 488 B

1234567891011121314151617
  1. # Copyright (c) OpenMMLab. All rights reserved.
  2. from mmengine.utils import get_git_hash
  3. from mmengine.utils.dl_utils import collect_env as collect_base_env
  4. import mmdet
  5. def collect_env():
  6. """Collect the information of the running environments."""
  7. env_info = collect_base_env()
  8. env_info['MMDetection'] = mmdet.__version__ + '+' + get_git_hash()[:7]
  9. return env_info
  10. if __name__ == '__main__':
  11. for name, val in collect_env().items():
  12. print(f'{name}: {val}')