(img)
| 305 | |
| 306 | # convert single (HxWxC) to 4-dimensional torch tensor |
| 307 | def single2tensor4(img): |
| 308 | return torch.from_numpy(np.ascontiguousarray(img)).permute(2, 0, 1).float().unsqueeze(0) |
| 309 | |
| 310 | |
| 311 | # convert torch tensor to single |
nothing calls this directly
no outgoing calls
no test coverage detected