Skip to content

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

TypeScript

fixing config_path typos

Aaron Cherianf2fb52e06f08
diff --git a/freemocap/fmc_deeplabcut.py b/freemocap/fmc_deeplabcut.py
index 6a914103..7ac1c750 100644
--- a/freemocap/fmc_deeplabcut.py
+++ b/freemocap/fmc_deeplabcut.py
@@ -15,9 +15,10 @@ import h5py
def parseDeepLabCut(
session,
+ config_path
): # NOTE this is assuming both the dlc config file and dlc data h5 foles are in the same folder specified in the session.dlcDataPath, if that is not the case either dlcconfig or h5files variable need to be changed
- dlcConfig = session.dlcConfigPath # File path for dlcConfig file
+ dlcConfig = config_path # File path for dlcConfig file
with open(dlcConfig) as configFile:
# Open the config file
diff --git a/freemocap/fmc_runme.py b/freemocap/fmc_runme.py
index 3c33460b..c5e74534 100644
--- a/freemocap/fmc_runme.py
+++ b/freemocap/fmc_runme.py
@@ -184,18 +184,17 @@ def Run(sessionID=None,stage=1,useOpenPose=True,useMediaPipe=False,useDLC=True,d
sesh.openPoseData_nCams_nFrames_nImgPts_XYC = fmc_openpose.parseOpenPose(sesh)
sesh.openPoseSkel_fr_mar_dim = reconstruct3D.reconstruct3D(sesh,sesh.openPoseData_nCams_nFrames_nImgPts_XYC, confidenceThreshold=.1)
np.save(sesh.dataArrayPath/'openPoseSkel_3d.npy', sesh.openPoseSkel_fr_mar_dim) #save data to npy
-
+ sesh.save_session()
sesh.syncedVidList = []
if sesh.useDLC:
for vid in sesh.syncedVidPath.glob('*.mp4'):
sesh.syncedVidList.append(str(vid))
for config_path in dlc_config_paths:
- dlc.analyze_videos(sesh.dlcConfigPath,sesh.syncedVidList, destfolder= sesh.dlcDataPath, save_as_csv=True)
-
- sesh.dlcData_nCams_nFrames_nImgPts_XYC = fmc_deeplabcut.parseDeepLabCut(sesh)
- sesh.dlc_fr_mar_dim = reconstruct3D.reconstruct3D(sesh,sesh.dlcData_nCams_nFrames_nImgPts_XYC, confidenceThreshold=.95)
- np.save(sesh.dataArrayPath/'deepLabCut_3d.npy', sesh.dlc_fr_mar_dim) #save data to npy
+ dlc.analyze_videos(config_path,sesh.syncedVidList, destfolder= sesh.dlcDataPath, save_as_csv=True)
+ sesh.dlcData_nCams_nFrames_nImgPts_XYC = fmc_deeplabcut.parseDeepLabCut(sesh, config_path)
+ sesh.dlc_fr_mar_dim = reconstruct3D.reconstruct3D(sesh,sesh.dlcData_nCams_nFrames_nImgPts_XYC, confidenceThreshold=.95)
+ np.save(sesh.dataArrayPath/'deepLabCut_3d.npy', sesh.dlc_fr_mar_dim) #save data to npy
sesh.save_session()
else:
print('Skipping Run MediaPipe')