Git Product home page Git Product logo

neuralsubdiv's Introduction

Neural Subdivison

Neural subdivision subdivides a triangle mesh using neural networks. This is a prototype implementation in Python 3.7 with PyTorch 1.3.1 and MATLAB. The Python code requires standard dependencies (e.g., numpy), and the MATLAB code depends on gptoolbox.

For a quick demo, please use the pre-trained model and test on new shapes. To test the pre-tranied model please run python test.py /path/to/model/folder/ /path/to/test.obj. For instance, you can run

python test.py ./jobs/net_cartoon_elephant/ ./data_meshes/objs/bunny.obj

If you would like to re-train a model, please first generate a dataset in the form of, for instance, ./data_meshes/cartoon_elephant_200/. This could be done by running the MATLAB script genTrainData_slow.m (a faster C++ version for generating training data can be found here).

Once you have the dataset, please run python gendataPKL.py to preprocess the meshes into a .pkl file, where you need to specify the folder that contains the mesh (please refer to gendataPKL.py for more detail).

The next step is to use python writeHyperparam.py to create a folder that contains the parameters of the model (see writeHyperparam.py for more detail). In our example code, running python writeHyperparam.py will create a folder named ./jobs/net_cartoon_elephant/ which contains the model parameters.

Then you can run python train.py /path/to/model/folder/ to train the model. For instance, with the default folder generated with the above script, you can simply run python train.py ./jobs/net_cartoon_elephant/ to train the model. After training, you can use the quick demo code test.py to test the model by running python test.py /path/to/model/folder/ /path/to/testMesh.obj.

If any questions, please contact Hsueh-Ti Derek Liu ([email protected]).

neuralsubdiv's People

Contributors

htderekliu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neuralsubdiv's Issues

_valid.pkl

How to generate a "_valid.pkl"?
while "gendataPKL.py" can only generate the "
_train.pkl".

Can't subdivide TOSCA shapes

I'm trying to subdivide the TOSCA shapes (Non-rigid world) that were used in the paper for comparing the different methods.

For all shapes, except 3, I either get the error 'mesh has boundary' or 'edge non-manifold' in the SSP_decimation.m script.

How to set nV_variance/nV_average in genTrainData_slow.m

Should I change the parameters nV_variance and nV_average depending on the number of vertices/faces in the input mesh?
I find these two parameters used in SSP_decimation(Vin,Fin,nVc, 'QEM', 0.1,0.4,true), where nVc = nV_average + round(nV_variance * (rand() - 0.5)).

Genreate My Training Data too Slow

hi, I use Matlab code to generate a single mesh data, but I find it takes around 5 minutes. (40k vertexes and 80k faces) So ,is there any faster method to generate the training set?

Jagged saw-like artifacts in the high-res shape when generating training data

Hi, thanks for publishing the source code of your great work. I tried the examples and the result looks amazing.

After that I tried to generate some more training data. I found that when simplifying an initial mesh into an extremely low-res mesh, there will be jagged artifacts in the fine meshes after upsampling.

Take the end of a curved stick as an example. The original mesh has around 2000 vertices and 5000 faces. There are 10 vertices and 16 faces in the coarse mesh. Then upsample the coarse mesh with 3 iterations to get the fine mesh.

  • The original mesh
    snapshot05

  • The coarse mesh after simplification
    snapshot02

  • The fine mesh
    snapshot03

The fine shape looks a little strange at the end and the surface normals are inconsistent. Is it caused by over simplification? Or potential failures with local parameterization?

Here are the obj files. https://drive.google.com/drive/folders/1hiVAv4OVZEkOCHP6iWesrK-eHE0mv8fD?usp=sharing

mesh rendering

what kind of mesh renderer used in your paper? i think they are really beautiful

Issue for mesh data

I am very interested in this work and I want to re-perform some experiments. Have you finished the faster version of genTrainData.m? And is it possible for this program to be preformed with less criteria, such as on non-manifold meshes in Shapenet? Could you please provide those original mesh data that you use to perform the stylized subdivision experiments, shown in appended image?

1642996831(1)

Issue for original mesh data

I am very interested in this work and I want to re-perform some experiments. Could you please provide the original mesh data that you used in your paper? Thanks very much!

Quantitative evaluation

Hi, do you provide any code to evaluate the output mesh quantitively? I can see in your paper that you use two popular metrics, Hausdorff distance H, and mean surface distance M computed via metro [Cignoni et al. 1998] to present the results compared woth loop subdivision and modified butterfly subdivision. How can I find the implementation of these two metrics?

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.