Spaces:
Sleeping
Sleeping
Download tools/general/json_utils.py from kittendev/WSSS_ResNet50: direct link, hf CLI and curl.
- Browser
- Download file 341 Bytes
-
https://huggingface.co/spaces/kittendev/WSSS_ResNet50/resolve/main/tools/general/json_utils.py
- Command line
-
hf download hf://spaces/kittendev/WSSS_ResNet50/tools/general/json_utils.py
-
curl -L -o json_utils.py https://huggingface.co/spaces/kittendev/WSSS_ResNet50/resolve/main/tools/general/json_utils.py
341 Bytes
| # Copyright (C) 2020 * Ltd. All rights reserved. | |
| # author : Sanghyeon Jo <josanghyeokn@gmail.com> | |
| import json | |
| def read_json(filepath): | |
| with open(filepath, 'r') as f: | |
| data = json.load(f) | |
| return data | |
| def write_json(filepath, data): | |
| with open(filepath, 'w') as f: | |
| json.dump(data, f, indent = '\t') | |