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

How to invoke the pretrained model? #24

Closed qilin2008201 closed 1 year ago

qilin2008201 commented 1 year ago

Thanks for the detailed code. Hi, I'm a novice in this field. The problem I'm facing now is how to call the pre-trained models (e.g. vanilla, ablation, max) to reconstruct our own point cloud data. I only use the command line in README.md to downloa them, but I don't know how to call them. I currently use full_ run.py to reconstruct our own point cloud data, but it is not effective.

ErlerPhilipp commented 1 year ago

To be sure I understand you correctly... You downloaded the models via the script? Now you want to reconstruct your own point clouds?

If you run into an error with the models, please try the max version. More details here: https://github.com/ErlerPhilipp/points2surf/issues/22

In which format are your point clouds? If they are already Numpy files, They must contain arrays of shape [n, 3]. See this section of the readme for more details: https://github.com/ErlerPhilipp/points2surf#manually-created-dataset-for-reconstruction If your point clouds are something like text files or vertices in mesh files (e.g. .obj, .stl, .ply), you can try this section of the readme: https://github.com/ErlerPhilipp/points2surf#dataset-from-point-clouds-for-reconstruction For large point clouds (e.g. in .las format), you will need your own converter (e.g. cloud compare) and probably subsampling for a reasonable running time.

Let me know if you need more help.

qilin2008201 commented 1 year ago

Thanks for your answer, now I am facing a new problem when I running full_eval.py:

 Traceback (most recent call last):
  File "/home/dlmult/points2surf/full_eval.py", line 81, in <module>
    full_eval(opt=points_to_surf_eval.parse_arguments())
  File "/home/dlmult/points2surf/full_eval.py", line 46, in full_eval
    points_to_surf_eval.points_to_surf_eval(opt)
  File "/home/dlmult/points2surf/source/points_to_surf_eval.py", line 332, in points_to_surf_eval
    dataset = make_dataset(train_opt=train_opt, eval_opt=eval_opt)
  File "/home/dlmult/points2surf/source/points_to_surf_eval.py", line 107, in make_dataset
    dataset = data_loader.PointcloudPatchDataset(
  File "/home/dlmult/points2surf/source/data_loader.py", line 304, in __init__
    sdf.get_voxel_centers_grid_smaller_pc(
  File "/home/dlmult/points2surf/source/sdf.py", line 57, in get_voxel_centers_grid_smaller_pc
    pts_vs = model_space_to_volume_space(pts, grid_resolution)
  File "/home/dlmult/points2surf/source/sdf.py", line 75, in model_space_to_volume_space
    return np.floor(pts_pos_octant * vol_res).astype(np.int)
TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'

I only revise the model name in points_to_surf_eval.py and use the original data.

ErlerPhilipp commented 1 year ago

points_to_surf_eval.py is not meant to be called directly. There are some default values for parameters (argparse) that don't make sense. In this case, query_grid_resolution = None caused the error.

3 possible solutions:

  1. Cleanest solution: You can call experiments/eval_p2s_max.sh or similar with your updated settings.
  2. Take the parameters on of these shell scripts and set them as default values in points_to_surf_eval.py -> parse_arguments.
  3. Call full_run.py with updated parameters in train_params, eval_params and recon_params.

The parameters must match EXACTLY to the parameters of the model. Meaning, if you use the Max model, you need to use the settings from the corresponding train/eval shell scripts. This is absolutely necessary for everything related to NN layers, e.g. points_per_patch, shared_transformer, use_point_stn, net_size etc.

ErlerPhilipp commented 1 year ago

closing because of inactivity, feel free to re-open