XLechter / SDT

Codes for Point Cloud Completion via Skeleton-Detail Transformer
22 stars 2 forks source link

On the training duration of the model #9

Open huyanbi opened 1 year ago

huyanbi commented 1 year ago

I would like to ask how many Nepochs need to be trained using the 48g dataset of PCN, and how long it will take to train.

XLechter commented 1 year ago

Hi @huyanbi , I apologize for not mentioning the epochs in the paper. I remember I use about 80-100 epochs, which will take about 4-5 days on a single 2080Ti due to the computation of the attention modules.

XLechter commented 1 year ago

Maybe you can also check a recent work SeedFormer ECCV 2022. This work is both effective and efficient.

huyanbi commented 1 year ago

sorry,I found that after the test, it seemed like there was only a CD p,CD t and F1 results do not appear to have visual point cloud results. Due to previous training errors , I commented on the model'sglobal count dirpath = '/mnt/data1/zwx/ICCV_SUB/results_sub' plot_coarse_fine(x.transpose(1, 2).contiguous().cpu().detach().numpy()[0], fine.cpu().detach().numpy()[0]) plt.savefig(dirpath + '/' + str(count) + '.png') count = count+1 What do I need to do to see visual test results?

XLechter commented 1 year ago

sorry,I found that after the test, it seemed like there was only a CD p,CD t and F1 results do not appear to have visual point cloud results. Due to previous training errors , I commented on the model'sglobal count dirpath = '/mnt/data1/zwx/ICCV_SUB/results_sub' plot_coarse_fine(x.transpose(1, 2).contiguous().cpu().detach().numpy()[0], fine.cpu().detach().numpy()[0]) plt.savefig(dirpath + '/' + str(count) + '.png') count = count+1 What do I need to do to see visual test results?

@huyanbi There are several ways for visualization. In the paper, I convert the results to ply files and visualize them using keyshot. You can refer to https://github.com/kangxue/How-do-I-render-point-clouds

Otherwise, you can refer to https://github.com/XLechter/Utils/blob/main/vis_pcd.py, which I used to visualize a set of point clouds quickly.

huyanbi commented 1 year ago

I don't know if I didn't see it. I didn't find the results generated after the test and the ply files you mentioned. The following is the result of my test. I will generate a file after removing the comments image

XLechter commented 1 year ago

I don't know if I didn't see it. I didn't find the results generated after the test and the ply files you mentioned. The following is the result of my test. I will generate a file after removing the comments image

A simple way to visualize is that you can first transfer the output to numpy array https://github.com/XLechter/SDT/blob/432f6efdfa5ed0d29faeb1efda83d28620d18652/test.py#L86 and using the following codes to save them as ply files: import open3d as o3d pcd = o3d.geometry.PointCloud() pcd.points = o3d.utility.Vector3dVector(output) o3d.io.write_point_cloud('output.ply', pcd)

huyanbi commented 1 year ago

@XLechter , Excuse me, do you want to save the output in the. h5 file. I found that your test code comments include saving the input point cloud, output point cloud, and rough output of each batch as an. h5 file. In each batch iteration, write the corresponding point cloud data into the file's code. Is it usable? Should I create an. h file before using it? for exampleg_input_pcd = h5py.File(os.path.join(args.model_dir, '%s_input_pcds.h5' % epoch.split('.')[0]), 'w') g_gt_pcd = h5py.File(os.path.join(args.model_dir, '%s_gt_pcds.h5' % epoch.split('.')[0]), 'w') g_output_pcd = h5py.File(os.path.join(args.model_dir, '%s_output_pcds.h5' % epoch.split('.')[0]), 'w') g_coarse_pcd = h5py.File(os.path.join(args.model_dir, '%s_coarse_pcds.h5' % epoch.split('.')[0]), 'w') I canceled the comment below your save pcd. image Are these. h5 files converted to ply files what you call output.ply.Thank you very much for your answer.

XLechter commented 1 year ago

@XLechter , Excuse me, do you want to save the output in the. h5 file. I found that your test code comments include saving the input point cloud, output point cloud, and rough output of each batch as an. h5 file. In each batch iteration, write the corresponding point cloud data into the file's code. Is it usable? Should I create an. h file before using it? for exampleg_input_pcd = h5py.File(os.path.join(args.model_dir, '%s_input_pcds.h5' % epoch.split('.')[0]), 'w') g_gt_pcd = h5py.File(os.path.join(args.model_dir, '%s_gt_pcds.h5' % epoch.split('.')[0]), 'w') g_output_pcd = h5py.File(os.path.join(args.model_dir, '%s_output_pcds.h5' % epoch.split('.')[0]), 'w') g_coarse_pcd = h5py.File(os.path.join(args.model_dir, '%s_coarse_pcds.h5' % epoch.split('.')[0]), 'w') I canceled the comment below your save pcd. image Are these. h5 files converted to ply files what you call output.ply.Thank you very much for your answer.

Actually, these codes are written for saving different testing results for ablation studies. It is better for you to directly save ply files for visualization as I mentioned before.

huyanbi commented 1 year ago

But using the method you mentioned above will report an error. image

huyanbi commented 1 year ago

Do you want to perform the reshape process? I tried and didn't solve it.

XLechter commented 1 year ago

Do you want to perform the reshape process? I tried and didn't solve it.

First, convert the output from tensor to numpy array on CPU. Second, make sure each output to have shape (N, 3) with a for loop. Cause I cannot access to the original env I used for this project, or I can write and test this for you.

huyanbi commented 1 year ago

@XLechter ,Sorry, I failed. But I found that it seems that the generated output data is placed in the model_ pcds.h5. Could you tell me how to read it out. And how to test the results of cd and f1 for each category.

XLechter commented 1 year ago

@XLechter ,Sorry, I failed. But I found that it seems that the generated output data is placed in the model_ pcds.h5. Could you tell me how to read it out. And how to test the results of cd and f1 for each category.

@huyanbi Sorry for the late reply, as I am on leave. I think you would better save the output array with your own codes for convenience. You can check how to save and read numpy array with h5py. Simply, it follows a format like: file['key'] = array. It is commonly used for saving data.

superluming-luming355 commented 1 year ago

问一下 ,训练出来的模型 哪一个测试能得到文字的结果?谢谢