MCPcopy Create free account
hub / github.com/Kitware/COAT / write_json

Function write_json

utils/utils.py:364–371  ·  view source on GitHub ↗
(obj, fpath)

Source from the content-addressed store, hash-verified

362
363
364def write_json(obj, fpath):
365 mkdir(osp.dirname(fpath))
366 _obj = obj.copy()
367 for k, v in _obj.items():
368 if isinstance(v, np.ndarray):
369 _obj.pop(k)
370 with open(fpath, "w") as f:
371 json.dump(_obj, f, indent=4, separators=(",", ": "))
372
373
374def symlink(src, dst, overwrite=True, **kwargs):

Callers 1

eval_search_cuhkFunction · 0.90

Calls 1

mkdirFunction · 0.85

Tested by

no test coverage detected