MCPcopy Create free account
hub / github.com/FreedomGu/Diffportrait360 / load_state_dict

Function load_state_dict

diffportrait360_release/code/inference.py:18–23  ·  view source on GitHub ↗
(model, ckpt_path, strict=True, map_location="cpu")

Source from the content-addressed store, hash-verified

16from torchvision.utils import save_image
17
18def load_state_dict(model, ckpt_path, strict=True, map_location="cpu"):
19 print(f"Loading model state dict from {ckpt_path} ...")
20 state_dict = load_from_pretrain(ckpt_path, map_location=map_location)
21 state_dict = state_dict.get('state_dict', state_dict)
22 model.load_state_dict(state_dict, strict=strict)
23 del state_dict
24def get_cond_control(args, batch_data, control_type, device, model=None,batch_size=None, train=True, seg_model=None):
25 # Single-control
26 control_type = copy.deepcopy(control_type)[0]

Callers 1

mainFunction · 0.70

Calls 1

load_from_pretrainFunction · 0.90

Tested by

no test coverage detected