build model
(model_type, ckpt)
| 37 | |
| 38 | |
| 39 | def 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 | |
| 52 | def plot_results(outputs, image_ori, save_path='../vis/'): |
nothing calls this directly
no test coverage detected