Writes to a json file.
(obj, fpath)
| 20 | |
| 21 | |
| 22 | def write_json(obj, fpath): |
| 23 | """Writes to a json file.""" |
| 24 | if not osp.exists(osp.dirname(fpath)): |
| 25 | os.makedirs(osp.dirname(fpath)) |
| 26 | with open(fpath, 'w') as f: |
| 27 | json.dump(obj, f, indent=4, separators=(',', ': ')) |
| 28 | |
| 29 | |
| 30 | def read_image(path): |
no outgoing calls
no test coverage detected