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