(rgb, region)
| 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): |
| 49 | return rgb[region[1]:region[3], region[0]:region[2]] |
| 50 | |
| 51 | def rgb_crop_batch(rgbs, region): |
| 52 | return rgbs[:, region[1]:region[3], region[0]:region[2]] |
no outgoing calls
no test coverage detected