Open h00shi opened 5 years ago
Hi, great question - thanks :)
So ModelNet40 / ShapeNet is not manifold. Meshes that are not manifold do not have at most 2 incident faces - which breaks our fixed-size convolution neighborhood assumption (illustration)
I did start playing with this code which makes meshes manifold, and noticed it works pretty well. I will try to find some time soon to write some scripts to clean it up and add it to the repo. Will update this issue accordingly
It might be worth using something like pymesh
or trimesh
to load and save meshes (nice built-in functionality to detect/fix non-manifold meshes).
This would also make importing datasets of different formats easier as well, as loading a mesh would be something like mesh=module.load('file.ext')
and accessing edges, faces, and vertices is simply mesh.edges
, mesh.faces
, and mesh.vertices
.
The function fill_from_file()
in mesh_prepare.py
could be something really simple like:
import trimesh #pip3 install trimesh
mesh=trimesh.load(fpath) #loads ascii and binary stls, objs, etc...
mesh.rezero() #move to [0,0,0]
if not mesh.is_watertight or not mesh.is_volume:
raise Exception('"%s" is not manifold'%fpath)
return mesh.vertices,mesh.faces
The above code is completely untested...
@mrmoss I think the neural network would need a mesh with a single (or only a few) components. What pymesh and trimesh do for making the mesh manifold is breaking it into multiple components. So, they might not work that easily (I am not sure).
I was thinking more detection and warning/erroring rather than repairing.
As far as I can gather from both mentioned modules, other than face normals, files are parsed without any attempt to repair or fix them.
For repairing, trimesh's fill_holes() might be worth a try?
Edit: Edited for overall clarity and length.
It might be worth using something like
pymesh
ortrimesh
to load and save meshes (nice built-in functionality to detect/fix non-manifold meshes).
I tried these non-manifold fixes, and they do not work for shapenet.
This would also make importing datasets of different formats easier as well, as loading a mesh would be something like
mesh=module.load('file.ext')
and accessing edges, faces, and vertices is simplymesh.edges
,mesh.faces
, andmesh.vertices
. The functionfill_from_file()
inmesh_prepare.py
could be something really simple like:I do hear what you are saying, but I prefer to keep the code independent of external packages, and just have people convert to .obj format. This can be done pretty easily with Meshlab scripts. And maybe it's just me, but I think when things are written explicitly, it helps make it really clear how simple meshes really are :)
These guys seem to have processed all the ShapeNet. Github page repaired shapenet
Has anyone by now tried the network on the ModelNet50/ModelNet10 (classification) dataset?
There is a dataset Manifold40, all shapes are manifold.
This is more a question rather than an issue, so apologies if it is not the right place to ask it.
Have you also tried the network on the de facto ModelNet50 (classification) and ShapeNet Core (segmentation) datasets?