(img)
| 273 | |
| 274 | # convert uint to 4-dimensional torch tensor |
| 275 | def uint2tensor4(img): |
| 276 | if img.ndim == 2: |
| 277 | img = np.expand_dims(img, axis=2) |
| 278 | return torch.from_numpy(np.ascontiguousarray(img)).permute(2, 0, 1).float().div(255.).unsqueeze(0) |
| 279 | |
| 280 | |
| 281 | # convert uint to 3-dimensional torch tensor |
nothing calls this directly
no outgoing calls
no test coverage detected