Pointnet_Pointnet2_pytorch
Pointnet_Pointnet2_pytorch copied to clipboard
How to predict own data after training?
Hi, this is a wonderful project, but I have a question about after trained my own data and got the best model, how can I use the trained model to predict other data? Other data refers to point clouds without labels.
I have the same question. If you can solve it, can you share it with me?
Hi, this is a wonderful project, but I have a question about after trained my own data and got the best model, how can I use the trained model to predict other data? Other data refers to point clouds without labels.
hello bro,my datasets have one class,and i want segmentate it to four parts,what parameters do i need to set?looking forward to hearing from you
@ooooohhhhhxxx , have you been able to predict your own data, if so please let me know how? thank you in advance.
@madinwei point cloud must first be in x y z r g b format. You can convert it with the following code.
import sys
import open3d as o3d
import numpy as np
import matplotlib.pyplot as plt
import os
import glob
input_dir = "data/"
file_name_list = glob.glob(input_dir + "*.pcd")
for file_name in file_name_list:
pcd = o3d.io.read_point_cloud(file_name)
points = np.asanyarray(pcd.points)
colors = np.array(np.asanyarray(pcd.colors)*255, dtype=np.int64)
os.makedirs(input_dir + "Annotations/", exist_ok=True)
with open(input_dir + "Annotations/" + os.path.splitext(os.path.basename(file_name))[0] + ".txt", "w") as f:
for i in range(len(points)):
x = points[i][0]
y = points[i][1]
z = points[i][2]
r = colors[i][0]
g = colors[i][1]
b = colors[i][2]
f.write(f"{x} {y} {z} {r} {g} {b}\n")
Then change data_util/collect_indoor3d_data.py and data_utils/indoor3d_util.py to the code in the repository below.
https://github.com/oshita-n/Pointnet_Pointnet2_pytorch/tree/master/data_utils
The converted file is then stored in 'data/preprocessing/' and can be inferred simply by changing the path in test_semseg.py.
@oshita-n
HI Dr. Oshita,
I made the steps you explained: 1)covs=verting file to xyzrgb, 2) preprocessed the files to npy files, and 3) apply the test file to the preprocessed data. But, i have an error which is related to the test area!
Attached is the error, can you please help me make my test on my own data. Thank you so much, waiting your reply.
@mostafa501 Hello mostafa501.
In the original code, the directory name is a class, so change the code to ignore this. You have to change two pieces of code. data_utils/indoor3d_util.py and data_utils/collect_indoor3d_data.py. Copy the code from my repository below.
https://github.com/oshita-n/Pointnet_Pointnet2_pytorch/blob/master/data_utils/collect_indoor3d_data.py https://github.com/oshita-n/Pointnet_Pointnet2_pytorch/blob/master/data_utils/indoor3d_util.py
@oshita-n HI Dr. Oshita, thank you for your work and help. I followed your description and made the test. I tried to test 3 file of the data we have from area_1 (named office_4,office_5,office_6 ) to check the result. But the result i have is so bad! (Iou=0). Can you help me tell the reasons for this unqualified test result. Attached the three used data file and the result eval file. Thank you so much. eval.txt office_4.txt office_5.txt office_6.txt
@mostafa501 The original code is for testing with stanford data. I modified it to force it to do semantic segmentation on own data. Therefore, the current evaluation is bullshit and I do not know what value this IoU indicates. I apologize for not being able to help you. It seems that perhaps if you want to evaluate using this repository, you need to do it from training. And I am not sure if training can be done successfully with the current code.
@oshita-n
Thank you for your kind reply and help. OK, your answer is noted.
I have another simple querstion, what can i do to 3D draw and plot the result obtained (file attached of number of class predicted for each point cloud) and the original file of (xyzrgb) to get a view like those in your page.
Regards, waiting your reply.
office_4 result.txt
office_4.txt
@mostafa501
There is a file named 〇〇_pred.obj in the file created under log/sem_seg/pointnet2_sem_seg/visual. This is the result of semantic segmentation. We will process this file so that it can be viewed in meshlab.
The following code will convert an obj file into a txt file that can be viewed in meshlab. All it does is remove the letter "v" from the obj file.
https://github.com/oshita-n/Pointnet_Pointnet2_pytorch/blob/master/convert_obj_txt.py
python convert_obj_txt.py --filename <obj_file_name>
# example
python convert_obj_txt.py --filename aaa_pred.obj
This will generate aaa_pred.txt in the current directory. This is the file that can be read by meshlab.
@oshita-n It is done. Much thanks for you.
hello prof,@oshita-n, thank you for your help and response to me and the others. I am trying to predict my new data with the partseg code, however, I am confused about how to do it. if it is possible to give me some guidelines or any help.
thank you in advance, looking forward to your response.
嗨,这是一个很棒的项目,但我有一个问题,关于在训练自己的数据并获得最佳模型后,如何使用训练好的模型来预测其他数据?其他数据是指没有标签的点云。
Hello, may I ask if you have solved this problem? I have trained the best model in my own data collection, and now I need to conduct segmentation performance test for unlabeled data. What should I do?
@1404561326521 Hello, I believe you can read the comments above; they will help you (comments of oshita-n).
@mostafa501 The original code is for testing with stanford data. I modified it to force it to do semantic segmentation on own data. Therefore, the current evaluation is bullshit and I do not know what value this IoU indicates. I apologize for not being able to help you. It seems that perhaps if you want to evaluate using this repository, you need to do it from training. And I am not sure if training can be done successfully with the current code.
@oshita-n @mostafa501 could you do training successfully with your own dataset?
@SiddhikaArun, i used my own datset for test by following the same steps of above (comments of oshita-n), the result of test were done, but i didnot use my data for train, i used the best model existed with the code.
@SiddhikaArun, i used my own datset for test by following the same steps of above (comments of oshita-n), the result of test were done, but i didnot use my data for train, i used the best model existed with the code.
@oshita-n @mostafa501 Oh ok..Is it possible to train our own dataset using this network?
I am not sure, but it's common in these tasks to train the model on a public dataset like Scannet, then use the own dataset to be tested by the best model trained before.
I have trained a model using the ShapeNet dataset, but now I want to use my own data but it is without labels. How do I label my data or is it possible to do part-segmentation without labeling?
,我按照上面的相同步骤(Oshita-N 的评论)使用我自己的 datset 进行测试,测试结果已经完成,但我没有使用我的数据进行训练,我使用了代码中存在的最佳模型。
你好,请问可以向你请教一下用自己的数据进行测试的问题吗,我成功用自己的数据训练了,但是在测试的时候遇到如下的相同问题:回溯(最近一次调用最后一次): 文件“test_semseg.py”,第 202 行,在 main(args) 文件“test_semseg.py”,第 118 行,在主 scene_data中,scene_label,scene_smpw,scene_point_index = TEST_DATASET_WHOLE_SCENE[batch_idx] 文件“/shiyanshi2/user/sunyijun/code/Pointnet2-own/data_utils/S3DISDataLoader.py”,第 164 行,在 getitem data_room = data_room.reshape((-1, self.block_points, data_room.shape[1])) IndexError:元组索引超出范围