martianxiu / MSECNet

This is the official implementation of our paper MSECNet: Accurate and Robust Normal Estimation for 3D Point Clouds by Multi-Scale Edge Conditioning (ACMMM2023)
Other
23 stars 1 forks source link

Pretrained Weights/Training Checkpoint #3

Closed RauchLukas closed 6 days ago

RauchLukas commented 2 weeks ago

Hello.

First, thanks for sharing this repo with the community. Great work!. Second, could I kindly ask you to share the PyTorch model checkpoint from PCPNet training to reproduce the results?

To save time and money and avoid the GPU servers working uselessly I would like to avoid retraining the model from scratch.

Thank you, cheers Lukas

martianxiu commented 1 week ago

Hello,

Thank you for your interest in our work! The pre-trained model is available here: https://github.com/martianxiu/MSECNet?tab=readme-ov-file#log-and-pretrained-models

Please check it out and let me know if you have any problems.

RauchLukas commented 1 week ago

Sorry. I must have completely overlooked the paragraph where the pre-trained model is available for download.

I can run the test sh run_test.sh PCPNet and the Full Shape Prediction completes, but in the following step (Sparse Patch Evaluation) NumPy files are missing in the dataset. Thus, i cannot see the final result RSME numbers:

[2024-10-24 08:28:08,522 INFO test_sparse_full_PCPNet.py line 99 37553] Number of parameters (M): 10.397507
[2024-10-24 08:28:08,522 INFO test_sparse_full_PCPNet.py line 104 37553] => loading checkpoint 'exp/pcpnet/test/model/model_best.pth'
[2024-10-24 08:28:08,823 INFO test_sparse_full_PCPNet.py line 112 37553] => loaded checkpoint 'exp/pcpnet/test/model/model_best.pth' (epoch 144)
[2024-10-24 08:28:08,823 INFO test_sparse_full_PCPNet.py line 160 37553] >>>>>>>>>>>>>>>> Start Full Shape Prediction >>>>>>>>>>>>>>>>
[2024-10-24 08:28:08,826 INFO test_sparse_full_PCPNet.py line 185 37553] 1/108: galera100k, loaded normal.
[2024-10-24 08:28:08,869 INFO test_sparse_full_PCPNet.py line 270 37553] Test: [1/108]-100000 Name: galera100k Batch: 0.044 (0.044) Loss: 0.090
[2024-10-24 08:28:08,869 INFO test_sparse_full_PCPNet.py line 274 37553] Shape galera100k takes 0.000 sec for inference. Batchsize is None. Number of input point is 700
[2024-10-24 08:28:08,879 INFO test_sparse_full_PCPNet.py line 185 37553] 2/108: icosahedron100k, loaded normal.
[2024-10-24 08:28:08,892 INFO test_sparse_full_PCPNet.py line 270 37553] Test: [2/108]-100000 Name: icosahedron100k Batch: 0.014 (0.029) Loss: 0.008
[2024-10-24 08:28:08,892 INFO test_sparse_full_PCPNet.py line 274 37553] Shape icosahedron100k takes 0.000 sec for inference. Batchsize is None. Number of input point is 700
[2024-10-24 08:28:08,908 INFO test_sparse_full_PCPNet.py line 185 37553] 3/108: netsuke100k, loaded normal.
[2024-10-24 08:28:08,919 INFO test_sparse_full_PCPNet.py line 270 37553] Test: [3/108]-100000 Name: netsuke100k Batch: 0.013 (0.023) Loss: 0.075
[2024-10-24 08:28:08,919 INFO test_sparse_full_PCPNet.py line 274 37553] Shape netsuke100k takes 0.000 sec for inference. Batchsize is None. Number of input point is 700
[2024-10-24 08:28:08,930 INFO test_sparse_full_PCPNet.py line 185 37553] 4/108: Cup34100k, loaded normal.
[2024-10-24 08:28:08,945 INFO test_sparse_full_PCPNet.py line 270 37553] Test: [4/108]-100000 Name: Cup34100k Batch: 0.016 (0.021) Loss: 0.022
[2024-10-24 08:28:08,945 INFO test_sparse_full_PCPNet.py line 274 37553] Shape Cup34100k takes 0.000 sec for inference. Batchsize is None. Number of input point is 700
[2024-10-24 08:28:08,959 INFO test_sparse_full_PCPNet.py line 185 37553] 5/108: sphere100k, loaded normal.
[2024-10-24 08:28:08,974 INFO test_sparse_full_PCPNet.py line 270 37553] Test: [5/108]-100000 Name: sphere100k Batch: 0.016 (0.020) Loss: 0.008
[2024-10-24 08:28:08,974 INFO test_sparse_full_PCPNet.py line 274 37553] Shape sphere100k takes 0.000 sec for inference. Batchsize is None. Number of input point is 700

