Giter Site home page Giter Site logo

giantchen2012 / pointsetgeneration Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fanhqme/pointsetgeneration

0.0 1.0 0.0 125.61 MB

Code for ``A Point Set Generation Network for 3D Object Reconstruction from a Single Image''

Python 64.31% C++ 25.76% Cuda 8.16% Makefile 1.77%

pointsetgeneration's Introduction

Using the code

Training scripts and a couple of trained demo networks are included. More demos and the complete set of data are on the road.

KMZ file of the ShapeNet shapes used in this experiment are released! See the end of this page The full training batches used in this experiment are released! See the end of this page

Make sure you have python-numpy, python-opencv, tensorflow, tflearn, CUDA, etc. Some paths are configured in makefile. Overwrite them properly.

Running the demo

If you just want to try the demo, cd into the demo directory, and run

$ python runsingleimage.py 1.png 1_m.png twobranch_v1.pkl
$ python view.py 1.png.txt

The .pkl files can be found in the google drive:

The first script runs the code on the image 1.png with segmentation mask 1_m.png using neural network weights twobranch_v1.pkl. Another set of weights twobranch_v2.pkl seems more robust. The input images must be of size 256x192. The second script visualizes the predicted point cloud. Move your mouse over the window to rotate the point cloud.

If you want to try the networks on your own captured image, see ImageCaptureGuide.pdf first.

We have also included a trained network corresponding to the R2N2 paper's setting. you can download runr2n2_128_v1.pkl from https://drive.google.com/file/d/0B0gQFbJEIJ4kQVdpeVBNb2RJTlk/view?usp=sharing and run

$ python runr2n2_128.py r1.png runr2n2_128_v1.pkl
$ python view.py r1.png.txt

Training

If you are interested in training a network, here are the instructions.

Compiling CUDA code

$ make

Usage of training script:

  • Predict on validation set
$ python train_nn.py [data=<path>] [dump=<path>] [num=<number>] predict
example: $ python train_nn.py data=data dump=dump num=3 predict
  • Visualualize dumpped prediction (press space to view the next one)
$ python python visualizeptexample.v.py <path>/train_nn.v.pkl
example: $ python visualizeptexample.v.py dump/train_nn.v.pkl
  • Train
$ python train_nn.py [data=<path>] [dump=<path>] train
example: $ python train_nn.py data=data dump=dump train

Format of training data

A few minibatches of processed training data is in the data/ folder.

.bin.gz files here are not gzipped file (sorry).

python traindataviewer.py data/0/0.gz

This shows a batch of training data. The loadBinFile function returns a tuple containing the color image, depth image, ground truth point cloud and model key names.

Below is the complete set of training data. Download them all into the data/ folder. https://www.dropbox.com/sh/68kfpqut2y75etz/AABtIn2LUMALTnULSTUr5ZlUa?dl=0

Below is more data that might be useful. Notice: you must use https.

https://shapenet.cs.stanford.edu/media/sampledata_220k.tar

pointsetgeneration's People

Contributors

fanhqme avatar suhaochina avatar

Watchers

 avatar

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.