Skip to content

Commit 2bc36f9

Browse files
committed
Updated motion processing scripts
1 parent 1b1e825 commit 2bc36f9

File tree

5 files changed

+31
-6
lines changed

5 files changed

+31
-6
lines changed

data_processing/bvh2features.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ def extract_joint_angles(bvh_dir, files, dest_dir, pipeline_dir, fps):
6363

6464
# Setup parameter parser
6565
parser = ArgumentParser(add_help=False)
66-
parser.add_argument('--bvh_dir', '-orig', default="./data/",
66+
parser.add_argument('--bvh_dir', '-orig', required=True,
6767
help="Path where original motion files (in BVH format) are stored")
68-
parser.add_argument('--dest_dir', '-dest', default="./processed/",
68+
parser.add_argument('--dest_dir', '-dest', required=True,
6969
help="Path where extracted motion features will be stored")
7070
parser.add_argument('--pipeline_dir', '-pipe', default="./utils/",
7171
help="Path where the motion data processing pipeline will be stored")

data_processing/features2bvh.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
from pymo.viz_tools import *
1616
from pymo.writers import *
1717

18-
import joblib as jl
18+
from argparse import ArgumentParser
1919

20-
# load data pipeline
21-
pipeline = jl.load('processed/data_pipe.sav')
20+
import joblib as jl
2221

2322
def feat2bvh(feat_file, bvh_file):
23+
2424
features = np.load(feat_file)['clips']
2525
print(features.shape)
2626

@@ -34,4 +34,22 @@ def feat2bvh(feat_file, bvh_file):
3434
with open(bvh_file,'w') as f:
3535
writer.write(bvh_data[0], f)
3636

37-
feat2bvh("processed/NaturalTalking_002.npz", 'processed/converted2.bvh')
37+
if __name__ == '__main__':
38+
39+
# Setup parameter parser
40+
parser = ArgumentParser(add_help=False)
41+
parser.add_argument('--feat_dir', '-feat', required=True,
42+
help="Path where motion features are stored")
43+
parser.add_argument('--bvh_dir', '-bvh', required=True,
44+
help="Path where produced motion files (in BVH format) will be stored")
45+
parser.add_argument('--pipeline_dir', '-pipe', default="./utils/",
46+
help="Path where the motion data processing pipeline is be stored")
47+
48+
params = parser.parse_args()
49+
50+
51+
# load data pipeline
52+
pipeline = jl.load('processed/data_pipe.sav')
53+
54+
# convert a file
55+
feat2bvh(params.feat_dir, params.bvh_dir)

data_processing/utils/data_pipe.sav

-3 Bytes
Binary file not shown.

motion_repr_learning/ae/decode.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
from learn_ae_n_encode_dataset import create_nn, prepare_motion_data
1111
from config import args
1212

13+
import numpy as np
14+
15+
import sys
16+
1317
if __name__ == '__main__':
1418
# Make sure that the two mandatory arguments are provided
1519
if args.input_file is None or args.output_file is None:

motion_repr_learning/ae/utils/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"""
44

55
from os.path import join
6+
import sys
7+
8+
sys.path.append('.')
69

710
import numpy as np
811
import tensorflow as tf

0 commit comments

Comments
 (0)