(self, pil_img)
| 23 | self.dtype = dtype |
| 24 | |
| 25 | def __call__(self, pil_img): |
| 26 | np_img = np.array(pil_img, dtype=np.uint8) |
| 27 | if np_img.ndim < 3: |
| 28 | np_img = np.expand_dims(np_img, axis=-1) |
| 29 | np_img = np.rollaxis(np_img, 2) # HWC to CHW |
| 30 | return torch.from_numpy(np_img).to(dtype=self.dtype) |
| 31 | |
| 32 | |
| 33 | _pil_interpolation_to_str = { |
nothing calls this directly
no outgoing calls
no test coverage detected