Code Monkey home page Code Monkey logo

ptnbhwd's Introduction

Perspective Transformer Layer

This is the torch implementation of the Perspective Transformer Layer, which is built on top of the STN torch implementation.

Build

To build the ptn libriary, run the following script.

luarocks make ptnbhwd-scm-1.rockspec

Usage

require 'ptn'

nn.PerspectiveGridGenerator(depth, height, width, focal_length)
-- takes B x 4 x 4 affine transform matrices as input, 
-- outputs a depth x height x width grid in normalized [dmin,dmax] x [-1,1] x [-1,1] coordinates, where dmin and dmax represent the minimal and maximal disparity.

nn.BilinearSamplerPerspective()
-- takes a table {inputImages, grids} as inputs
-- outputs the interpolated images according to the grids
-- inputImages is a batch of samples in BHWD layout
-- grids is a batch of grids (output of PerspectiveGridGenerator)
-- output is also BHWD

Citation

If you find this useful, please cite our work as follows:

@incollection{NIPS2016_6206,
title = {Perspective Transformer Nets: Learning Single-View 3D Object Reconstruction without 3D Supervision},
author = {Yan, Xinchen and Yang, Jimei and Yumer, Ersin and Guo, Yijie and Lee, Honglak},
booktitle = {Advances in Neural Information Processing Systems 29},
editor = {D. D. Lee and M. Sugiyama and U. V. Luxburg and I. Guyon and R. Garnett},
pages = {1696--1704},
year = {2016},
publisher = {Curran Associates, Inc.},
url = {http://papers.nips.cc/paper/6206-perspective-transformer-nets-learning-single-view-3d-object-reconstruction-without-3d-supervision.pdf}
}

ptnbhwd's People

Contributors

xcyan avatar

Stargazers

caiyongqi avatar Ko Dae Won avatar qihao._.huang avatar  avatar Gu Wang avatar Ruben Villegas avatar Guandao Yang avatar SiyuanHuang avatar Shunsuke Saito avatar  avatar Daeyun Shin avatar  avatar Emanuel Vecchio avatar Guanying Chen avatar Riddhiman Dasgupta avatar Rana Hanocka avatar Zhenhua Wang avatar Bo Zhao avatar

Watchers

Ersin Yumer avatar Lajanugen Logeswaran avatar Jimei Yang avatar  avatar  avatar

ptnbhwd's Issues

What is "disf" in "PerspectiveGridGenerator.lua"

Hi, I'm trying to replicate your projection work with PyTorch. But I'm confused about the definition of "focal length" and "disf" in your code. That is:


focal_length = math.sqrt(3)/2 ?
dmin = 1/(focal_length + math.sqrt(3))
dmax = 1/(focal_length)
for k=1,depth do
disf = dmin + (k-1)/(depth-1) * (dmax-dmin)
baseGrid[k][i][j][1] = 1/disf


Please forgive my offense, I have followed your advice and read the appropriate books. I still don't understand how focal length is defined. And in the paper your point that "the minimum and maximum disparity in the camera frame are denoted as dmin and dmax", So who is a disparty, disf or 1/disf? Your help means a lot to me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.