(self, image)
| 22 | return RIFESmoother(model_manager.RIFE, device=model_manager.device, **kwargs) |
| 23 | |
| 24 | def process_image(self, image): |
| 25 | width, height = image.size |
| 26 | if width % 32 != 0 or height % 32 != 0: |
| 27 | width = (width + 31) // 32 |
| 28 | height = (height + 31) // 32 |
| 29 | image = image.resize((width, height)) |
| 30 | image = torch.Tensor(np.array(image, dtype=np.float32)[:, :, [2,1,0]] / 255).permute(2, 0, 1) |
| 31 | return image |
| 32 | |
| 33 | def process_images(self, images): |
| 34 | images = [self.process_image(image) for image in images] |
no outgoing calls
no test coverage detected