(self, args, device)
| 82 | class 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 |
nothing calls this directly
no test coverage detected