ErlerPhilipp / points2surf

Learning Implicit Surfaces from Point Clouds (ECCV 2020)
https://www.cg.tuwien.ac.at/research/publications/2020/erler-2020-p2s/
MIT License
443 stars 46 forks source link

Empty folder 04_pts_vis #25

Closed MinchoU closed 1 year ago

MinchoU commented 1 year ago

Thanks for the great code!(Still learning how it works xD) I just want to test your model on my pointcloud(.npy file) so I ran

python make_pc_dataset.py

with including my npy file in 04_pts and adding the name on testset.txt. Then the folder "04_pts" was created but it was empty.

Am I doing right? Thanks!

ErlerPhilipp commented 1 year ago

Hi @MinchoU,

please see the section "Dataset from Point Clouds for Reconstruction" in the readme: https://github.com/ErlerPhilipp/points2surf#dataset-from-point-clouds-for-reconstruction

To use this script, you're supposed to place you point clouds in 00_base_pc. However, that's only meant for point clouds stored in mesh-file types, e.g. PLY, OBJ, STL anything that Trimesh can load. Since you already have your point clouds as NPY files, that's unnecessary effort.

The easiest solution would be to hijack the included abc_minimal dataset. Simply put your point clouds into 04_pts and modify the testset.txt. You will also need some minor changes in the dataloader to skip the usual point cloud files and use the NPY files directly. In source/data_loader.py modify these spots to load your NPY files directly:

Be aware that P2S performs poorly on large point clouds (maybe sub-sample to ~50k points), some partial scans and scans from non-solids (e.g. landscapes).

I'm happy to accept a pull request (to an extra branch). Let me know if you need more help.

MinchoU commented 1 year ago

Thanks for your help. But I'm still struggling with the command python make_pc_dataset.py

I've understood that this command converts point clouds to meshes that are in 04_pts and listed in testset.txt. And I have tested this command on abc_minimal without including my point clouds(haven't modified anything) but still nothing was created in folder 04_pts_vis.

Am I missing something?

ErlerPhilipp commented 1 year ago

I've understood that this command converts point clouds to meshes that are in 04_pts and listed in testset.txt. And I have tested this command on abc_minimal without including my point clouds(haven't modified anything) but still nothing was created in folder 04_pts_vis.

Your point clouds go into 00_base_pc as mesh files with only vertices. This processing step (normalization and subsampling) turns them into Numpy files, which will appear in 04_pts. So you would need to convert your NPY files to e.g. PLY. The 04_pts_vis are optional side-products of this processing step.

So the structure is like this:

    00_base_pc
         |
    processing
         |
        /\
04_pts  (04_pts_vis)

There is file_utils.call_necessary() before every call that checks if the outputs are up-to-date. Assuming the files come with correct timestamps from the repo, it will see that the files in 04_pts are fine and do nothing.