......

[2024-10-24 08:28:11,774 INFO test_sparse_full_PCPNet.py line 270 37553] Test: [101/108]-100000 Name: star_sharp100k_ddist_minmax_layers Batch: 0.015 (0.016) Loss: 0.046
[2024-10-24 08:28:11,774 INFO test_sparse_full_PCPNet.py line 274 37553] Shape star_sharp100k_ddist_minmax_layers takes 0.000 sec for inference. Batchsize is None. Number of input point is 700
[2024-10-24 08:28:11,788 INFO test_sparse_full_PCPNet.py line 185 37553] 102/108: Liberty100k_ddist_minmax_layers, loaded normal.
[2024-10-24 08:28:11,803 INFO test_sparse_full_PCPNet.py line 270 37553] Test: [102/108]-100000 Name: Liberty100k_ddist_minmax_layers Batch: 0.015 (0.016) Loss: 0.084
[2024-10-24 08:28:11,803 INFO test_sparse_full_PCPNet.py line 274 37553] Shape Liberty100k_ddist_minmax_layers takes 0.000 sec for inference. Batchsize is None. Number of input point is 700
[2024-10-24 08:28:11,817 INFO test_sparse_full_PCPNet.py line 185 37553] 103/108: boxunion2100k_ddist_minmax_layers, loaded normal.
[2024-10-24 08:28:11,832 INFO test_sparse_full_PCPNet.py line 270 37553] Test: [103/108]-100000 Name: boxunion2100k_ddist_minmax_layers Batch: 0.015 (0.016) Loss: 0.020
[2024-10-24 08:28:11,832 INFO test_sparse_full_PCPNet.py line 274 37553] Shape boxunion2100k_ddist_minmax_layers takes 0.000 sec for inference. Batchsize is None. Number of input point is 700
[2024-10-24 08:28:11,845 INFO test_sparse_full_PCPNet.py line 185 37553] 104/108: pipe100k_ddist_minmax_layers, loaded normal.
[2024-10-24 08:28:11,859 INFO test_sparse_full_PCPNet.py line 270 37553] Test: [104/108]-100000 Name: pipe100k_ddist_minmax_layers Batch: 0.015 (0.016) Loss: 0.014
[2024-10-24 08:28:11,859 INFO test_sparse_full_PCPNet.py line 274 37553] Shape pipe100k_ddist_minmax_layers takes 0.000 sec for inference. Batchsize is None. Number of input point is 700
[2024-10-24 08:28:11,878 INFO test_sparse_full_PCPNet.py line 185 37553] 105/108: pipe_curve100k_ddist_minmax_layers, loaded normal.
[2024-10-24 08:28:11,894 INFO test_sparse_full_PCPNet.py line 270 37553] Test: [105/108]-100000 Name: pipe_curve100k_ddist_minmax_layers Batch: 0.017 (0.016) Loss: 0.018
[2024-10-24 08:28:11,894 INFO test_sparse_full_PCPNet.py line 274 37553] Shape pipe_curve100k_ddist_minmax_layers takes 0.000 sec for inference. Batchsize is None. Number of input point is 700
[2024-10-24 08:28:11,921 INFO test_sparse_full_PCPNet.py line 185 37553] 106/108: column100k_ddist_minmax_layers, loaded normal.
[2024-10-24 08:28:11,938 INFO test_sparse_full_PCPNet.py line 270 37553] Test: [106/108]-100000 Name: column100k_ddist_minmax_layers Batch: 0.018 (0.016) Loss: 0.114
[2024-10-24 08:28:11,938 INFO test_sparse_full_PCPNet.py line 274 37553] Shape column100k_ddist_minmax_layers takes 0.000 sec for inference. Batchsize is None. Number of input point is 700
[2024-10-24 08:28:11,953 INFO test_sparse_full_PCPNet.py line 185 37553] 107/108: column_head100k_ddist_minmax_layers, loaded normal.
[2024-10-24 08:28:11,969 INFO test_sparse_full_PCPNet.py line 270 37553] Test: [107/108]-100000 Name: column_head100k_ddist_minmax_layers Batch: 0.017 (0.016) Loss: 0.169
[2024-10-24 08:28:11,969 INFO test_sparse_full_PCPNet.py line 274 37553] Shape column_head100k_ddist_minmax_layers takes 0.000 sec for inference. Batchsize is None. Number of input point is 700
[2024-10-24 08:28:11,983 INFO test_sparse_full_PCPNet.py line 185 37553] 108/108: Boxy_smooth100k_ddist_minmax_layers, loaded normal.
[2024-10-24 08:28:11,998 INFO test_sparse_full_PCPNet.py line 270 37553] Test: [108/108]-100000 Name: Boxy_smooth100k_ddist_minmax_layers Batch: 0.015 (0.016) Loss: 0.017
[2024-10-24 08:28:11,998 INFO test_sparse_full_PCPNet.py line 274 37553] Shape Boxy_smooth100k_ddist_minmax_layers takes 0.000 sec for inference. Batchsize is None. Number of input point is 700
[2024-10-24 08:28:12,011 INFO test_sparse_full_PCPNet.py line 281 37553] Takes 0.000 sec for inference (0.000 sec per shape.)
[2024-10-24 08:28:12,850 INFO test_sparse_full_PCPNet.py line 386 37553] >>>>>>>>>>>>>>>> Start Sparse Patch Evaluation >>>>>>>>>>>>>>>>

