BSc project of Parham Saremi. The goal of the project was to detect the geographical region of the food using textual and visual features extracted from recipes and ingredients of the food.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

io.py 369B

123456789101112
  1. import yaml
  2. from easydict import EasyDict as edict
  3. import json
  4. def load_config(path):
  5. with open(path, 'r', encoding='utf8') as f:
  6. return edict(yaml.safe_load(f))
  7. def save_config(config, path):
  8. x = json.loads(json.dumps(config))
  9. with open(path, 'w', encoding='utf8') as f:
  10. yaml.dump(x, f, default_flow_style=False, allow_unicode=True)