lhao0301 / pytorch-liteflownet3 Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
Thank you for your reimplementation of LiteFlowNet3 using PyTorch, it is very useful to me. However, I don’t know how to warp the image using the output optical flow file (.flo).
I use the next flow_warp function, but it does not work.
def flow_warp(x, flow, padding_mode='zeros'):
"""Warp an image or feature map with optical flow
Args:
x (Tensor): size (n, c, h, w)
flow (Tensor): size (n, 2, h, w), values range from -1 to 1 (relevant to image width or height)
padding_mode (str): 'zeros' or 'border'
Returns:
Tensor: warped image or feature map
"""
assert x.size()[-2:] == flow.size()[-2:]
n, _, h, w = x.size()
x_ = torch.arange(w).view(1, -1).expand(h, -1)
y_ = torch.arange(h).view(-1, 1).expand(-1, w)
grid = torch.stack([x_, y_], dim=0).float().cuda()
grid = grid.unsqueeze(0).expand(n, -1, -1, -1)
grid[:, 0, :, :] = 2 * grid[:, 0, :, :] / (w - 1) - 1
grid[:, 1, :, :] = 2 * grid[:, 1, :, :] / (h - 1) - 1
grid += flow
grid = grid.permute(0, 2, 3, 1)
return torch.nn.functional.grid_sample(x, grid)
Thank you very much for the re-implementation.
I wonder if it is possible to provide also the pre-trained model which trained on Chairs only or on Chairs then Things3D ?
Thank you again.
anaconda3/lib/python3.6/site-packages/torch/include/ATen/cuda/CUDAContext.h:5:30: fatal error: cuda_runtime_api.h: No such file or directory
compilation terminated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.