guochengqian/PointNeXt

Visualization wrong! How to visualize the segmentation result

gyy520cyaowu opened this issue · 0 comments

Can I use python vis_result.py for visualization, and I have modified the parameters in the file.
Error reported during operation: segmentation fatal(core dumped)
if you need the code after i edit:
`
#!/usr/bin/env python

coding: utf-8
import init
import os
from openpoints.dataset.vis3d import read_obj, vis_multi_points


idx = 0
##data_dir = "pretrained/pix4point/mae-s/visualization"
data_dir = "log/s3dis/s3dis-train-pointnet-ngpus1-seed9787-20240413-060541-i4dLinHmjkzusqbp2XiSqM/visualization"
##dataset_name = 's3dissphere'
dataset_name = 's3dis-Area5'
roof_height = 3


##method_names = ['input', 'pix4point', 'gt']
method_names = ['input', 'pointnet', 'gt']
file_list = []
colors_list = []
for i, method_name in enumerate(method_names):
file_path = os.path.join(data_dir, f'{method_name}-{dataset_name}-{idx}.obj')
points, colors =read_obj(file_path)
if i == 0: # input

remove roof

valid_idx = points[:, 2] < roof_height
input_points = points[valid_idx]
colors_list.append(colors[valid_idx]/255.)
else:
colors_list.append(colors[valid_idx])

points_list = [input_points] * len(method_names)
vis_multi_points(points_list, colors_list)

`