Giter VIP home page Giter VIP logo

bps-torch's Introduction

bps_torch

A Pytorch implementation of the bps representation using chamfer distance on GPU. This implementation is very fast and was used for the GrabNet model.

Basis Point Set (BPS) is a simple and efficient method for encoding 3D point clouds into fixed-length representations. For the original implementation please visit this implementation by Sergey Prokudin.

Requirements

Installation

If PyTorch is not installed run the following line:

 pip install torch==1.5.1+cpu torchvision==0.6.1+cpu -f https://download.pytorch.org/whl/torch_stable.html

To install the chamfer_distance package run:

pip install git+https://github.com/otaheri/chamfer_distance

Finally install the package using the command below:

pip install git+https://github.com/otaheri/bps_torch

In case of pytorch3d issue. Follow installation here: https://github.com/facebookresearch/pytorch3d/blob/main/INSTALL.md

Demos

Below is an example of how to use the bps_torch code.

import torch
import time
from bps_torch.bps import bps_torch

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

# initiate the bps module
bps = bps_torch(bps_type='random_uniform',
                n_bps_points=1024,
                radius=1.,
                n_dims=3,
                custom_basis=None)

pointcloud = torch.rand([1000000,3]).to(device)

s = time.time()

bps_enc = bps.encode(pointcloud,
                     feature_type=['dists','deltas'],
                     x_features=None,
                     custom_basis=None)

print(time.time() - s)

deltas = bps_enc['deltas']
bps_dec = bps.decode(deltas)

Citation

If you use this code in your research, please consider citing:

@inproceedings{prokudin2019efficient,
  title={Efficient Learning on Point Clouds With Basis Point Sets},
  author={Prokudin, Sergey and Lassner, Christoph and Romero, Javier},
  booktitle={Proceedings of the IEEE International Conference on Computer Vision},
  pages={4332--4341},
  year={2019}
}

License

This library is licensed under the MIT-0 License of the original implementation. See the LICENSE file.

Contact

The code of this repository was implemented by Omid Taheri.

For questions, please contact [email protected].

bps-torch's People

Contributors

otaheri avatar qqianfeng avatar

Stargazers

 avatar

Watchers

 avatar Kostas Georgiou avatar

Forkers

davidmartinez13

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.