Spaces:
Runtime error
Runtime error
File size: 1,278 Bytes
2d5fdd1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
import os,sys
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.abspath(os.path.join(THIS_DIR, os.pardir))
sys.path.append(ROOT_DIR)
#%%
from analysis.pymo.parsers import BVHParser
from analysis.pymo.data import Joint, MocapData
from analysis.pymo.preprocessing import *
from analysis.pymo.viz_tools import *
from analysis.pymo.writers import *
from sklearn.pipeline import Pipeline
import matplotlib.pyplot as plt
#%%
p = BVHParser()
# f1="data/dance_full/shadermotion_justdance/bvh/justdance_0.bvh"
# f2="data/dance_full/kth_streetdance_data/bvh/Streetdance_001.bvh"
f1=sys.argv[1] #target file
# f2=sys.argv[2] #file from which to source the offsets of the skeleton (bone names and hierarchy should be the same)
f2="/home/guillefix/code/mt-lightning/data/dance_full/kth_streetdance_data/bvh/Streetdance_001.bvh"
data1 = p.parse(f1)
data2 = p.parse(f2)
# list(data1.values.columns)[17]
# list(data2.values.columns)[17]
# data1.values["Head_Yrotation"].std()
# data2.values["Head_Yrotation"].std()
# data1.values.std()
# data2.values.std()
# data2.values
# data1.values = data1.values[data2.values.columns]
data1.skeleton = data2.skeleton
writer = BVHWriter()
with open(f1,'w') as f:
writer.write(data1, f)
# data1.skeleton
#
# data2.skeleton
|