(img)
| 318 | |
| 319 | # convert torch tensor to single |
| 320 | def tensor2single3(img): |
| 321 | img = img.data.squeeze().float().cpu().numpy() |
| 322 | if img.ndim == 3: |
| 323 | img = np.transpose(img, (1, 2, 0)) |
| 324 | elif img.ndim == 2: |
| 325 | img = np.expand_dims(img, axis=2) |
| 326 | return img |
| 327 | |
| 328 | |
| 329 | def single2tensor5(img): |
nothing calls this directly
no outgoing calls
no test coverage detected