(img)
| 280 | |
| 281 | # convert uint to 3-dimensional torch tensor |
| 282 | def uint2tensor3(img): |
| 283 | if img.ndim == 2: |
| 284 | img = np.expand_dims(img, axis=2) |
| 285 | return torch.from_numpy(np.ascontiguousarray(img)).permute(2, 0, 1).float().div(255.) |
| 286 | |
| 287 | |
| 288 | # convert 2/3/4-dimensional torch tensor to uint |
nothing calls this directly
no outgoing calls
no test coverage detected