(name, root=None, check=False)
| 46 | |
| 47 | |
| 48 | def get_ckpt_path(name, root=None, check=False): |
| 49 | assert name in URL_MAP |
| 50 | if root is None: |
| 51 | root = get_cache_dir() |
| 52 | path = os.path.join(root, CKPT_MAP[name]) |
| 53 | if not os.path.exists(path) or (check and not md5_hash(path) == MD5_MAP[name]): |
| 54 | print(f"Downloading {name} model from {URL_MAP[name]} to {path}") |
| 55 | download(URL_MAP[name], path) |
| 56 | md5 = md5_hash(path) |
| 57 | assert md5 == MD5_MAP[name], md5 |
| 58 | return path |
| 59 | |
| 60 | |
| 61 | class LPIPS(nn.Module): |
no test coverage detected