(self,image_path)
| 1043 | if not os.path.exists(self.model_config_path): |
| 1044 | wget.download(config_url,out=self.model_config_path) |
| 1045 | def load_image(self,image_path): |
| 1046 | # load image |
| 1047 | image_pil = Image.open(image_path).convert("RGB") # load image |
| 1048 | |
| 1049 | transform = T.Compose( |
| 1050 | [ |
| 1051 | T.RandomResize([512], max_size=1333), |
| 1052 | T.ToTensor(), |
| 1053 | T.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]), |
| 1054 | ] |
| 1055 | ) |
| 1056 | image, _ = transform(image_pil, None) # 3, h, w |
| 1057 | return image_pil, image |
| 1058 | |
| 1059 | def load_model(self): |
| 1060 | args = SLConfig.fromfile(self.model_config_path) |
no outgoing calls
no test coverage detected