(img)
| 353 | |
| 354 | |
| 355 | def normalize2(img): |
| 356 | if img.shape[-1] == 3: |
| 357 | img = rearrange(img, 'h w c -> c h w') |
| 358 | img = torch.tensor(img) |
| 359 | img = img * 2.0 - 1.0 # to -1 ~ 1 |
| 360 | return img |
| 361 | |
| 362 | |
| 363 |
nothing calls this directly
no outgoing calls
no test coverage detected