improvements

This commit is contained in:
Chilcone 2021-02-03 15:49:43 +01:00
parent e6728811e9
commit 0ce8774dab
2 changed files with 2 additions and 6 deletions

View File

@ -50,7 +50,6 @@ joints = model_out.joints.detach().cpu().numpy().squeeze()
''' '''
Optimization part without visualization Optimization part without visualization
''' '''
if RUN_OPTIMIZATION: if RUN_OPTIMIZATION:
while get_next_frame(idx) is not None and idx <= FINISH_IDX: while get_next_frame(idx) is not None and idx <= FINISH_IDX:
keypoints, confidence, img_path = get_next_frame(idx) keypoints, confidence, img_path = get_next_frame(idx)
@ -115,7 +114,7 @@ if RUN_OPTIMIZATION:
pickle.dump(final_poses, fp) pickle.dump(final_poses, fp)
print("Results have been saved to", filename) print("Results have been saved to", filename)
# TODO: put into utils, rename file, # TODO: put into utils, rename file, use current body pose and camera transform for next optimization
def replay_animation(file, start_frame=0, end_frame=None, with_background=False, fps=30): def replay_animation(file, start_frame=0, end_frame=None, with_background=False, fps=30):
r = Renderer() r = Renderer()
r.start() r.start()
@ -128,15 +127,12 @@ def replay_animation(file, start_frame=0, end_frame=None, with_background=False,
if end_frame is None: if end_frame is None:
end_frame = len(final_poses) end_frame = len(final_poses)
print(len(final_poses))
for i in range(start_frame, end_frame): for i in range(start_frame, end_frame):
body_pose = final_poses[i][0] body_pose = final_poses[i][0]
camera_transform = final_poses[i][1] camera_transform = final_poses[i][1]
# Changing image is too jerky, because the image has to be removed and added each time
if with_background: if with_background:
# Changing image is too jerky, because the image has to be removed and added each time
pass pass
# img_path = samples_dir + "/" + str(i) + ".png" # img_path = samples_dir + "/" + str(i) + ".png"
# if r.get_node("image") is not None: # if r.get_node("image") is not None: