def test5(): red = mut.makeRed(1000) path = "./data/restore-pass-comp9" mut.mkdir_p(path) for i in xrange(1000): m1 = m3d.model3d_plus() m1.read_ply("./pcacolors-comp9/restore/ply/resotre%04d.ply" % i) m1.write_color_ply(path + "/restore%04d.ply" % i, red)
def test5(): red = mut.makeRed(1000) path = './data/restore-pass-comp9' mut.mkdir_p(path) for i in xrange(1000): m1 = m3d.model3d_plus() m1.read_ply("./pcacolors-comp9/restore/ply/resotre%04d.ply" % i) m1.write_color_ply(path + '/restore%04d.ply' % i, red)
def restoreMeshes(outdir, meshNames, invTrans, faceNum): for i in xrange(start_frame, frame): print "restore frame:", i print "restore dist mat", i - start_frame path = outdir + "/restore/ply" mut.mkdir_p(path) name = meshNames % i testlist = md.divide_distanceList_as_f(invTrans, faceNum, i - start_frame) prmesh = restoreMesh(name, testlist) prmesh.write_ply(path + "/" + "resotre%04d.ply" % i)
def restoreMeshes(outdir, meshNames, invTrans, faceNum): for i in xrange(start_frame, frame): print "restore frame:", i print 'restore dist mat', i - start_frame path = outdir + '/restore/ply' mut.mkdir_p(path) name = meshNames % i testlist = md.divide_distanceList_as_f(invTrans, faceNum, i - start_frame) prmesh = restoreMesh(name, testlist) prmesh.write_ply(path + '/' + 'resotre%04d.ply' % i)
def saveResultPCA(outdir, applyMeshName, c_ratio_all, evr_all): m = m3d.model3d_changeLo() m.read_ply(applyMeshName) nv, nf = md.divide_face(m) dir_r = outdir + "colorPly/c_ratio" dir_e = outdir + "colorPly/c_evr" mut.mkdir_p(dir_r) mut.mkdir_p(dir_e) for i in xrange(comp_max - 1): md.set_scale(0, 1) col = md.dist2color2(c_ratio_all[:, i]) col3 = md.color2color_x_3(col) mut.save_ply_file_color(dir_r + "/" + "ratio_c%03dframe0000.ply" % i, nv, nf, col3) col = md.dist2color2(evr_all[:, i]) col3 = md.color2color_x_3(col) mut.save_ply_file_color(dir_e + "/" + "evr_c%03dframe0000.ply" % i, nv, nf, col3)
def dataMakesAllface(datas, trans, components, means, params, skip=None): rts = params old = mut.mkdir_p(out + "learn/") if skip is not None: skipp, rts = dataMake.dataSkip(skip, params) print skipp np.savetxt(old + "/skip%04dParam.txt" % (skip + start_frame), skipp, delimiter=",") for i in xrange(face_Num): # print 'face:',i name = old + "/testf%04d.npz" % i dataMake.dataMake( dataName=name, datas=datas[i].T, param=rts, transdata=trans[i].T, component=components[i].T, mean=means[i] )
def dataMakesAllface(datas, trans, components, means, params, skip=None): rts = params old = mut.mkdir_p(out + 'learn/') if skip is not None: skipp, rts = dataMake.dataSkip(skip, params) print skipp np.savetxt(old + '/skip%04dParam.txt' % (skip + start_frame), skipp, delimiter=',') for i in xrange(face_Num): #print 'face:',i name = old + '/testf%04d.npz' % i dataMake.dataMake(dataName=name, datas=datas[i].T, param=rts, transdata=trans[i].T, component=components[i].T, mean=means[i])
def savedistance(dir, distance): path = mut.mkdir_p(dir) for i in xrange(face_Num): np.savetxt(dir + "/distface%04d.txt" % i, distance[i], fmt="%10f")
def savedistance(dir, distance): path = mut.mkdir_p(dir) for i in xrange(face_Num): np.savetxt(dir + '/distface%04d.txt' % i, distance[i], fmt='%10f')