ranahanocka / MeshCNN

Convolutional Neural Network for 3D meshes in PyTorch
MIT License
1.56k stars 314 forks source link

Using edge midpoints as input features #62

Open LiZimo opened 4 years ago

LiZimo commented 4 years ago

Hi, not quite an issue, but thought appropriate to write here.

You mention in your paper that you ran some experiments using edge midpoints as input features. Is the option to do this implemented somewhere in the code? If so, how to turn it on. Thanks!

ranahanocka commented 4 years ago

Hi @LiZimo ,

We did not include it (tried to keep the code as simple as possible), but you can easily add it to the code. Here is the function that did it :

    def mid_point(mesh, features):
        for edge_id, edge in enumerate(mesh.edges):
            features[edge_id].extend(list(mesh.vs[edge[0]] + mesh.vs[edge[1]] / 2))

You can add that to mesh_prepare.py

Then also, you should add "mid_point" to the list of feature extractors in this line: https://github.com/ranahanocka/MeshCNN/blob/5af7b9c39d3e871b052f9c4c4315fb03f5f92992/models/layers/mesh_prepare.py#L316

I think that should be it.