***************** list/testset_no_noise.txt *****************
Result path: results/test/best/pcpnet
galera100k
Traceback (most recent call last):
  File "/MSECNet/scripts/exp/pcpnet/test/test_sparse_full_PCPNet.py", line 436, in <module>
    main()
  File "/MSECNet/scripts/exp/pcpnet/test/test_sparse_full_PCPNet.py", line 128, in main
    evaluate(args.indir, args.save_folder, args.save_folder) # evaluate sparse patch performance
  File "/MSECNet/scripts/exp/pcpnet/test/test_sparse_full_PCPNet.py", line 416, in evaluate
    points_idx = np.load(os.path.join(normal_gt_path, shape + '.pidx.npy'))      # (n,)
  File "/opt/conda/lib/python3.10/site-packages/numpy/lib/npyio.py", line 427, in load
    fid = stack.enter_context(open(os_fspath(file), "rb"))
FileNotFoundError: [Errno 2] No such file or directory: 'dataset/pclouds/galera100k.pidx.npy'

I downloaded the PCPNet dateset with your download_pclouds.py script. Have there been any changes to the code in the meantime, so that the data set is no longer completely up-to-date?

RauchLukas commented 6 days ago

Never mind, I realized, the .pidx files are just basic text files. So I can create the .pidx.npy files myself.

To everyone else running into this issue. I used the following script for the conversion:

import os
import numpy as np
import argparse

def convert_pidx_to_npy(directory):
    """
    Convert all .pidx files in the given directory to .npy format.

    Parameters:
    - directory (str): Path to the directory containing .pidx files.
    """
    # Check if the provided path is a valid directory
    if not os.path.isdir(directory):
        print(f"Error: {directory} is not a valid directory.")
        return

    # Iterate through all files in the directory
    for filename in os.listdir(directory):
        # Check if the file has a .pidx extension
        if filename.endswith('.pidx'):
            pidx_path = os.path.join(directory, filename)
            npy_path = os.path.join(directory, filename + '.npy')

            try:
                data = np.loadtxt(pidx_path, dtype=np.int32)

                # Save the loaded data to a .npy file
                np.save(npy_path, data)
                print(f"Converted {pidx_path} to {npy_path}")
            except Exception as e:
                print(f"Failed to convert {pidx_path}: {str(e)}")

if __name__ == "__main__":
    # Setup argument parser to accept the directory path from the console
    parser = argparse.ArgumentParser(description="Convert .pidx files to .npy format")
    parser.add_argument("directory", type=str, help="Path to the directory containing .pidx files")

    # Parse the arguments
    args = parser.parse_args()

    # Call the conversion function with the provided directory
    convert_pidx_to_npy(args.directory)