# x/y/z data should be numpy array (or 1D tensor using cpu - but I am not sure)
# input here is pointcloud tensor which uses gpu, so I converted into numpy array
# If the tensor shape is N=batch, P=2048, D=3, call it for individual pcl
# or loop through batch and call this function
def matplotlib_3d_ptcloud(output_pcl):
data = output_pcl.detach().cpu().numpy()
xdata = data[0][:,0].squeeze()
ydata = data[0][:,1].squeeze()
zdata = data[0][:,2].squeeze()
fig = plt.figure(figsize=(15, 15))
ax = plt.axes(projection='3d')
ax.scatter3D(xdata, ydata, zdata, marker='o')
plt.show()
CUDA (+CUDA Toolkit), Nvidia Driver, cuDNN 우분투 20.04 설치 (0) | 2021.03.02 |
---|---|
아나콘다에서 PyTorch 설치, PyCharm에서 돌려보기 (0) | 2020.11.13 |
댓글 영역