(self, img_path)
| 116 | return images_copied |
| 117 | |
| 118 | def test(self, img_path): |
| 119 | # img load |
| 120 | img_data = Image.open(img_path).convert('RGB') |
| 121 | |
| 122 | # transform |
| 123 | all_data = [] |
| 124 | for transform in self.transformer_: |
| 125 | current_data = transform(img_data) |
| 126 | current_data = self.add_new_channels(current_data) |
| 127 | all_data.append(current_data) |
| 128 | img_tensor = torch.stack(all_data, dim=0).unsqueeze(0).cuda() |
| 129 | |
| 130 | preds = self.model(img_tensor) |
| 131 | |
| 132 | return round(float(preds), 20) |
| 133 | |
| 134 | |
| 135 | def main(): |
no test coverage detected