(image)
| 42 | return cur_device |
| 43 | |
| 44 | def tensor2pil(image): |
| 45 | return Image.fromarray(np.clip(255. * image.cpu().numpy().squeeze(), 0, 255).astype(np.uint8)) |
| 46 | def pil2tensor(image): |
| 47 | return torch.from_numpy(np.array(image).astype(np.float32) / 255.0).unsqueeze(0) |
| 48 | def rgb_crop(rgb, region): |
nothing calls this directly
no outgoing calls
no test coverage detected