Read the .yaml file and generate a dictionary from the content
import yaml
config_file = '/home/TFace-master/TFace-master/recognition/train.yaml'
with open(config_file, 'r') as ifs:
config = yaml.safe_load(ifs)
print(config)
print(config['INPUT_SIZE']) # INPUT_SIZE: [112, 112]
print(config.get('DIST_FC', True)) # DIST_FC: true
The results show that: