Comments (2)
I faced the same issue. Help please!
from if-net.
I faced the same issue. Help please!
maybe you can convert the obj to off manually by above code
`def obj2off(objpath, offpath):
'''
将obj文件转换为off文件
:param objpath: .obj文件的路径
:param offpath: .off文件的路径的保存地址
:return: 无
'''
line = ""
vset = []
fset = []
with open(objpath,'r') as f:
lines = f.readlines()
p = re.compile(r'/+')
space = re.compile(r' +')
for line in lines:
#拿到obj文件中一行,作为一个字符串
tailMark = " "
line = line+tailMark
if line[0]!='v' and line[0]!='f' :
continue
parameters = space.split(line.strip())
if parameters[0] == "v": #如果是顶点的话
Point = []
Point.append(eval( parameters[1]) )
Point.append(eval( parameters[2]) )
Point.append(eval( parameters[3]) )
vset.append(Point)
elif parameters[0] == "f": #如果是面的话,存放顶点的索引
vIndexSets = [] #临时存放点的集合
for i in range(1,len(parameters) ):
x = parameters[i]
ans = p.split(x)[0]
index = eval(ans)
index -= 1 #因为顶点索引在obj文件中是从1开始的,而我们存放的顶点是从0开始的,因此要减1
vIndexSets.append(index)
fset.append(vIndexSets)
with open(offpath, 'w') as out:
out = open(offpath, 'w')
out.write("OFF\n")
out.write(str(vset.__len__()) + " " + str(fset.__len__()) + " 0\n")
for j in range(len(vset)):
out.write(str(vset[j][0]) + " " + str(vset[j][1]) + " " + str(vset[j][2]) + "\n")
for i in range(len(fset)):
s = str(len( fset[i] ))
for j in range( len( fset[i] ) ):
s = s+ " "+ str(fset[i][j])
s += "\n"
out.write(s)
from if-net.
Related Issues (20)
- How to use the pretrained models to perform inference on my own data ? HOT 1
- "IndexError: index 0 is out of bounds for axis 0 with size 0" when running voxelized_pointcloud_sampling.py HOT 3
- libmesh setup error HOT 2
- Human reconstruction from point cloud captured with kinect Azure HOT 13
- question about boundary_sampling HOT 1
- Cannot find reference 'voxelize' in 'imported module data_processing.libvoxelize' HOT 7
- Chamfer L2 * 10^-2 HOT 1
- pretrained model missing HOT 1
- Query point p and surrounding points with distance d HOT 2
- About Human Reconstruction HOT 1
- human dataset
- Questions on "Implicit Functions" HOT 3
- data_processing/convert_to_scaled_off.py
- loss value HOT 4
- How to set the value of displacment in decoder?
- voxelize.py vs voxelized_pointcloud_sampling.py
- parallel training of multiple GPUs
- sorry for hand error
- pretrained models are not available
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from if-net.