91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 6KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-17
  • 語言: 其他
  • 標簽: 3D??

資源簡介

3D-keras-3dgan.zip,三維生成對抗網絡的keras實現。,3D建模使用專門的軟件來創建物理對象的數字模型。它是3D計算機圖形的一個方面,用于視頻游戲,3D打印和VR,以及其他應用程序。

資源截圖

代碼片段和文件信息

import?sys
import?os

import?scipy.ndimage?as?nd
import?scipy.io?as?io
import?numpy?as?np
import?matplotlib.pyplot?as?plt
import?skimage.measure?as?sk

from?mpl_toolkits?import?mplot3d

try:
????import?trimesh
????from?stl?import?mesh
except:
????pass
????print?‘All?dependencies?not?loaded?some?functionality?may?not?work‘

LOCAL_PATH?=?‘/home/khushhallchandra/datasets/3DShapeNets/volumetric_data/‘
SERVER_PATH?=?‘../data/3DShapeNets/volumetric_data/‘

def?getVF(path):
????raw_data?=?tuple(open(path?‘r‘))
????header?=?raw_data[1].split()
????n_vertices?=?int(header[0])
????n_faces?=?int(header[1])
????vertices?=?np.asarray([map(floatraw_data[i+2].split())?for?i?in?range(n_vertices)])
????faces?=?np.asarray([map(intraw_data[i+2+n_vertices].split())?for?i?in?range(n_faces)])?
????return?vertices?faces

def?plotFromVF(vertices?faces):
????input_vec?=?mesh.Mesh(np.zeros(faces.shape[0]?dtype=mesh.Mesh.dtype))
????for?i?f?in?enumerate(faces):
????????for?j?in?range(3):
????????????input_vec.vectors[i][j]?=?vertices[f[j]:]
????figure?=?plt.figure()
????axes?=?mplot3d.Axes3D(figure)
????axes.add_collection3d(mplot3d.art3d.Poly3DCollection(input_vec.vectors))
????scale?=?input_vec.points.flatten(-1)
????axes.auto_scale_xyz(scale?scale?scale)
????plt.show()

def?plotFromVoxels(voxels):
????zxy?=?voxels.nonzero()
????fig?=?plt.figure()
????ax?=?fig.add_subplot(111?projection=‘3d‘)
????ax.scatter(x?y?-z?zdir=‘z‘?c=?‘red‘)
????plt.show()

def?getVFByMarchingCubes(voxels?threshold=0.5):
????v?f?=??sk.marching_cubes(voxels?level=threshold)
????return?v?f

def?plotMeshFromVoxels(voxels?threshold=0.5):
????vf?=?getVFByMarchingCubes(voxels?threshold)
????plotFromVF(vf)

def?plotVoxelVisdom(voxels?visdom?title):
????v?f?=?getVFByMarchingCubes(voxels)
????visdom.mesh(X=v?Y=f?opts=dict(opacity=0.5?title=title))

def?plotFromVertices(vertices):
????figure?=?plt.figure()
????axes?=?mplot3d.Axes3D(figure)
????axes.scatter(vertices.T[0:]vertices.T[1:]vertices.T[2:])
????plt.show()

def?getVolumeFromOFF(path?sideLen=32):
????mesh?=?trimesh.load(path)
????volume?=?trimesh.voxel.Voxel(mesh?0.5).raw
????(x?y?z)?=?map(float?volume.shape)
????volume?=?nd.zoom(volume.astype(float)?
?????????????????????(sideLen/x?sideLen/y?sideLen/z)
?????????????????????order=1?
?????????????????????mode=‘nearest‘)
????volume[np.nonzero(volume)]?=?1.0
????return?volume.astype(np.bool)

def?getVoxelFromMat(path?cube_len=64):
????voxels?=?io.loadmat(path)[‘instance‘]
????voxels?=?np.pad(voxels(11)‘constant‘constant_values=(00))
????if?cube_len?!=?32?and?cube_len?==?64:
????????voxels?=?nd.zoom(voxels?(222)?mode=‘constant‘?order=0)
????return?voxels

def?getAll(obj=‘airplane‘train=True?is_local=False?cube_len=64?obj_ratio=1.0):
????objPath?=?SERVER_PATH?+?obj?+?‘/30/‘
????if?is_local:
????????objPath?=?LOCAL_PATH?+?obj?+?‘/30/‘
????objPath?+=?‘train/‘?if?train?else?‘test/‘
????fileList?=?[f?for?f?in?os.listdir(objPath)?if?f.endswith(‘.ma

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-07-05?01:41??keras-3dgan-master\
?????文件????????1045??2017-07-05?01:41??keras-3dgan-master\.gitignore
?????文件?????????349??2017-07-05?01:41??keras-3dgan-master\.travis.yml
?????文件????????1081??2017-07-05?01:41??keras-3dgan-master\LICENSE
?????文件??????????67??2017-07-05?01:41??keras-3dgan-master\README.md
?????目錄???????????0??2017-07-05?01:41??keras-3dgan-master\src\
?????文件????????3302??2017-07-05?01:41??keras-3dgan-master\src\dataIO.py
?????文件????????4454??2017-07-05?01:41??keras-3dgan-master\src\models.py
?????文件????????2932??2017-07-05?01:41??keras-3dgan-master\src\train.py

評論

共有 條評論