opencv_webcam/utils/args_yaml.py

16 lines
311 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 脚本参数管理
# 创建人:曾逸夫
# 创建时间2022-01-16
import yaml
import sys
ROOT_PATH = sys.path[0] # 项目根目录
# 脚本参数
def argsYaml(args):
with open(f'{ROOT_PATH}/args.yaml', 'w') as f:
yaml.safe_dump(vars(args), f, sort_keys=False) # 脚本参数yaml保存