Skip to content

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

TypeScript

Merge branch 'main' into dev_aaron

aaroncherianddfdaa4ab229
diff --cc freemocap/__init__.py
index e548ba77,1327aaae..11f5d922
--- a/freemocap/__init__.py
+++ b/freemocap/__init__.py
@@@ -3,11 -3,7 +3,12 @@@ from ._version import get_version
__version__ = get_versions()["version"]
del get_versions
-from freemocap import fmc_runme
+from freemocap import fmc_runme, fmc_demo
+
+def RunMe(sessionID=None,stage=1,useOpenPose=True,useMediaPipe=False,useDLC=True,dlcConfigPath=None,debug=False,setDataPath=False,userDataPath = None):
+ fmc_runme.Run(sessionID,stage,useOpenPose,useMediaPipe,useDLC,dlcConfigPath,debug,setDataPath,userDataPath)
+
+def RunDemo():
+ sample_data_location = fmc_demo.DemoSetup() #run a bunch of GUIs, get the location of the directory where the data folder with the sample data is
- fmc_runme.Run(sessionID = 'sesh_21-07-18_170130',stage = 6,useOpenPose = True,useDLC = True, userDataPath = sample_data_location)
++ fmc_runme.Run(sessionID = 'sesh_21-07-18_170130',stage = 6,useOpenPose = True,useDLC = True, userDataPath = sample_data_location)
+
-def RunMe(sessionID=None,stage=1,useOpenPose=True,useMediaPipe=False,useDLC=True,dlcConfigPath=None,debug=False,setDataPath=False):
- fmc_runme.Run(sessionID,stage,useOpenPose,useMediaPipe,useDLC,dlcConfigPath,debug,setDataPath)
diff --cc freemocap/fmc_runme.py
index e8614883,ffb437c6..b39bec31
--- a/freemocap/fmc_runme.py
+++ b/freemocap/fmc_runme.py
@@@ -23,7 -23,7 +23,9 @@@ import numpy as n
from ruamel.yaml import YAML
-def Run(sessionID=None,stage=1,useOpenPose=True,useMediaPipe=False,useDLC=True,dlcConfigPath=None,debug=False,setDataPath=False):
++
+def Run(sessionID=None,stage=1,useOpenPose=True,useMediaPipe=False,useDLC=True,dlcConfigPath=None,debug=False,setDataPath=False,userDataPath = None):
++
sesh = session.Session()
sesh.sessionID = sessionID
@@@ -40,6 -40,6 +42,7 @@@
# sesh.dlcConfigPath = dlcConfigPath
++
#%% load user preferences if they exist, create a new preferences yaml if they don't
here = Path(__file__).parent
preferences_path = here/'user_preferences.yaml'
@@@ -54,7 -54,7 +57,9 @@@
sesh.preferences = preferences
sesh.preferences_path = preferences_path
- if sesh.useDLC:
++
+ if sesh.useDLC and stage < 5:
++
try:
saved_dlc_paths = preferences['saved']['dlc_config_paths']
except:
@@@ -79,8 -79,6 +84,9 @@@
if sesh.setDataPath == True:
basePath = runmeGUI.RunChooseDataPathGUI(session)
#sesh.dataFolderPath = Path(basePath)/sesh.dataFolderName
++
+ elif sesh.userDataPath is not None:
+ basePath = sesh.userDataPath
else:
try:
current_path_to_data = preferences['saved']['path_to_save']
diff --cc freemocap/recordingconfig.py
index 540feaa4,ead7102b..27da486c
--- a/freemocap/recordingconfig.py
+++ b/freemocap/recordingconfig.py
@@@ -7,8 -7,6 +7,10 @@@ Created on Thu Mar 11 11:54:12 202
from pathlib import Path
++
+dataFolder = 'FreeMocap_Data'
+
++
folder_setup = ['RawVideos','SyncedVideos','CalVideos','DataArrays','DLCData','OpenPoseData','MediaPipeData','imOut']
default_parameters = {'path_to_save': str(Path.cwd()),'dlc_config_paths':[], 'rotations':{},'parameters':{'exposure':-5,'resWidth':640,'resHeight':480,'framerate':25,'codec':'DIVX'}}
diff --cc freemocap/session.py
index e4c8b86a,abc75d6f..8253753c
--- a/freemocap/session.py
+++ b/freemocap/session.py
@@@ -189,6 -188,6 +189,12 @@@ class Session: #self like "recording se
preferences_yaml.dump(preferences,self.preferences_path)
++ def save_user_preferences(self,preferences):
++ preferences_yaml = YAML()
++ preferences_yaml.dump(preferences,self.preferences_path)
++
++
++
f = 2