MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / get_ckpt_path

Function get_ckpt_path

sat/sgm/modules/autoencoding/lpips/util.py:34–42  ·  view source on GitHub ↗
(name, root, check=False)

Source from the content-addressed store, hash-verified

32
33
34def get_ckpt_path(name, root, check=False):
35 assert name in URL_MAP
36 path = os.path.join(root, CKPT_MAP[name])
37 if not os.path.exists(path) or (check and not md5_hash(path) == MD5_MAP[name]):
38 print("Downloading {} model from {} to {}".format(name, URL_MAP[name], path))
39 download(URL_MAP[name], path)
40 md5 = md5_hash(path)
41 assert md5 == MD5_MAP[name], md5
42 return path
43
44
45class ActNorm(nn.Module):

Callers 2

load_from_pretrainedMethod · 0.85
from_pretrainedMethod · 0.85

Calls 4

md5_hashFunction · 0.85
downloadFunction · 0.85
existsMethod · 0.80
printFunction · 0.50

Tested by

no test coverage detected