-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsranipal2keypoints.py
More file actions
29 lines (25 loc) · 825 Bytes
/
sranipal2keypoints.py
File metadata and controls
29 lines (25 loc) · 825 Bytes
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
import argparse
from tqdm import tqdm
from blender_interface import EMBlender
import numpy as np
def read_file(path):
data = np.loadtxt(path, delimiter=",")
return data
def main(args):
filename = args.path
data = read_file(filename)
emb = EMBlender()
# plotter = init_visualizer()
for lipshape in tqdm(data, leave=False):
ob = emb.set_key_shapes(lipshape)
keypoints = emb.get_keypoints(ob)
lip = emb.get_lip(keypoints)
emb.set_key_shapes(lipshape)
# visualize_keypoints(plotter['all'],keypoints)
# visualize_keypoints(plotter['lip'],lip)
emb.update_visualizer(lipshape)
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('-path', type=str, help='path')
args = parser.parse_args()
main(args)