Skip to content

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

TypeScript

clean up git merge

jon matthisae66db6d77d9
diff --git a/.gitignore b/.gitignore
index 9cfc5988..9aa53935 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,13 +5,8 @@ Data/
.vscode/
*.py[cod]
*$py.class
-<<<<<<< HEAD
-FreeMocap_Data/
-FreeMoCap_Data/
-=======
FreeMoCap_Data/
->>>>>>> main
# C extensions
*.so
diff --git a/freemocap-0.0.17/freemocap/__init__.py b/freemocap-0.0.17/freemocap/__init__.py
new file mode 100644
index 00000000..11f5d922
--- /dev/null
+++ b/freemocap-0.0.17/freemocap/__init__.py
@@ -0,0 +1,14 @@
+from ._version import get_versions
+
+__version__ = get_versions()["version"]
+del get_versions
+
+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)
+
diff --git a/freemocap/dev_scratchpad/scratch_balls_lol.py b/freemocap/dev_scratchpad/balls_scratchpad_lol.py
similarity index 95%
rename from freemocap/dev_scratchpad/scratch_balls_lol.py
rename to freemocap/dev_scratchpad/balls_scratchpad_lol.py
index 09af0624..a8e473c6 100644
--- a/freemocap/dev_scratchpad/scratch_balls_lol.py
+++ b/freemocap/dev_scratchpad/balls_scratchpad_lol.py
@@ -21,8 +21,8 @@ from rich.markdown import Markdown
# %% load dlc data
-dlcDataPath = Path(r"C:\Users\jonma\Dropbox\GitKrakenRepos\freemocap\Data\sesh_21-07-20_165209\DataArrays\deepLabCut_3d.npy")
-openPoseDataPath = Path(r"C:\Users\jonma\Dropbox\GitKrakenRepos\freemocap\Data\sesh_21-07-20_165209\DataArrays\openPoseSkel_3d.npy")
+dlcDataPath = Path(r"C:\Users\jonma\Dropbox\GitKrakenRepos\freemocap - Copy\Data\sesh_21-07-20_165209\DataArrays\deepLabCut_3d.npy")
+openPoseDataPath = Path(r"C:\Users\jonma\Dropbox\GitKrakenRepos\freemocap - Copy\Data\sesh_21-07-20_165209\DataArrays\openPoseSkel_3d.npy")
dlc_fr_mar_dim = np.load(dlcDataPath)
dlc_trajectories = [dlc_fr_mar_dim[:,markerNum,:] for markerNum in range(dlc_fr_mar_dim.shape[1])]
diff --git a/freemocap/fmc_runme.py b/freemocap/fmc_runme.py
index e1f894d4..88bdb808 100644
--- a/freemocap/fmc_runme.py
+++ b/freemocap/fmc_runme.py
@@ -52,11 +52,6 @@ def Run(sessionID=None,
# sesh.dlcConfigPath = dlcConfigPath
-<<<<<<< HEAD
- if sesh.useDLC and stage<=4:
- import deeplabcut as dlc
- sesh.dlcConfigPath =dlcConfigPath
-=======
#%% load user preferences if they exist, create a new preferences yaml if they don't
here = Path(__file__).parent
@@ -87,7 +82,6 @@ def Run(sessionID=None,
sesh.preferences['saved']['dlc_config_paths'] = dlc_config_paths
sesh.save_user_preferences(sesh.preferences)
->>>>>>> main
# sesh.dlcConfigPath = Path("C:\\Users\\jonma\\Dropbox\\GitKrakenRepos\\freemocap\\DLC_Models\\PinkGreenRedJugglingBalls-JSM-2021-05-31\\config.yaml")
#sesh.dlcConfigPath = Path("C:\\Users\\jonma\\Desktop\\freemocap\\DLC_Models\\PinkGreenRedJugglingBalls-JSM-2021-05-31\\config.yaml")
if stage > 1:
@@ -116,15 +110,6 @@ def Run(sessionID=None,
if not dataFolder.exists():
raise FileNotFoundError('No data folder located at: ' + str(dataFolder))
-<<<<<<< HEAD
- dataFolder = Path.cwd()/'Data'
- if dataFolder.exists():
- if not sesh.sessionID: #if user has not provided a sessionID, use the most recent session
- subfolders = [f.path for f in os.scandir(dataFolder) if f.is_dir()] # copy-pasta from who knows where
- sesh.sessionID = Path(subfolders[-1]).stem # grab the name of the last folder in the list of subfolders
- else: #First time run! Make 'FreeMoCap_Data' Folder (and eventually, prompt to download sample data)
- dataFolder.mkdir()
-=======
if sesh.sessionID == None:
subfolders = [f.path for f in os.scandir(sesh.dataFolderPath) if f.is_dir()] # copy-pasta from who knows where
sesh.sessionID = Path(subfolders[-1]).stem # grab the name of the last folder in the list of subfolders
@@ -157,7 +142,6 @@ def Run(sessionID=None,
# dataFolder.mkdir()
# sampleDataFolder = dataFolder / '_sample_data_folder'
# sampleDataFolder.mkdir()
->>>>>>> main
board = CharucoBoard(7, 5,
#square_length=1, # here, in mm but any unit works (JSM NOTE - just using '1' so resulting units will be in 'charuco squarelenghts`)
@@ -228,21 +212,11 @@ def Run(sessionID=None,
for vid in sesh.syncedVidPath.glob('*.mp4'):
sesh.syncedVidList.append(str(vid))
-<<<<<<< HEAD
- dlc.analyze_videos(str(sesh.dlcConfigPath),sesh.syncedVidList, destfolder= sesh.dlcDataPath, save_as_csv=True)
-
- sesh.dlcData_nCams_nFrames_nImgPts_XYC = fmc_deeplabcut.parseDeepLabCut(sesh)
- np.save(sesh.dataArrayPath / "deepLabCutData_2d.npy", sesh.dlcData_nCams_nFrames_nImgPts_XYC,)
-
- sesh.dlc_fr_mar_dim = reconstruct3D.reconstruct3D(sesh,sesh.dlcData_nCams_nFrames_nImgPts_XYC, confidenceThreshold=.5)
- np.save(sesh.dataArrayPath/'deepLabCut_3d.npy', sesh.dlc_fr_mar_dim) #save data to npy
-=======
for config_path in dlc_config_paths:
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
->>>>>>> main
sesh.save_session()
else:
print('Skipping Run MediaPipe')
@@ -273,17 +247,6 @@ def Run(sessionID=None,
#sesh.config_settings = recordingconfig.load_config_yaml(sesh.yamlPath)
-<<<<<<< HEAD
- # # %% Stage Six
- # if stage <= 6:
- # print ('Starting PyQT Animation')
- # createvideo.createBodyTrackingVideos(sesh)
- # displayVid = 1
- # #if displayVid = 0, will show the synced videos
- # #if displayVid = 1, will show the openPosed videos
- # playWin = PlayerDockedWindow(sesh,displayVid)
- # playWin.animate()
-=======
# %% Stage Six
if stage <= 6:
print ('Starting PyQT Animation')
@@ -293,35 +256,10 @@ def Run(sessionID=None,
#if displayVid = 1, will show the openPosed videos
playWin = PlayerDockedWindow(sesh,displayVid)
playWin.animate()
->>>>>>> main
# %% Stage Seven
if stage <= 7:
print('Starting Skeleton Plotting')
-<<<<<<< HEAD
-
- play_skeleton_animation.PlaySkeletonAnimation(
- sesh,
- vidType=1,
- startFrame=40,
- azimuth=-90,
- elevation=-80,
- numCams = 4,
- useOpenPose=sesh.useOpenPose,
- useMediaPipe=sesh.useMediaPipe,
- useDLC=sesh.useDLC,
- recordVid = recordVid)
-
- # playskeleton.ReplaySkeleton_matplotlib(
- # sesh,
- # vidType=1,
- # startFrame=40,
- # azimuth=-90,
- # elevation=-80,
- # useOpenPose=sesh.useOpenPose,
- # useMediaPipe=sesh.useMediaPipe,
- # useDLC=sesh.useDLC)
-=======
playskeleton.ReplaySkeleton_matplotlib(
sesh,
vidType=0,
@@ -331,7 +269,6 @@ def Run(sessionID=None,
useOpenPose=sesh.useOpenPose,
useMediaPipe=sesh.useMediaPipe,
useDLC=sesh.useDLC)
->>>>>>> main
# fmc_pyqtgraph.PlaySkeleton(
# sesh,
# vidType=1,