MCPcopy Create free account
hub / github.com/UX-Decoder/Semantic-SAM / build_semantic_sam

Function build_semantic_sam

semantic_sam/build_semantic_sam.py:39–49  ·  view source on GitHub ↗

build model

(model_type, ckpt)

Source from the content-addressed store, hash-verified

37
38
39def build_semantic_sam(model_type, ckpt):
40 """
41 build model
42 """
43 cfgs={'T':"configs/semantic_sam_only_sa-1b_swinT.yaml",
44 'L':"configs/semantic_sam_only_sa-1b_swinL.yaml"}
45
46 sam_cfg=cfgs[model_type]
47 opt = load_opt_from_config_file(sam_cfg)
48 model_semantic_sam = BaseModel(opt, build_model(opt)).from_pretrained(ckpt).eval().cuda()
49 return model_semantic_sam
50
51
52def plot_results(outputs, image_ori, save_path='../vis/'):

Callers

nothing calls this directly

Calls 4

BaseModelClass · 0.90
build_modelFunction · 0.90
from_pretrainedMethod · 0.80

Tested by

no test coverage detected