Convert image array to tensor.
(image: np.ndarray)
| 51 | |
| 52 | |
| 53 | def array2tensor(image: np.ndarray) -> torch.Tensor: |
| 54 | """Convert image array to tensor.""" |
| 55 | image = torch.Tensor(image) |
| 56 | image = normalize(image, |
| 57 | origin_value_range=(0, 255), |
| 58 | out_value_range=(0, 1), |
| 59 | dtype=torch.float32) |
| 60 | return image |
| 61 | |
| 62 | |
| 63 | def rgb2bgr(rgbs) -> Union[torch.Tensor, np.ndarray]: |
no test coverage detected