(image_tensor, imtype=np.uint8)
| 341 | |
| 342 | |
| 343 | def tensor2im(image_tensor, imtype=np.uint8): |
| 344 | image_numpy = image_tensor.cpu().float().numpy() |
| 345 | if image_numpy.shape[0] == 1: |
| 346 | image_numpy = np.tile(image_numpy, (3, 1, 1)) |
| 347 | image_numpy = (np.transpose(image_numpy, (1, 2, 0)) + 1) / 2.0 * 255.0 |
| 348 | return image_numpy.astype(imtype) |
| 349 | |
| 350 | |
| 351 | def save_image(image_numpy, image_path): |
nothing calls this directly
no outgoing calls
no test coverage detected