资源简介
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
相关资源
- Bc衰变中的D波衰减器ηc211D2,ψ
- OSG 72集视频教程和资料140620
- The Secret Path 3D 3D魔方迷宫[源码][scra
-
Actionsc
ript 1.0实现能跟随鼠标运动的 - Unity3D登录界面工程
- 3DWebGIS 3DWebGIS
- 3des加解密_C 实现
- unity3d反编译工具
- 自编用openGL实现3D分形树,分形山
- Quest3D 2个动画相机切换实例
- OpenGL-3D坦克模拟
- FLAC3D数值模拟的边坡稳定性
-
UnityWebPla
yerFull - Scratch:3d飞行模拟器 .sb3
- OPENGL实现世界上最小的3D游戏
- 亲子嘉年华路演活动模型
- 基于GTP修正的R3DGM建模与可视化方法
- 通过3D打印样品发现NMR曲线的不同姿态
- 3维泊松表面重建
- 3d N = 1 Chern–Simons问题理论与局部
- Altium designer超全元件库+封装库部分
- 围绕圆球扩展3d N $$ \\ mathcal {N} $$ =
- 3d N $$ \\ mathcal {N} $$ = 4个理论和共形块
- 反射组和3d N $$ \\ mathcal {N} $$ 6 SCFT
- 大N重整化组以3d N $$ \\ mathcal {N} $$ =
- 3d N $$ \\ mathcal {N} $$的扭曲指数= 4轨距
- 精确结果为3d N $$ \\ mathcal {N} $$ = 2 S
- 3d N = 1 $$ \\ mathcal {N} = 1 $有效超重力和
- 3d N $$ \\ mathcal {N} $$ = 2镜像对称,pq网
- 3d N $$ \\ mathcal {N} $$ = 2对偶的计量和去
评论
共有 条评论