Input: image: HxWx3 numpy flow: HxWx2 torch.Tensor Output: outImg: HxWx3 numpy
(image, flow, padding_mode='zeros')
| 364 | return outImg.astype(np.uint8) |
| 365 | |
| 366 | def image_forward_warp(image, flow, padding_mode='zeros'): |
| 367 | ''' |
| 368 | Input: |
| 369 | image: HxWx3 numpy |
| 370 | flow: HxWx2 torch.Tensor |
| 371 | Output: |
| 372 | outImg: HxWx3 numpy |
| 373 | ''' |
| 374 | forward_warp = ForwardWarp() |
| 375 | image = torch.from_numpy(image).permute([2,0,1])[None].cuda() |
| 376 | flow = torch.from_numpy(flow).permute([2,0,1])[None].cuda() |
| 377 | out = forward_warp(image, flow) |
| 378 | image = (out[0][0] / (out[1][0] + 1e-6)).cpu().permute([1,2,0]).numpy().astype(np.uint8) |
| 379 | |
| 380 | return image |
nothing calls this directly
no test coverage detected