def SavePloat_Voxels(voxels, path, iteration):
voxels = voxels[:8].__ge__(0.5)
fig = plt.figure(figsize=(32, 16))
gs = gridspec.GridSpec(2, 4)
gs.update(wspace=0.05, hspace=0.05)
for i, sample in enumerate(voxels):
x, y, z = sample.nonzero()
ax = plt.subplot(gs[i], projection='3d')
ax.scatter(x, y, z, zdir='z', c='red')
ax.set_xticklabels([])
ax.set_yticklabels([])
ax.set_aspect('equal')
plt.savefig(path + '/{}.png'.format(str(iteration).zfill(3)), bbox_inches='tight')
plt.close()
with open(path + '/{}.pkl'.format(str(iteration).zfill(3)), "wb") as f:
pickle.dump(voxels, f, protocol=pickle.HIGHEST_PROTOCOL)
评论列表
文章目录