Skip to content

Free Motion Capture for Everyone πŸ’€βœ¨

TypeScript

Merge branch 'jon/pupil_2' into aaron/origin_alignment-

jonmatthis2134563ad18e
diff --cc freemocap/fmc_runme.py
index ca11e07b,10dfe407..2006e3e6
--- a/freemocap/fmc_runme.py
+++ b/freemocap/fmc_runme.py
@@@ -31,7 -31,7 +31,8 @@@ from freemocap import
fmc_mediapipe,
fmc_openpose,
fmc_deeplabcut,
+ fmc_origin_alignment,
+ fmc_mediapipe_annotation,
reconstruct3D,
play_skeleton_animation,
session,
@@@ -64,7 -65,7 +66,8 @@@ def RunMe(sessionID=None
get_synced_unix_timestamps = True,
good_clean_frame_number = 0,
bundle_adjust_3d_points=False,
+ place_skeleton_on_origin = False,
+ save_annotated_videos = False,
):
"""
Starts the freemocap pipeline based on either user-input values, or default values. Creates a new session class instance (called sesh)
@@@ -231,18 -234,9 +238,20 @@@
for mm in range(sesh.mediaPipeSkel_fr_mar_xyz.shape[1]):
sesh.mediaPipeSkel_fr_mar_xyz[:,mm,dim] = savgol_filter(sesh.mediaPipeSkel_fr_mar_xyz[:,mm,dim], smoothWinLength, smoothOrder)
- np.save(sesh.dataArrayPath/'mediaPipeSkel_3d_smoothed.npy', sesh.mediaPipeSkel_fr_mar_xyz) #save data to npy
-
++
+ if place_skeleton_on_origin:
+ sesh.mediaPipeSkel_fr_mar_xyz_smoothed_unrotated = sesh.mediaPipeSkel_fr_mar_xyz.copy()
+ np.save(sesh.dataArrayPath/'mediaPipeSkel_3d_smoothed_unrotated.npy', sesh.mediaPipeSkel_fr_mar_xyz_smoothed_unrotated) #save data to npy
+
+ origin_aligned_skeleton_data_XYZ = fmc_origin_alignment.align_skeleton_with_origin(sesh,sesh.mediaPipeSkel_fr_mar_xyz,good_clean_frame_number)
+ np.save(sesh.dataArrayPath/'mediaPipeSkel_3d_smoothed.npy', origin_aligned_skeleton_data_XYZ) #save data to npy
+
+ else:
+ np.save(sesh.dataArrayPath/'mediaPipeSkel_3d_smoothed.npy', sesh.mediaPipeSkel_fr_mar_xyz)
+
+
+
+
sesh.save_session()