-
Notifications
You must be signed in to change notification settings - Fork 13
/
process_openpose.py
32 lines (28 loc) · 1.01 KB
/
process_openpose.py
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
import Utils.openpose_util as opp
import numpy as np
import argparse
def process(interpolate,smoothing):
head_keys = [14, 15, 16, 17]
neck_key = [0]
print('processing .....')
p_2ds = opp.get_2ds_from_jsons(args.input_path)
p_2ds = opp.handle_head_keypoints(p_2ds, neck_key, head_keys)
if interpolate:
p_2ds = opp.openpose_interpolate(p_2ds)
if smoothing:
p_2ds = opp.openpose_smoothing(p_2ds)
print("Done")
return p_2ds
def save_data(save_path,save_name,data):
np.save(save_path+save_name,data)
return 0
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='arguments for predictions')
parser.add_argument('--input_path', default="")
parser.add_argument('--save_path', default="./sample_data/")
parser.add_argument('--save_file_name', default='test.npy')
args = parser.parse_args()
interpolate=1
smoothing=1
p_2ds = process(interpolate,smoothing)#
save_data(args.save_path,args.save_file_name,p_2ds)