Convert a torch image to a PIL image.
(images)
| 25 | |
| 26 | |
| 27 | def pt_to_pil(images): |
| 28 | """ |
| 29 | Convert a torch image to a PIL image. |
| 30 | """ |
| 31 | images = (images / 2 + 0.5).clamp(0, 1) |
| 32 | images = images.cpu().permute(0, 2, 3, 1).float().numpy() |
| 33 | images = numpy_to_pil(images) |
| 34 | return images |
| 35 | |
| 36 | |
| 37 | def numpy_to_pil(images): |
nothing calls this directly
no test coverage detected