MCPcopy Create free account
hub / github.com/WeChatCV/WeVisionOne / __init__

Method __init__

Inference/text_prompt.py:84–97  ·  view source on GitHub ↗
(self, args, device)

Source from the content-addressed store, hash-verified

82class Inference:
83
84 def __init__(self, args, device):
85 cfg = get_cfg()
86 add_config(cfg)
87 cfg.merge_from_file(args.config_file)
88 cfg.freeze()
89
90 ckpt = torch.load(cfg.MODEL.WEIGHTS, map_location=torch.device('cpu'))
91 self.model = Model(cfg)
92 out = self.model.load_state_dict(ckpt, strict=False)
93 print(out)
94
95 self.model.eval()
96 self.model.to(device)
97 self.device = device
98
99 def predict(self, img_rgb, text_prompts, scoreThres=0.3, iouThres=0.55):
100 img = img_rgb

Callers

nothing calls this directly

Calls 3

add_configFunction · 0.90
ModelClass · 0.85
toMethod · 0.80

Tested by

no test coverage detected