Home

Awesome

Volumetric Nearest Neighbor Upsampling in Torch

This repository contains a Torch module for volumetric nearest neighbor upsampling based on kmul00/torch-vol. In the original repository, the nearest neighbor upsampling did not allow distinct scaling factors for all three dimensions of the processed volumes; the module in this repository changes that.

If you use this tool, please consider citing the following thesis:

@inproceedings{Stutz2018CVPR,
  title = {Learning 3D Shape Completion from Laser Scan Data with Weak Supervision},
  author = {David Stutz and Andreas Geiger},
  booktitle = {IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
  publisher = {IEEE Computer Society},
  year = {2018}
}

Also check the corresponding project page.

Installation

Installation instructions roughly follow the instructions given in kmul00/torch-vol:

Usage

Usage is very simple and illustrated in test.lua:

local model = nn.Sequential()
model:add(nn.VolumetricUpSamplingNearest(2, 3, 4))
model:add(nn.VolumetricUpSamplingNearest(2, 3, 4))

local input = torch.Tensor(8, 2, 10, 10, 10):fill(1)
local goutput = torch.Tensor(8, 2, 40, 90, 160):fill(1)

local output = model:forward(input)
print(#output)
local ginput = model:backward(input, goutput)
print(#ginput)

Here, VolumetricUpSamplingNearest expects three arguments, the upsampling factors in the first, second and third dimensions.

License

Original license:

Copyright (c) [2015] [Koustav Mullick]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Changes:

Copyright (c) 2017 David Stutz

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.