Skip to content

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

TypeScript

Delete the old freemocap gui code

Endurance Idehen24f37eda8f3d
diff --git a/OLD_README.md b/OLD_README.md
new file mode 100644
index 00000000..f1ca7af2
--- /dev/null
+++ b/OLD_README.md
@@ -0,0 +1,355 @@
+
+https://user-images.githubusercontent.com/15314521/124694557-8069ea00-deaf-11eb-9328-3be27a4b1ea4.mp4
+
+# This is all very much a work in progress! More to come!
+## (As of May 2022) We're currently working on building a proper API with documentation, but for now enjoy this pile of not-quite-spaghetti-but-definitely-lasagna-flavored code and sloppy ReadMe πŸ˜…
+
+___________________________________
+___
+
+[![Freemocap Tests](https://github.com/freemocap/freemocap/actions/workflows/python-testing.yml/badge.svg)](https://github.com/freemocap/freemocap/actions/workflows/python-testing.yml)
+
+## Prerequisites -
+**Required**
+* Windows only for now (sorry! Mac and Linux support coming very soon!πŸ˜…)
+* A Python 3.7 environment -
+ * We recommend installing Anaconda from here (https://www.anaconda.com/products/individual#Downloads) to create your Python environment.
+
+* Two or more USB webcams attached to viable USB ports
+ * ~~USB hubs typically don't work~~ I think they do now?
+ * Note that two cameras is the **minimum** required for 3d reconstruction. However, with just two views, many points will be occluded/not visible to both cameras. For better performance, use three (or four or more?) cameras
+* Each camera must get a clean unobstructed view of a Charuco board at some (See below).
+____
+____
+# Installation
+Open an Anaconda-enabled command prompt or powershell window and perform the following steps:
+
+1) Create a Python3.7 Anaconda environment
+```
+$ conda create -n freemocap-env python=3.7
+```
+
+2) Activate that newly created environment
+```
+$ conda activate freemocap-env
+```
+3) Install freemocap from PyPi using `pip`
+```
+$ pip install freemocap
+```
+That should be it!
+___
+___
+# Basic Usage
+
+
+
+ ## HOW TO CREATE A *NEW* `FreeMoCap` RECORDING SESSION
+
+tl;dr- **Activate the the freemocap Python environment** and run the following lines of code (either in a script or in a console)
+
+```python
+import freemocap
+freemocap.RunMe()
+```
+
+But COOL KIDS will install Blender ([blender.org](https://blender.org) and generate an awesome `.blend` file animation by setting `useBlender=True`:
+
+```python
+import freemocap
+freemocap.RunMe(useBlender=True)
+```
+
+
+
+
+This two-line script is a copy of the `freemocap_runme_script.py` file, which can be run by entering the following command into a command prompt or powershell:
+```
+(freemoocap-env)$ python freemocap_runme_script.py
+```
+
+## In a bit more detail-
+
+ ### 1) In an Anaconda enabled Command Prompt, PowerShell, or Windows Terminal window
+- You will know if it's `Anaconda Enabled` because you will see a little `(base)` to the left of each line, which denotes that your `(base)` environment is currently active.
+- We recommend Windows Terminal so you can enjoy all the [Rich](https://github.com/willmcgugan/rich)✨ formatted text output, but you'll need to do a bit of work to connect it to Anaconda (e.g. [these instructions](https://dev.to/azure/easily-add-anaconda-prompt-in-windows-terminal-to-make-life-better-3p6j) )
+ - If that seems intimidating (or just too much work), just press the `Windows` key, type `Anaconda Prompt` and run everything from there.
+
+ ### 2) Activate your freemocap environment
+ - e.g. if your freemocap environment is named `freemocap-env`, type:
+ ```
+ (base)$ conda activate freemocap-env
+ ```
+ - If successful, the `(base)` to the left of each line will change to `(freemocap-env)`, indicating that your freemocap environment is now active (type `conda info --envs` or `conda info -e` for a list of all available environments)
+
+### 3) Activate an `ipython` console
+ - Activate an instance of an `ipython` console by typing `ipython` into the command window and pressing 'Enter'
+```
+(freemocap-env)$ ipython
+```
+### 4) Within the `ipython` console, import the `freemocap` package
+
+```Python
+[1]: import freemocap
+```
+
+### 5) Execute the `freemocap.RunMe()` command (with default parameters, see [#runme-input-parameters](#runme-input-parameters) for more info)
+
+```python
+[2]: freemocap.RunMe() #<-this is where the magic happens!
+```
+
+### 6) Follow instructions in the Command window and pop-up GUI windows!
+---βœ¨πŸ’€βœ¨---.
+
+---
+___
+
+## HOW TO REPROCESS A PREVIOUSLY RECORDED `FreeMoCap` RECORDING SESSION
+
+You can re-start the processing pipeline from any of the following processing stages (defined below)by specifying the `SessionID` desired `stage` in the call to `freemocap.RunMe()`
+
+So to process the session named `sesh_2021-11-21_19_42_07` starting from stage 3 (aka, skipping the `1- recording` and `2- synchronization` stages), run:
+```python
+import freemocap
+freemocap.RunMe(sessionID="sesh_2021-11-21_19_42_07", stage=3)
+```
+
+Note - if you leave `sessionID` unspecified but set `stage` to a number higher than 1, it will attempt to use the last recorded session (but this can be buggy atm)
+
+___
+
+## [Processing stages](#processing-stages) -
+
+ - **Stage 1 - Record Videos**
+ - Record raw videos from attached USB webcams and timestamps for each frame
+ - Raw Videos saved to `FreeMoCap_Data/[Session Folder]/RawVideos`
+
+ - **Stage 2 - Synchronize Videos**
+ - Use recorded timestamps to re-save raw videos as synchronized videos (same start and end and same number of frames). Videos saved to
+ - Synchronized Videos saved to `FreeMoCap_Data/[Session Folder]/SynchedVideos`
+
+
+ - **Stage 3 - Calibrate Capture Volume**
+ - Use [Anipose](https://anipose.org)'s [Charuco-based](https://docs.opencv.org/3.4/df/d4a/tutorial_charuco_detection.html) calibration method to determine the location of each camera during a recording session and calibrate the capture volume
+ - Calibration info saved to `[sessionID]_calibration.toml` and `[sessionID]_calibration.pickle`
+
+
+- **Stage 4 - Track 2D points in videos and Reconstruct 3D** <-This is where the magic happens ✨
+ - Apply user specified tracking algorithms to Synchronized videos (currently supporting MediaPipe, OpenPose, and DeepLabCut) to generate 2D data
+ - Save to `FreeMoCap_Data/[Session Folder]/DataArrays/` folder (e.g. `mediaPipeData_2d.npy`)
+ - Combine 2d data from each camera with calibration data from Stage 3 to reconstruct the 3d trajectory of each tracked point
+ - Save to `/DataArrays` folder (e.g. `openPoseSkel_3d.npy`)
+ - NOTE - you might think it would make sense to separate the 2d tracking and 3d reconstruction into different stages, but the way the code is currently set up it's cleaner to combine them into the same processing stage Β―\\\_(ツ)_/Β―
+
+- **Stage 5 - Use Blender to generate output data files (optional, requires [Blender](https://blender.org) installed. set `freemocap.RunMe(useBlender=True)` to use)**
+ - Hijack a user-installed version of [Blender](https://blender.org) to format raw mocap data into a `.blend` file including the raw data as keyframed emtpies with a (sloppy, inexpertly) rigged and meshed armatured based on the [Rigify](https://docs.blender.org/manual/en/2.81/addons/rigging/rigify.html) Human Metarig
+ - Save `.blend` file to `[Session_Folder]/[Session_ID]/[Session_ID].blend`
+ - You can double click that `.blend` file to open it in Blender.
+ - For instructions on how to navigate a Blender Scene, try this [YouTube Tutorial](https://www.youtube.com/watch?v=nIoXOplUvAw)
+
+
+- **Stage 6 - Save Skeleton Animation!**
+ - Create a [Matplotlib](https://matplotlib.org) based output animation video.
+ - Saves Animation video to: `[Session Folder]/[SessionID]_animVid.mp4`
+ - Note - This part takes for-EVER πŸ˜…
+
+____
+____
+## `freemocap.RunMe()` Specify recording session paramters
+___
+The `freemocap.RunMe()` function takes a number of parameters that can be used to alter it's default behavior in important ways. Here are the default parameters along with a followed by a brief description of each one.
+
+
+### RunMe - Default parameters
+```python
+#in `freemocap/fmc_runme.py`
+def RunMe(sessionID=None,
+ stage=1,
+ useOpenPose=False,
+ runOpenPose = True,
+ useMediaPipe=True,
+ runMediaPipe=True,
+ useDLC=False,
+ dlcConfigPath=None,
+ debug=False,
+ setDataPath = False,
+ userDataPath = None,
+ recordVid = True,
+ showAnimation = True,
+ reconstructionConfidenceThreshold = .7,
+ charucoSquareSize = 36, #mm
+ calVideoFrameLength = .5,
+ startFrame = 0,
+ useBlender = False,
+ resetBlenderExe = False,
+ get_synced_unix_timestamps = True,
+ good_clean_frame_number = 0,
+ bundle_adjust_3d_points=False
+ ):
+```
+
+### [RunMe input parameters](#runme-input-parameters)
+- `sessionID`
+ - Type - (str)
+ - [Default] - None.
+ - Indentifying string to use for this session.
+ - If creating a new session, default behavior is to autogerate SessionID is based on date and time that the session was recorded
+ - If re-processing a previously recorded session, this value specifies which session to reprocess (must be the name of a folder within the `FreeMoCap_Data` folder)
+ -
+- `stage`
+ - [Type] - Int
+ - [Default] - 1
+ - Which processing stage to start from. Processing stages are deined in more detail in [#processing-stages](#processing-stages)
+
+ ```
+ stage 1 - Record Raw Videos
+ stage 2 - Synchronize Videos
+ stage 3 - Camera Calibration
+ stage 4 - 2d Tracking and 3d Calibration
+ stage 5 - Create output files (using Blender)
+ stage 6 - Create output animation (Matplotlib)
+ ```
+- `useMediaPipe`
+ - [Type] - BOOL
+ - [Default] - False,
+ - Whether or not to use the MediaPipe tracking method in `stage=4`
+
+- `runMediaPipe`
+ - [Type] - BOOL
+ - [Default] - False,
+ - Whether or not to RUN the MediaPipe tracking method in `stage=4` (will use previously processed data. This can save a lot of time when re-processing long videos)
+
+- `useOpenPose`
+ - [Type] - BOOL
+ - [Default] - False,
+ - Whether or not to use the OpenPose tracking method in `stage=4`
+
+- `runOpenPose`
+ - [Type] - BOOL
+ - [Default] - False,
+ - Whether or not to RUN the OpenPose tracking method in `stage=4` (will use previously processed data. This can save a lot of time when re-processing long videos)
+
+- `useDeepLabCut`
+ - [Type] - BOOL
+ - [Default] - False,
+ - Whether or not to use the DeepLabCut model/project specified at `dlcConfigPath` to track objects in `stage=4`
+
+
+- `setDataPath`
+ - [Type] - BOOL
+ - [Default] - False,
+ - Trigger the GUI that prompts user to specify location of `FreeMoCap_Data`
+
+- `userDataPath`
+ - [Type] - BOOL
+ - [Default] - False,
+ - path to the location of `FreeMoCap_Data`
+
+- `recordVid`
+ - [Type] - BOOL
+ - [Default] - False,
+ - wehether to save the matplotlib animation to an `.mp4` file
+
+- `showAnimation`
+ - [Type] - BOOL
+ - [Default] - False,
+ - wehether to save the matplotlib animation to an `.mp4` file
+
+- `reconstructionConfidenceThreshold`
+ - [Type] - float in range(0,1),
+ - [Default] - .7
+ - Threshold 'confidence' value to include a point in the 3d reconstruction step
+
+- `charucoSquareSize`
+ - [Type] = int
+ - [Default] = 36,
+ - The size of a side of a black square in the Charuco board used in this calibration. The default value of 36 is approximately appropriate for a print out on an 8 in bu 10 in paper (US Letter, approx A4)
+
+- `calVideoLength`
+ - [Type] = int, float in range (0,1), or [int, int]
+ - [Default] = .5,
+ - What portion of the videos to use in the Anipose calibration step in `stage=3`. `-1` uses the whole recording, a number between 0 and 1 defines a proprotion of the video to use, and a tuple of two numbers defines the start and end frame
+
+
+- `startFrame`
+ - [Type] = int
+ - [Default] = 0,
+ - what frame of the video to start the animation in `stage=6`
+
+- `useBlender`
+ - [Type] = BOOL
+ - [Default] = True,
+ - Whether to use Blender to create output `.blend`, `.fbx`,`.usd`,and `.gltf` files
+
+- `resetBlenderExe`
+ - [Type] = BOOL
+ - [Default] = False,
+ - Whether to launch GUI to set Blender .exe path (usually something like `C:/Program Files/Blender Foundation/2.95/`)
+
+- `get_synced_unix_timestamps`
+ - [Type] = BOOL
+ - [Default] = True,
+ - Whether to save camera timestamps in `Unix Epoch Time` in addition to the default 'counting up from zero' timestamps. Very helpful for synchronizing FreeMoCap with other softwares
+
+- `good_clean_frame_number`
+ - [Type] = int
+ - [Default] = 0,
+ - A frame where the subject is standing in something like a T-pose or an A-pose, which will be used to scale the armature created via the `useBlender=True` option. If set to default (`0`) the software will attempt to locate this frame automatically by looking for a frame where all markers are visible with high `confidence` values (but this is buggy)
+
+- `bundle_adjust_3d_points` [EXPERIMENTAL as of May 2022]
+ - [Type] = BOOL
+ - [Default] = False,
+ - When set to `True`, the system will run a bundle adjust optimization of all recorded 3d points produced in `stage=4` using `aniposelib`'s `optim_points` method. This takes a rather long time, but can signicantly clean up the resulting recordings. However,it may also "over smooth" the data. We're in the process of testing this method out now
+
+- `use_previous_calibration`
+ - [Type] = BOOL
+ - [Default] = False,
+ - Choose whether to use a calibration file from a previous session. When `False`, FreeMoCap will automatically save out calibration data whenever stage 3 is successfully completed. Only one saved calibration file is stored, so running another session will overwrite the currently saved calibration file. When `True` , FreeMoCap will instead load in the saved calibration data, which allows users to create recordings without needing to show the cameras the Charuco board.
+
+
+____
+____
+## Charuco Board Information
+___
+ * Our calibration method relies on [Anipose](https://anipose.org)'s [Charuco-based](https://docs.opencv.org/3.4/df/d4a/tutorial_charuco_detection.html) calibration method to determine the location of each camera during a recording session. This information is later used to create the 3d reconstruction of the tracked points
+
+ * IMPORTANT The Charuco board shown to the camera MUST be generated with the `cv2.aruco.DICT_4X4_250` dictionary!
+
+ * Ah high resoultion `png` of this Charuco board is in this repository at `/charuco_board_image_highRes.png`
+*
+ * To generate your own board, use the following python commands (or equivalent). DO NOT CHANGE THE PARAMETERS OR THE CALIBRATION WILL NOT WORK:
+ ``` python
+ import cv2
+
+ aruco_dict = cv2.aruco.Dictionary_get(cv2.aruco.DICT_4X4_250) #note `cv2.aruco` can be installed via `pip install opencv-contrib-python`
+
+ board = cv2.aruco.CharucoBoard_create(7, 5, 1, .8, aruco_dict)
+
+ charuco_board_image = board.draw((2000,2000)) #`2000` is the resolution of the resulting image. Increase this number if printing a large board (bigger is better! Esp for large spaces!
+
+ cv2.imwrite('charuco_board_image.png',charuco_board_image)
+
+ ```
+
+# **Optional**
+
+Both [Deeplabcut](https://deeplabcut.org) and [OpenPose](https://github.com/CMU-Perceptual-Computing-Lab/openpose) are technically supported, but both are rather under-tested at the moment.
+
+* To use DeepLabCut, install with set `freemocap.RunMe(useDLC=True)`
+ * Installation instructions for DeepLabCut may be found on their github - https://github.com/DeepLabCut/DeepLabCut
+
+* If you would like to use OpenPose for body tracking, install Cuda and the Windows Portable Demo of OpenPose and set `freemocap.RunMe(useOpenPose=True)`.
+ * Install CUDA: https://developer.nvidia.com/cuda-downloads
+
+ * Install OpenPose (Windows Portable Demo): https://github.com/CMU-Perceptual-Computing-Lab/openpose/releases/tag/v1.6.0
+
+
+
+
+Follow the GitHub Repository and/or Join the Discord (https://discord.gg/HX7MTprYsK) for updates!
+
+# Stay Tuned for more soon!
+
+
+βœ¨πŸ’€βœ¨
diff --git a/README.md b/README.md
index f1ca7af2..f09614e5 100644
--- a/README.md
+++ b/README.md
@@ -1,355 +1,80 @@
-
-https://user-images.githubusercontent.com/15314521/124694557-8069ea00-deaf-11eb-9328-3be27a4b1ea4.mp4
-
-# This is all very much a work in progress! More to come!
-## (As of May 2022) We're currently working on building a proper API with documentation, but for now enjoy this pile of not-quite-spaghetti-but-definitely-lasagna-flavored code and sloppy ReadMe πŸ˜…
-
-___________________________________
-___
-
-[![Freemocap Tests](https://github.com/freemocap/freemocap/actions/workflows/python-testing.yml/badge.svg)](https://github.com/freemocap/freemocap/actions/workflows/python-testing.yml)
-
-## Prerequisites -
-**Required**
-* Windows only for now (sorry! Mac and Linux support coming very soon!πŸ˜…)
-* A Python 3.7 environment -
- * We recommend installing Anaconda from here (https://www.anaconda.com/products/individual#Downloads) to create your Python environment.
-
-* Two or more USB webcams attached to viable USB ports
- * ~~USB hubs typically don't work~~ I think they do now?
- * Note that two cameras is the **minimum** required for 3d reconstruction. However, with just two views, many points will be occluded/not visible to both cameras. For better performance, use three (or four or more?) cameras
-* Each camera must get a clean unobstructed view of a Charuco board at some (See below).
-____
-____
-# Installation
-Open an Anaconda-enabled command prompt or powershell window and perform the following steps:
-
-1) Create a Python3.7 Anaconda environment
-```
-$ conda create -n freemocap-env python=3.7
-```
-
-2) Activate that newly created environment
-```
-$ conda activate freemocap-env
+<p align="center">
+ <img src="https://raw.githubusercontent.com/freemocap/freemocap/main/logo/freemocap-logo-black-border.svg" height="64" alt="Project Logo">
+</p>
+<h3 align="center">freemocap</h3>
+<p align="center">πŸ“ Free Motion Capture to convert human image data into skeletons</p>
+<p align="center">
+ <a href="https://github.com/freemocap/freemocap/releases">
+ <img src="https://img.shields.io/github/downloads/freemocap/freemocap/total.svg" alt="GitHub Downloads">
+ </a>
+ <a href="https://github.com/freemocap/freemocap/releases/latest">
+ <img src="https://img.shields.io/github/release/freemocap/freemocap.svg" alt="Latest Release">
+ </a>
+ <a href="https://github.com/freemocap/freemocap/blob/main/LICENSE">
+ <img src="https://img.shields.io/badge/license-AGPL-blue.svg" alt="MIT License">
+ </a>
+ <a href="https://github.com/freemocap/freemocap/issues">
+ <img src="https://img.shields.io/badge/contributions-welcome-ff69b4.svg" alt="Contributions Welcome">
+ </a>
+</p>
+
+## Pre-requisites
+
+### General
+- Python 3.9 or higher
+- Git
+### MacOSX / Linux
+-
+
+## Installation
+
+Clone the repo
+```bash
+git clone https://github.com/freemocap/freemocap.git
```
-3) Install freemocap from PyPi using `pip`
-```
-$ pip install freemocap
-```
-That should be it!
-___
-___
-# Basic Usage
-
-
- ## HOW TO CREATE A *NEW* `FreeMoCap` RECORDING SESSION
-
-tl;dr- **Activate the the freemocap Python environment** and run the following lines of code (either in a script or in a console)
-
-```python
-import freemocap
-freemocap.RunMe()
+Navigate into the newly cloned freemocap folder
+```bash
+cd freemocap
```
-But COOL KIDS will install Blender ([blender.org](https://blender.org) and generate an awesome `.blend` file animation by setting `useBlender=True`:
-
-```python
-import freemocap
-freemocap.RunMe(useBlender=True)
+Install the Python Dependencies (into a virtual environment)
+```bash
+python3 -m venv env
+pip install -r requirements.txt
```
+## Usage
-This two-line script is a copy of the `freemocap_runme_script.py` file, which can be run by entering the following command into a command prompt or powershell:
-```
-(freemoocap-env)$ python freemocap_runme_script.py
-```
-
-## In a bit more detail-
-
- ### 1) In an Anaconda enabled Command Prompt, PowerShell, or Windows Terminal window
-- You will know if it's `Anaconda Enabled` because you will see a little `(base)` to the left of each line, which denotes that your `(base)` environment is currently active.
-- We recommend Windows Terminal so you can enjoy all the [Rich](https://github.com/willmcgugan/rich)✨ formatted text output, but you'll need to do a bit of work to connect it to Anaconda (e.g. [these instructions](https://dev.to/azure/easily-add-anaconda-prompt-in-windows-terminal-to-make-life-better-3p6j) )
- - If that seems intimidating (or just too much work), just press the `Windows` key, type `Anaconda Prompt` and run everything from there.
-
- ### 2) Activate your freemocap environment
- - e.g. if your freemocap environment is named `freemocap-env`, type:
- ```
- (base)$ conda activate freemocap-env
- ```
- - If successful, the `(base)` to the left of each line will change to `(freemocap-env)`, indicating that your freemocap environment is now active (type `conda info --envs` or `conda info -e` for a list of all available environments)
-
-### 3) Activate an `ipython` console
- - Activate an instance of an `ipython` console by typing `ipython` into the command window and pressing 'Enter'
-```
-(freemocap-env)$ ipython
-```
-### 4) Within the `ipython` console, import the `freemocap` package
-
-```Python
-[1]: import freemocap
-```
-
-### 5) Execute the `freemocap.RunMe()` command (with default parameters, see [#runme-input-parameters](#runme-input-parameters) for more info)
-
-```python
-[2]: freemocap.RunMe() #<-this is where the magic happens!
-```
-
-### 6) Follow instructions in the Command window and pop-up GUI windows!
----βœ¨πŸ’€βœ¨---.
-
----
-___
-
-## HOW TO REPROCESS A PREVIOUSLY RECORDED `FreeMoCap` RECORDING SESSION
-
-You can re-start the processing pipeline from any of the following processing stages (defined below)by specifying the `SessionID` desired `stage` in the call to `freemocap.RunMe()`
-
-So to process the session named `sesh_2021-11-21_19_42_07` starting from stage 3 (aka, skipping the `1- recording` and `2- synchronization` stages), run:
-```python
-import freemocap
-freemocap.RunMe(sessionID="sesh_2021-11-21_19_42_07", stage=3)
-```
-
-Note - if you leave `sessionID` unspecified but set `stage` to a number higher than 1, it will attempt to use the last recorded session (but this can be buggy atm)
-
-___
-
-## [Processing stages](#processing-stages) -
-
- - **Stage 1 - Record Videos**
- - Record raw videos from attached USB webcams and timestamps for each frame
- - Raw Videos saved to `FreeMoCap_Data/[Session Folder]/RawVideos`
-
- - **Stage 2 - Synchronize Videos**
- - Use recorded timestamps to re-save raw videos as synchronized videos (same start and end and same number of frames). Videos saved to
- - Synchronized Videos saved to `FreeMoCap_Data/[Session Folder]/SynchedVideos`
-
-
- - **Stage 3 - Calibrate Capture Volume**
- - Use [Anipose](https://anipose.org)'s [Charuco-based](https://docs.opencv.org/3.4/df/d4a/tutorial_charuco_detection.html) calibration method to determine the location of each camera during a recording session and calibrate the capture volume
- - Calibration info saved to `[sessionID]_calibration.toml` and `[sessionID]_calibration.pickle`
-
-
-- **Stage 4 - Track 2D points in videos and Reconstruct 3D** <-This is where the magic happens ✨
- - Apply user specified tracking algorithms to Synchronized videos (currently supporting MediaPipe, OpenPose, and DeepLabCut) to generate 2D data
- - Save to `FreeMoCap_Data/[Session Folder]/DataArrays/` folder (e.g. `mediaPipeData_2d.npy`)
- - Combine 2d data from each camera with calibration data from Stage 3 to reconstruct the 3d trajectory of each tracked point
- - Save to `/DataArrays` folder (e.g. `openPoseSkel_3d.npy`)
- - NOTE - you might think it would make sense to separate the 2d tracking and 3d reconstruction into different stages, but the way the code is currently set up it's cleaner to combine them into the same processing stage Β―\\\_(ツ)_/Β―
-
-- **Stage 5 - Use Blender to generate output data files (optional, requires [Blender](https://blender.org) installed. set `freemocap.RunMe(useBlender=True)` to use)**
- - Hijack a user-installed version of [Blender](https://blender.org) to format raw mocap data into a `.blend` file including the raw data as keyframed emtpies with a (sloppy, inexpertly) rigged and meshed armatured based on the [Rigify](https://docs.blender.org/manual/en/2.81/addons/rigging/rigify.html) Human Metarig
- - Save `.blend` file to `[Session_Folder]/[Session_ID]/[Session_ID].blend`
- - You can double click that `.blend` file to open it in Blender.
- - For instructions on how to navigate a Blender Scene, try this [YouTube Tutorial](https://www.youtube.com/watch?v=nIoXOplUvAw)
-
-
-- **Stage 6 - Save Skeleton Animation!**
- - Create a [Matplotlib](https://matplotlib.org) based output animation video.
- - Saves Animation video to: `[Session Folder]/[SessionID]_animVid.mp4`
- - Note - This part takes for-EVER πŸ˜…
-
-____
-____
-## `freemocap.RunMe()` Specify recording session paramters
-___
-The `freemocap.RunMe()` function takes a number of parameters that can be used to alter it's default behavior in important ways. Here are the default parameters along with a followed by a brief description of each one.
-
-
-### RunMe - Default parameters
-```python
-#in `freemocap/fmc_runme.py`
-def RunMe(sessionID=None,
- stage=1,
- useOpenPose=False,
- runOpenPose = True,
- useMediaPipe=True,
- runMediaPipe=True,
- useDLC=False,
- dlcConfigPath=None,
- debug=False,
- setDataPath = False,
- userDataPath = None,
- recordVid = True,
- showAnimation = True,
- reconstructionConfidenceThreshold = .7,
- charucoSquareSize = 36, #mm
- calVideoFrameLength = .5,
- startFrame = 0,
- useBlender = False,
- resetBlenderExe = False,
- get_synced_unix_timestamps = True,
- good_clean_frame_number = 0,
- bundle_adjust_3d_points=False
- ):
-```
-
-### [RunMe input parameters](#runme-input-parameters)
-- `sessionID`
- - Type - (str)
- - [Default] - None.
- - Indentifying string to use for this session.
- - If creating a new session, default behavior is to autogerate SessionID is based on date and time that the session was recorded
- - If re-processing a previously recorded session, this value specifies which session to reprocess (must be the name of a folder within the `FreeMoCap_Data` folder)
- -
-- `stage`
- - [Type] - Int
- - [Default] - 1
- - Which processing stage to start from. Processing stages are deined in more detail in [#processing-stages](#processing-stages)
-
- ```
- stage 1 - Record Raw Videos
- stage 2 - Synchronize Videos
- stage 3 - Camera Calibration
- stage 4 - 2d Tracking and 3d Calibration
- stage 5 - Create output files (using Blender)
- stage 6 - Create output animation (Matplotlib)
- ```
-- `useMediaPipe`
- - [Type] - BOOL
- - [Default] - False,
- - Whether or not to use the MediaPipe tracking method in `stage=4`
-
-- `runMediaPipe`
- - [Type] - BOOL
- - [Default] - False,
- - Whether or not to RUN the MediaPipe tracking method in `stage=4` (will use previously processed data. This can save a lot of time when re-processing long videos)
-
-- `useOpenPose`
- - [Type] - BOOL
- - [Default] - False,
- - Whether or not to use the OpenPose tracking method in `stage=4`
-
-- `runOpenPose`
- - [Type] - BOOL
- - [Default] - False,
- - Whether or not to RUN the OpenPose tracking method in `stage=4` (will use previously processed data. This can save a lot of time when re-processing long videos)
-
-- `useDeepLabCut`
- - [Type] - BOOL
- - [Default] - False,
- - Whether or not to use the DeepLabCut model/project specified at `dlcConfigPath` to track objects in `stage=4`
-
-
-- `setDataPath`
- - [Type] - BOOL
- - [Default] - False,
- - Trigger the GUI that prompts user to specify location of `FreeMoCap_Data`
-
-- `userDataPath`
- - [Type] - BOOL
- - [Default] - False,
- - path to the location of `FreeMoCap_Data`
-
-- `recordVid`
- - [Type] - BOOL
- - [Default] - False,
- - wehether to save the matplotlib animation to an `.mp4` file
-
-- `showAnimation`
- - [Type] - BOOL
- - [Default] - False,
- - wehether to save the matplotlib animation to an `.mp4` file
-
-- `reconstructionConfidenceThreshold`
- - [Type] - float in range(0,1),
- - [Default] - .7
- - Threshold 'confidence' value to include a point in the 3d reconstruction step
-
-- `charucoSquareSize`
- - [Type] = int
- - [Default] = 36,
- - The size of a side of a black square in the Charuco board used in this calibration. The default value of 36 is approximately appropriate for a print out on an 8 in bu 10 in paper (US Letter, approx A4)
-
-- `calVideoLength`
- - [Type] = int, float in range (0,1), or [int, int]
- - [Default] = .5,
- - What portion of the videos to use in the Anipose calibration step in `stage=3`. `-1` uses the whole recording, a number between 0 and 1 defines a proprotion of the video to use, and a tuple of two numbers defines the start and end frame
-
-
-- `startFrame`
- - [Type] = int
- - [Default] = 0,
- - what frame of the video to start the animation in `stage=6`
-
-- `useBlender`
- - [Type] = BOOL
- - [Default] = True,
- - Whether to use Blender to create output `.blend`, `.fbx`,`.usd`,and `.gltf` files
-
-- `resetBlenderExe`
- - [Type] = BOOL
- - [Default] = False,
- - Whether to launch GUI to set Blender .exe path (usually something like `C:/Program Files/Blender Foundation/2.95/`)
-
-- `get_synced_unix_timestamps`
- - [Type] = BOOL
- - [Default] = True,
- - Whether to save camera timestamps in `Unix Epoch Time` in addition to the default 'counting up from zero' timestamps. Very helpful for synchronizing FreeMoCap with other softwares
-
-- `good_clean_frame_number`
- - [Type] = int
- - [Default] = 0,
- - A frame where the subject is standing in something like a T-pose or an A-pose, which will be used to scale the armature created via the `useBlender=True` option. If set to default (`0`) the software will attempt to locate this frame automatically by looking for a frame where all markers are visible with high `confidence` values (but this is buggy)
-
-- `bundle_adjust_3d_points` [EXPERIMENTAL as of May 2022]
- - [Type] = BOOL
- - [Default] = False,
- - When set to `True`, the system will run a bundle adjust optimization of all recorded 3d points produced in `stage=4` using `aniposelib`'s `optim_points` method. This takes a rather long time, but can signicantly clean up the resulting recordings. However,it may also "over smooth" the data. We're in the process of testing this method out now
-
-- `use_previous_calibration`
- - [Type] = BOOL
- - [Default] = False,
- - Choose whether to use a calibration file from a previous session. When `False`, FreeMoCap will automatically save out calibration data whenever stage 3 is successfully completed. Only one saved calibration file is stored, so running another session will overwrite the currently saved calibration file. When `True` , FreeMoCap will instead load in the saved calibration data, which allows users to create recordings without needing to show the cameras the Charuco board.
+## API
-____
-____
-## Charuco Board Information
-___
- * Our calibration method relies on [Anipose](https://anipose.org)'s [Charuco-based](https://docs.opencv.org/3.4/df/d4a/tutorial_charuco_detection.html) calibration method to determine the location of each camera during a recording session. This information is later used to create the 3d reconstruction of the tracked points
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin vulputate leo elit, id pharetra urna hendrerit nec. Integer hendrerit turpis sapien, vel scelerisque risus fringilla ac.
- * IMPORTANT The Charuco board shown to the camera MUST be generated with the `cv2.aruco.DICT_4X4_250` dictionary!
-
- * Ah high resoultion `png` of this Charuco board is in this repository at `/charuco_board_image_highRes.png`
-*
- * To generate your own board, use the following python commands (or equivalent). DO NOT CHANGE THE PARAMETERS OR THE CALIBRATION WILL NOT WORK:
- ``` python
- import cv2
-
- aruco_dict = cv2.aruco.Dictionary_get(cv2.aruco.DICT_4X4_250) #note `cv2.aruco` can be installed via `pip install opencv-contrib-python`
-
- board = cv2.aruco.CharucoBoard_create(7, 5, 1, .8, aruco_dict)
-
- charuco_board_image = board.draw((2000,2000)) #`2000` is the resolution of the resulting image. Increase this number if printing a large board (bigger is better! Esp for large spaces!
-
- cv2.imwrite('charuco_board_image.png',charuco_board_image)
-
- ```
+### `lorem(ipsum)`
-# **Optional**
+Type: `type`
-Both [Deeplabcut](https://deeplabcut.org) and [OpenPose](https://github.com/CMU-Perceptual-Computing-Lab/openpose) are technically supported, but both are rather under-tested at the moment.
+Returns: `type`
-* To use DeepLabCut, install with set `freemocap.RunMe(useDLC=True)`
- * Installation instructions for DeepLabCut may be found on their github - https://github.com/DeepLabCut/DeepLabCut
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin vulputate leo elit, id pharetra urna hendrerit nec.
-* If you would like to use OpenPose for body tracking, install Cuda and the Windows Portable Demo of OpenPose and set `freemocap.RunMe(useOpenPose=True)`.
- * Install CUDA: https://developer.nvidia.com/cuda-downloads
+#### `ipsum`
- * Install OpenPose (Windows Portable Demo): https://github.com/CMU-Perceptual-Computing-Lab/openpose/releases/tag/v1.6.0
+Type: `type`
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin vulputate leo elit, id pharetra urna hendrerit nec.
+## Related
+* [project-name](#) - Project description
-Follow the GitHub Repository and/or Join the Discord (https://discord.gg/HX7MTprYsK) for updates!
+## Maintainers
-# Stay Tuned for more soon!
+* [Jamie Weavis](https://github.com/jamieweavis)
+## License
-βœ¨πŸ’€βœ¨
+This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.
\ No newline at end of file
diff --git a/logo/fmc-logo-black-border-white-bkgd.png b/assets/logo/fmc-logo-black-border-white-bkgd.png
similarity index 100%
rename from logo/fmc-logo-black-border-white-bkgd.png
rename to assets/logo/fmc-logo-black-border-white-bkgd.png
diff --git a/logo/freemocap-logo-black-border.svg b/assets/logo/freemocap-logo-black-border.svg
similarity index 100%
rename from logo/freemocap-logo-black-border.svg
rename to assets/logo/freemocap-logo-black-border.svg
diff --git a/logo/freemocap-logo-white-border.png b/assets/logo/freemocap-logo-white-border.png
similarity index 100%
rename from logo/freemocap-logo-white-border.png
rename to assets/logo/freemocap-logo-white-border.png
diff --git a/src/cameras/save_synchronized_videos.py b/src/cameras/save_synchronized_videos.py
index 0589603f..8231699d 100644
--- a/src/cameras/save_synchronized_videos.py
+++ b/src/cameras/save_synchronized_videos.py
@@ -5,7 +5,7 @@ from matplotlib import pyplot as plt
from src.cameras.capture.dataclasses.frame_payload import FramePayload
from src.cameras.persistence.video_writer.video_recorder import VideoRecorder
-from src.freemocap_qt_gui.refactored_gui.state.app_state import APP_STATE
+from src.gui.main.state.app_state import APP_STATE
def save_synchronized_videos(list_of_video_recorders:List[VideoRecorder], calibration_videos:bool=False, mocap_videos:bool=False):
@@ -65,9 +65,6 @@ def save_synchronized_videos(list_of_video_recorders:List[VideoRecorder], calibr
print(f" (clipped) number_of_frames_per_camera: {number_of_frames_per_camera_clipped}, min:{min_number_of_frames}")
-
-
-
if mocap_videos:
APP_STATE.number_of_frames_in_the_mocap_videos = number_of_frames_per_camera
diff --git a/src/core_processor/mediapipe_skeleton_detector/mediapipe_skeleton_detector.py b/src/core_processor/mediapipe_skeleton_detector/mediapipe_skeleton_detector.py
index d971aaf9..5c3080dc 100644
--- a/src/core_processor/mediapipe_skeleton_detector/mediapipe_skeleton_detector.py
+++ b/src/core_processor/mediapipe_skeleton_detector/mediapipe_skeleton_detector.py
@@ -13,7 +13,7 @@ from src.config.home_dir import get_session_folder_path, get_synchronized_videos
get_session_output_data_folder_path
from src.core_processor.mediapipe_skeleton_detector.medaipipe_tracked_points_names_dict import \
mediapipe_tracked_point_names_dict
-from src.freemocap_qt_gui.refactored_gui.state.app_state import APP_STATE
+from src.gui.main.state.app_state import APP_STATE
logger = logging.getLogger(__name__)
diff --git a/src/freemocap_qt_gui/freemocap_qt_gui.py b/src/freemocap_qt_gui/freemocap_qt_gui.py
deleted file mode 100644
index b90abe5b..00000000
--- a/src/freemocap_qt_gui/freemocap_qt_gui.py
+++ /dev/null
@@ -1,326 +0,0 @@
-import logging
-from contextlib import contextmanager
-from typing import Dict
-
-import asyncio
-import numpy as np
-from PyQt5.QtCore import Qt
-from PyQt5.QtGui import QPixmap, QFont
-from PyQt5.QtWidgets import QLineEdit, QFormLayout, QWidget, QVBoxLayout, QPushButton
-from pyqtgraph.dockarea.DockArea import DockArea
-from pyqtgraph.dockarea.Dock import Dock
-
-from pyqtgraph.Qt import QtWidgets
-import pyqtgraph as pg
-from pyqtgraph.parametertree import ParameterTree, Parameter
-
-from rich import print
-
-from src.api.routes.session.session_router import SessionCalibrateModel, calibrate_session, record_session, \
- SessionIdModel
-from src.cameras.detection.cam_singleton import get_or_create_cams
-from src.cameras.multicam_manager.cv_camera_manager import OpenCVCameraManager
-from src.cameras.launch_camera_frame_loop import launch_camera_frame_loop
-from src.config.home_dir import create_session_id
-from src.config.webcam_config import WebcamConfig, webcam_config_to_qt_parameter_list
-from src.pipelines.calibration_pipeline.calibration_pipeline_orchestrator import CalibrationPipelineOrchestrator
-
-logger = logging.getLogger(__name__)
-
-default_webcam_config = WebcamConfig()
-
-
-class MainWindow(QWidget):
- def __init__(self):
- super().__init__()
-
- def closeEvent(self, QCloseEvent):
- self.shut_it_down = True
-
-
-class FreemocapQtGUI:
- def __init__(self):
- self._camera_view_docks_dict = {}
- self._camera_view_update_functions_dict = {}
- self._camera_qt_image_items_dict = {}
- self.pyqtgraph_app = pg.mkQApp('freemocap pyqtgraph app! :D')
- self._session_id = None
- self._shut_it_down = False
- self.gui_update_number = -1
- self._dictionary_of_available_webcam_configs = {}
- self._available_cameras_data_tree_widget = None
- self._have_calibration_bool = False
- self._shut_it_down = False
- self._opencv_camera_manager = None
- self._setup_and_launch()
-
- def shut_it_down(self):
- if self._opencv_camera_manager is not None:
- self._opencv_camera_manager.close()
- self._main_window_widget.close()
- return self._shut_it_down
-
- @property
- def session_id(self):
- return self._session_id
-
- @property
- def is_running(self):
- return not self._shut_it_down
-
- def run(self):
- logger.info('launching freemocap GUI')
- self._setup_and_launch()
-
- def update(self):
- self.gui_update_number += 1
- if self.gui_update_number % 1000:
- print(f"gui update number: {self.gui_update_number})")
-
- def _setup_and_launch(self):
- self._setup_main_window()
- self._setup_welcome_panel()
- self._main_window_widget.show()
-
- def _setup_main_window(self, window_width: int = 400, window_height: int = 1):
- """
- This is the main main window for the GUI.
- Its structure is based loosely on the 'Dock Widgets' example from `python -m pyqtgraph.examples`
- """
- self._main_window_width = window_width
- self._main_window_height = window_height
-
- self._main_window_widget = QtWidgets.QMainWindow()
- self._main_window_widget.resize(self._main_window_width, self._main_window_height)
-
- self._main_dock_area = DockArea()
- self._main_window_widget.setCentralWidget(self._main_dock_area)
- self._main_window_widget.setWindowTitle('freemocap πŸ’€βœ¨')
-
- def _setup_welcome_panel(self):
- self._welcome_panel_dock = Dock("freemocap", size=(1, 1))
- self._welcome_panel_layout_widget = pg.LayoutWidget()
- self._welcome_panel_dock.addWidget(self._welcome_panel_layout_widget)
- self._main_dock_area.addDock(self._welcome_panel_dock, size=(1, 1))
-
- welcome_label = QtWidgets.QLabel("Welcome to Freemocap πŸ’€βœ¨")
- self._welcome_panel_layout_widget.addWidget(welcome_label, row='next')
-
- session_id_layout = QFormLayout()
- self.session_id_line_edit = QLineEdit(create_session_id())
- session_id_layout.addRow("session_id: ", self.session_id_line_edit)
- session_id_widget = QWidget()
- session_id_widget.setLayout(session_id_layout)
- self._welcome_panel_layout_widget.addWidget(session_id_widget, row='next')
-
- self._start_button_text = 'Start new session'
- self._pointing_arrow_emoji = " ⬅️⬅️ "
- self._start_button = QtWidgets.QPushButton(self._start_button_text + self._pointing_arrow_emoji)
- self._start_button.setEnabled(True)
- self._start_button.clicked.connect(self._start)
-
- self._welcome_panel_layout_widget.addWidget(self._start_button, row='next')
-
- self._shut_down_button = QtWidgets.QPushButton('Shut it down! πŸ¦•')
- # self._shut_down_button.hide()
- self._shut_down_button.setEnabled(True)
- self._shut_down_button.clicked.connect(self.shut_it_down)
-
- self._welcome_panel_layout_widget.addWidget(self._shut_down_button, row='next')
-
- def _create_setup_control_panel(self):
-
- # self._main_window_width += 100
- self._main_window_height = 500
- self._main_window_widget.resize(self._main_window_width, self._main_window_height)
-
- self._setup_panel_dock = Dock("Setup πŸ› οΈ")
- self._setup_panel_layout_widget = pg.LayoutWidget()
- self._setup_panel_dock.addWidget(self._setup_panel_layout_widget)
- self._main_dock_area.addDock(self._setup_panel_dock,
- 'bottom',
- self._welcome_panel_dock)
- self._detect_available_cameras_text = 'Detect Available Cameras πŸ”ŽπŸŽ₯'
- self._detect_cameras_button = QtWidgets.QPushButton(
- self._detect_available_cameras_text + self._pointing_arrow_emoji)
- self._detect_cameras_button.setEnabled(True)
- self._detect_cameras_button.clicked.connect(self._detect_available_cameras)
- self._setup_panel_layout_widget.addWidget(self._detect_cameras_button)
-
- self.hint_label = QtWidgets.QLabel("HINT - Keep an eye on your `terminal` for helpful `log` statements ;D")
- self.hint_label.hide()
- self._setup_panel_layout_widget.addWidget(self.hint_label, row=1, col=0)
-
- self._connect_to_cameras_button_text = 'Connect to cameras πŸŽ₯ ✨'
- self._connect_to_cameras_button = QtWidgets.QPushButton(self._connect_to_cameras_button_text)
- self._connect_to_cameras_button.setEnabled(True)
- self._connect_to_cameras_button.clicked.connect(self._connect_to_cameras)
- self._connect_to_cameras_button.hide()
- self._setup_panel_layout_widget.addWidget(self._connect_to_cameras_button, row=0, col=1)
-
- self._calibrate_cameras_button_text = 'Record Camera Calibration Videos πŸŽ₯ πŸ“'
- self._calibrate_cameras_button = QtWidgets.QPushButton(self._calibrate_cameras_button_text)
- self._calibrate_cameras_button.setEnabled(True)
- self._calibrate_cameras_button.clicked.connect(self._record_calibration_videos)
- self._calibrate_cameras_button.hide()
- self._setup_panel_layout_widget.addWidget(self._calibrate_cameras_button, row=1, col=1)
-
- # self._use_previous_calibration_checkbox = QtWidgets.QCheckBox("Use Previous Calibration πŸŽ₯ ⏳")
- # self._use_previous_calibration_checkbox.setChecked(False)
- # self._use_previous_calibration_checkbox.stateChanged.connect(self._check_if_have_calibration)
- # self._use_previous_calibration_checkbox.hide()
- # self._setup_panel_layout_widget.addWidget(self._use_previous_calibration_checkbox, row=1, col=1)
- #
- # self._launch_camera_windows_button = QtWidgets.QPushButton('(broken)Record freemocap session πŸŽ₯ πŸ’€')
- # self._launch_camera_windows_button.setEnabled(True)
- # self._launch_camera_windows_button.clicked.connect(self._launch_camera_windows)
- # self._launch_camera_windows_button.hide()
- # self._setup_panel_layout_widget.addWidget(self._launch_camera_windows_button, row=2, col=1)
-
- def _start(self):
- logger.debug('start button pressed')
- self._start_button.setText(self._start_button_text)
-
- self._shut_down_button.show()
-
- self._lock_in_session_id(self.session_id_line_edit.text())
- # self._start_button.setText("Reset πŸ’«")
- # self._start_button.hide()
- self._start_button.setEnabled(False)
- self._create_setup_control_panel()
-
- def _launch_camera_windows(self):
- logger.debug("`launch camera windows` button pressed")
- session_id_model = SessionIdModel(session_id=self.session_id)
- # record new session\
- record_session(session_id_model)
-
- def _detect_available_cameras(self):
- logger.debug("`Detect Available Cameras` button was pressed")
- self.hint_label.show()
- self._detect_cameras_button.setText("Detecting available cameras....")
- self.pyqtgraph_app.processEvents()
-
- self._opencv_camera_manager = OpenCVCameraManager(self.session_id)
- self._dictionary_of_available_webcam_configs = self._opencv_camera_manager.get_available_cameras()
-
- logger.debug(
- f"`get_or_create_cams()` returned:_available_cameras_dictionary {self._dictionary_of_available_webcam_configs}")
- self._detect_cameras_button.setText('Re-Detect Available Cameras πŸ”ŽπŸŽ₯')
- self.hint_label.hide()
-
- if self._available_cameras_data_tree_widget is None:
- self.camera_setup_parameter_tree_widget = ParameterTree()
- self._setup_panel_layout_widget.addWidget(self.camera_setup_parameter_tree_widget, col=0, row=1)
-
- self._update_webcam_config_parameter_tree(self._dictionary_of_available_webcam_configs)
- self._main_window_width *= 1.618
- self._main_window_widget.resize(int(self._main_window_width), int(self._main_window_height))
-
- self._connect_to_cameras_button.setText(self._connect_to_cameras_button_text + self._pointing_arrow_emoji)
- self._connect_to_cameras_button.show()
-
- # self._launch_camera_windows_button.show()
-
- def _connect_to_cameras(self):
- logger.debug("`connect to cameras` button was pressed")
- self._main_window_width = self._main_window_width * 2
- # self._main_window_height
- self._main_window_widget.resize(int(self._main_window_width), int(self._main_window_height))
-
- self._dictionary_of_camera_qt_image_items = self._create_camera_view_docks(
- self._dictionary_of_available_webcam_configs)
- self.pyqtgraph_app.processEvents()
-
- self._connect_to_cameras_button.setEnabled(False)
- self._connect_to_cameras_button.setText(self._connect_to_cameras_button_text)
- self._calibrate_cameras_button.setText(self._calibrate_cameras_button_text + self._pointing_arrow_emoji)
- self._calibrate_cameras_button.show()
-
- self._record_frames = False
- launch_camera_frame_loop(session_id=self.session_id,
- webcam_configs_dict=self._dictionary_of_available_webcam_configs,
- opencv_camera_manager=self._opencv_camera_manager,
- camera_view_update_function=self.update_camera_view_image,
- # update_gui_function=self.pyqtgraph_app.processEvents,
- record_frames_bool=self._record_frames)
-
- # self._use_previous_calibration_checkbox.show()
-
- def _create_camera_view_docks(self, dictionary_of_available_webcams) -> Dict:
- pg.setConfigOptions(imageAxisOrder='row-major') # set this so camera images aren't rotated
- dictionary_of_camera_qt_image_items = {}
- for this_webcam_id in dictionary_of_available_webcams.keys():
- dictionary_of_camera_qt_image_items[this_webcam_id] = self._setup_camera_view_dock(this_webcam_id)
-
- return dictionary_of_camera_qt_image_items
-
- def _setup_camera_view_dock(self, webcam_id: str) -> pg.ImageItem:
- self._camera_view_docks_dict[webcam_id] = Dock(f'webcam_id: {webcam_id}')
- this_camera_layout_widget = pg.GraphicsLayoutWidget()
- this_camera_view_box = pg.ViewBox(invertY=True, lockAspect=True)
- this_camera_qt_image_item = pg.ImageItem()
- this_camera_view_box.addItem(this_camera_qt_image_item)
- this_camera_layout_widget.addItem(this_camera_view_box)
- self._camera_view_docks_dict[webcam_id].addWidget(this_camera_layout_widget)
- self._main_dock_area.addDock(self._camera_view_docks_dict[webcam_id], 'right')
- return this_camera_qt_image_item
-
- def update_camera_view_image(self, webcam_id: str, image_to_display: np.ndarray):
- try:
- camera_image_item_widget = self._dictionary_of_camera_qt_image_items[webcam_id]
- except Exception as e:
- logger.warning(f'Could not find ViewBoxWidget for camera {webcam_id}')
- raise e
-
- camera_image_item_widget.setImage(image_to_display, )
-
- def _record_calibration_videos(self):
- logger.debug("`launch camera windows` button pressed")
-
- if not self._record_frames:
- self._record_frames = True
- self._calibrate_cameras_button.setText("Recording.... πŸ”΄")
- # #calibrate_session
- # session_calibrate_model = SessionCalibrateModel(session_id=self._session_id,
- # webcam_configs_dict=self._dictionary_of_available_webcam_configs,
- # # opencv_camera_manager=self._opencv_camera_manager,
- # charuco_square_size=39)
- # calibrate_session(session_calibrate_model)
- else:
- self._record_frames = False
- calibration_orchestrator = CalibrationPipelineOrchestrator(session_id=self.session_id)
-
- calibration_orchestrator.run_anipose_camera_calibration(
- charuco_square_size=39,
- pin_camera_0_to_origin=True)
-
- def _update_webcam_config_parameter_tree(self,
- dictionary_of_available_webcams: Dict[str, WebcamConfig]):
- list_of_webcam_parameters_groups = []
- for this_webcam_id, this_webcam_config in dictionary_of_available_webcams.items():
- this_webcam_parameters_list = webcam_config_to_qt_parameter_list(this_webcam_config)
-
- list_of_webcam_parameters_groups.append(Parameter.create(name=f"Webcam: {this_webcam_id}", type='group',
- children=this_webcam_parameters_list))
-
- available_webcam_parameters_group = Parameter.create(name=f"Available Cameras", type='group',
- children=list_of_webcam_parameters_groups)
-
- self.camera_setup_parameter_tree_widget.setParameters(available_webcam_parameters_group)
-
- def _lock_in_session_id(self, session_id: str):
- self._session_id = session_id
- self.session_id_line_edit.setReadOnly(True)
- self.session_id_line_edit.setStyleSheet("QLineEdit"
- "{"
- "background : lightgrey;"
- "}")
-
- def _reset(self):
- print('i dont know how to reset things lol')
-
-
-if __name__ == "__main__":
- gui = FreemocapQtGUI()
- pg.exec()
diff --git a/src/freemocap_qt_gui/refactored_gui/app.py b/src/freemocap_qt_gui/refactored_gui/app.py
deleted file mode 100644
index 26ec678c..00000000
--- a/src/freemocap_qt_gui/refactored_gui/app.py
+++ /dev/null
@@ -1,11 +0,0 @@
-from pyqtgraph import mkQApp
-
-APP = None
-
-
-def get_qt_app():
- global APP
- if APP is None:
- APP = mkQApp()
-
- return APP
diff --git a/src/freemocap_qt_gui/refactored_gui/layout/control_panel.py b/src/freemocap_qt_gui/refactored_gui/layout/control_panel.py
deleted file mode 100644
index 9a4dcf08..00000000
--- a/src/freemocap_qt_gui/refactored_gui/layout/control_panel.py
+++ /dev/null
@@ -1,146 +0,0 @@
-import logging
-from time import sleep
-from typing import Dict
-
-from PyQt6.QtCore import QThread
-from PyQt6.QtWidgets import QLabel, QPushButton
-from pyqtgraph import LayoutWidget
-from pyqtgraph.dockarea import Dock
-from pyqtgraph.parametertree import Parameter, ParameterTree
-
-from src.cameras.multicam_manager.cv_camera_manager import OpenCVCameraManager
-from src.config.webcam_config import WebcamConfig, webcam_config_to_qt_parameter_list
-from src.freemocap_qt_gui.refactored_gui.app import get_qt_app
-from src.freemocap_qt_gui.refactored_gui.state.app_state import APP_STATE
-from src.freemocap_qt_gui.refactored_gui.workers.cam_detection_thread import CamDetectionWorker
-
-detect_camera_text = 'Detect Available Cameras πŸ”ŽπŸŽ₯'
-
-logger = logging.getLogger(__name__)
-
-
-class ControlPanel(Dock):
- def __init__(self, main_dock_area, name="Setup πŸ› οΈ"):
- super().__init__(name)
- # self._main_window_width += 100
- # self._main_window_height = 500
- # self._main_window_widget.resize(self._main_window_width, self._main_window_height)
- main_dock_area.addDock(self, 'bottom')
-
- self._setup_panel_layout_widget = self._create_basic_layout()
-
- self._detect_cameras_button = self._setup_detect_camera()
- self._hint_label = self._create_hint_label()
- self._connect_to_cameras_button = self._create_connect_to_cameras_button()
- self._calibrate_cameras_button = self._create_camera_calibrate_button()
- self._launch_camera_windows_button = self._launch_cam_window_button()
- self.pyqtgraph_app = get_qt_app()
- self._available_cameras_data_tree_widget = None
-
- def _create_basic_layout(self):
- layout_widget = LayoutWidget()
- self.addWidget(layout_widget)
- return layout_widget
-
- def _launch_cam_window_button(self):
- launch_cam_window_button = QPushButton(
- '(broken)Record freemocap session πŸŽ₯ πŸ’€'
- )
- launch_cam_window_button.setEnabled(True)
- # launch_cam_window_button.clicked.connect(self._launch_camera_windows)
- launch_cam_window_button.hide()
- self._setup_panel_layout_widget.addWidget(launch_cam_window_button, row=2, col=1)
- return launch_cam_window_button
-
- def _create_camera_calibrate_button(self):
- cam_button = QPushButton(
- '(wip) Record Camera Calibration Videos πŸŽ₯ πŸ“'
- )
- cam_button.setEnabled(True)
- # cam_button.clicked.connect(self._record_calibration_videos)
- cam_button.hide()
- self._setup_panel_layout_widget.addWidget(cam_button, row=1, col=1)
- return cam_button
-
- def _create_connect_to_cameras_button(self):
- connect_text = 'Connect to cameras πŸŽ₯ ✨'
- connect_cam_button = QPushButton(connect_text)
- connect_cam_button.setEnabled(True)
- # connect_cam_button.clicked.connect(self._connect_to_cameras)
- connect_cam_button.hide()
- self._setup_panel_layout_widget.addWidget(connect_cam_button, row=0, col=1)
- return connect_cam_button
-
- def _create_hint_label(self):
- hint_label = QLabel(
- "HINT - Keep an eye on your `terminal` for helpful `log` statements ;D")
- hint_label.hide()
- self._setup_panel_layout_widget.addWidget(hint_label, row=1, col=0)
- return hint_label
-
- def _setup_detect_camera(self):
- detect_cam_button = QPushButton(detect_camera_text)
- detect_cam_button.setEnabled(True)
- detect_cam_button.clicked.connect(self._handle_detect_click)
- self._setup_panel_layout_widget.addWidget(detect_cam_button)
- return detect_cam_button
-
- def _handle_detect_click(self):
- logger.debug("`Detect Available Cameras` button was pressed")
- self._hint_label.show()
- self._detect_cameras_button.setText("Detecting available cameras....")
- # self.pyqtgraph_app.processEvents()
- thread = QThread()
- worker = CamDetectionWorker()
- worker.moveToThread(thread)
-
- thread.started.connect(worker.run)
- worker.finished.connect(thread.quit)
- worker.finished.connect(worker.deleteLater)
- worker.finished.connect(thread.deleteLater)
- thread.start()
- while thread.quit:
- sleep(1)
- print("Thread is running....")
- current_session_id = APP_STATE.session_id
- self._opencv_camera_manager = OpenCVCameraManager(current_session_id)
- webcam_configs = self._opencv_camera_manager.get_available_cameras()
-
- self._detect_cameras_button.setText('Re-Detect Available Cameras πŸ”ŽπŸŽ₯')
- self._hint_label.hide()
-
- if self._available_cameras_data_tree_widget is None:
- self.camera_setup_parameter_tree_widget = ParameterTree()
- self._setup_panel_layout_widget.addWidget(self.camera_setup_parameter_tree_widget,
- col=0, row=1)
-
- self._update_webcam_config_parameter_tree(webcam_configs)
- # self._main_window_width *= 1.618
- # self._main_window_widget.resize(int(self._main_window_width),
- # int(self._main_window_height))
- self._connect_to_cameras_button.show()
- # self._calibrate_cameras_button.show()
-
- # self._launch_camera_windows_button.show()
-
- # self._use_previous_calibration_checkbox.show()
-
- def _update_webcam_config_parameter_tree(self, webcams: Dict[str, WebcamConfig]):
- webcam_param_group = []
- for webcam_id, webcam_cfg in webcams.items():
- param_list = webcam_config_to_qt_parameter_list(webcam_cfg)
-
- webcam_param_group.append(
- Parameter.create(
- name=f"Webcam: {webcam_id}",
- type='group',
- children=param_list)
- )
-
- available_webcam_parameters_group = Parameter.create(
- name=f"Available Cameras",
- type='group',
- children=webcam_param_group
- )
-
- self.camera_setup_parameter_tree_widget.setParameters(available_webcam_parameters_group)
diff --git a/src/freemocap_qt_gui/refactored_gui/layout/main_window.py b/src/freemocap_qt_gui/refactored_gui/layout/main_window.py
deleted file mode 100644
index 342a360f..00000000
--- a/src/freemocap_qt_gui/refactored_gui/layout/main_window.py
+++ /dev/null
@@ -1,23 +0,0 @@
-from PyQt6.QtWidgets import QMainWindow
-from pyqtgraph.dockarea import DockArea
-
-from src.freemocap_qt_gui.refactored_gui.layout.welcome_panel import WelcomePanel
-
-
-class MainWindow(QMainWindow):
- def __init__(self, window_width: int = 300, window_height: int = 1):
- """
- This is the main window for the GUI.
- Its structure is based loosely on the 'Dock Widgets' example from `python -m
- pyqtgraph.examples`
- """
- super().__init__()
- self.resize(window_width, window_height)
- self.setWindowTitle('freemocap πŸ’€βœ¨')
-
- main_dock_area = DockArea()
- self.setCentralWidget(main_dock_area)
-
- # Adding components to the window
- self._panel = WelcomePanel(main_dock_area)
-
diff --git a/src/freemocap_qt_gui/refactored_gui/layout/welcome_panel.py b/src/freemocap_qt_gui/refactored_gui/layout/welcome_panel.py
deleted file mode 100644
index 92d5ecf2..00000000
--- a/src/freemocap_qt_gui/refactored_gui/layout/welcome_panel.py
+++ /dev/null
@@ -1,82 +0,0 @@
-import logging
-
-import pyqtgraph as pg
-from PyQt6.QtWidgets import QFormLayout, QLabel, QLineEdit, QPushButton, QWidget
-from pyqtgraph.dockarea import Dock
-
-from src.config.home_dir import create_session_id
-from src.freemocap_qt_gui.refactored_gui.layout.control_panel import ControlPanel
-from src.freemocap_qt_gui.refactored_gui.state.app_state import APP_STATE
-
-logger = logging.getLogger(__name__)
-
-start_button_text = 'Start new session'
-
-
-class WelcomePanel(Dock):
- def __init__(self, main_dock_area, name="init"):
- super().__init__(name)
- self._main_dock_area = main_dock_area
- self.setStretch(1, 1)
- self._welcome_panel_layout_widget = pg.LayoutWidget()
- self.addWidget(self._welcome_panel_layout_widget)
- main_dock_area.addDock(self, size=(1, 1))
- self.create_welcome_label()
- self._session_id_line_edit = self.add_session_id_input()
- self._start_button = self.add_start_button()
- self._shutdown_button = self.add_shutdown_button()
-
- def create_welcome_label(self):
- welcome_label = QLabel("Welcome to Freemocap πŸ’€βœ¨")
- self._welcome_panel_layout_widget.addWidget(welcome_label, row='next')
-
- def add_session_id_input(self):
- session_id_layout = QFormLayout()
- session_id_line_edit = QLineEdit(create_session_id())
- session_id_layout.addRow("Session ID: ", session_id_line_edit)
- session_id_widget = QWidget()
- session_id_widget.setLayout(session_id_layout)
- self._welcome_panel_layout_widget.addWidget(session_id_widget, row='next')
- return session_id_line_edit
-
- def add_start_button(self):
- start_button = QPushButton('Start new session')
- start_button.setEnabled(True)
- start_button.clicked.connect(self._handle_start_click)
- self._welcome_panel_layout_widget.addWidget(start_button, row='next')
- return start_button
-
- def _handle_start_click(self):
- logger.debug('start button pressed')
- self._start_button.text = start_button_text
-
- self._shutdown_button.show()
-
- self._save_session_id(self._session_id_line_edit.text())
- self._start_button.setText("Reset πŸ’«")
- self._start_button.hide()
- self._create_setup_control_panel()
-
- def add_shutdown_button(self):
- shut_down_button = QPushButton('Shut it down! πŸ¦•')
- shut_down_button.hide()
- shut_down_button.setEnabled(True)
- shut_down_button.clicked.connect(self._handle_shutdown_button)
- self._welcome_panel_layout_widget.addWidget(shut_down_button, row='next')
- return shut_down_button
-
- def _handle_shutdown_button(self):
- print("shutdown was clicked")
-
- def _save_session_id(self, session_id: str):
- APP_STATE.session_id = session_id
-
- def _set_line_edit_to_readonly(self):
- self._session_id_line_edit.setReadOnly(True)
- self._session_id_line_edit.setStyleSheet("QLineEdit"
- "{"
- "background : lightgrey;"
- "}")
-
- def _create_setup_control_panel(self):
- control_panel = ControlPanel(self._main_dock_area)
diff --git a/src/freemocap_qt_gui/refactored_gui/main.py b/src/freemocap_qt_gui/refactored_gui/main.py
deleted file mode 100644
index a12d57d1..00000000
--- a/src/freemocap_qt_gui/refactored_gui/main.py
+++ /dev/null
@@ -1,24 +0,0 @@
-import signal
-import sys
-
-from PyQt6.QtCore import QTimer
-from PyQt6.QtWidgets import QApplication
-
-from src.freemocap_qt_gui.refactored_gui.app import get_qt_app
-from src.freemocap_qt_gui.refactored_gui.layout.main_window import MainWindow
-
-
-def sigint_handler(*args):
- """Handler for the SIGINT signal."""
- QApplication.quit()
-
-
-if __name__ == "__main__":
- signal.signal(signal.SIGINT, sigint_handler)
- app = get_qt_app()
- timer = QTimer()
- timer.start(500)
- timer.timeout.connect(lambda: None) # Let the interpreter run each 500 ms.
- win = MainWindow()
- win.show()
- sys.exit(app.exec())
diff --git a/src/freemocap_qt_gui/refactored_gui/state/__init__.py b/src/freemocap_qt_gui/refactored_gui/state/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/src/freemocap_qt_gui/refactored_gui/workers/__init__.py b/src/freemocap_qt_gui/refactored_gui/workers/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/src/freemocap_qt_gui/__init__.py b/src/gui/__init__.py
similarity index 100%
rename from src/freemocap_qt_gui/__init__.py
rename to src/gui/__init__.py
diff --git a/src/freemocap_qt_gui/examples/main.py b/src/gui/examples/main.py
similarity index 100%
rename from src/freemocap_qt_gui/examples/main.py
rename to src/gui/examples/main.py
diff --git a/src/freemocap_qt_gui/conference/__init__.py b/src/gui/main/__init__.py
similarity index 100%
rename from src/freemocap_qt_gui/conference/__init__.py
rename to src/gui/main/__init__.py
diff --git a/src/freemocap_qt_gui/conference/app.py b/src/gui/main/app.py
similarity index 100%
rename from src/freemocap_qt_gui/conference/app.py
rename to src/gui/main/app.py
diff --git a/src/freemocap_qt_gui/conference/layout/main_window.py b/src/gui/main/layout/main_window.py
similarity index 84%
rename from src/freemocap_qt_gui/conference/layout/main_window.py
rename to src/gui/main/layout/main_window.py
index 17bf798e..33780a7e 100644
--- a/src/freemocap_qt_gui/conference/layout/main_window.py
+++ b/src/gui/main/layout/main_window.py
@@ -3,17 +3,17 @@ from PyQt6.QtGui import QAction
from PyQt6.QtWidgets import QMainWindow, QMenuBar, QVBoxLayout, \
QWidget, QCheckBox
-from src.freemocap_qt_gui.conference.app import get_qt_app
-from src.freemocap_qt_gui.conference.qt_utils.clear_layout import clearLayout
-from src.freemocap_qt_gui.conference.workflows.calibration_instructions import \
+from src.gui.main.app import get_qt_app
+from src.gui.main.qt_utils.clear_layout import clearLayout
+from src.gui.main.state.app_state import APP_STATE
+from src.gui.main.workflows.calibration_instructions import \
CalibrationInstructions
-from src.freemocap_qt_gui.conference.workflows.camera_configuration import CameraConfiguration
-from src.freemocap_qt_gui.conference.workflows.new_recording_session import \
+from src.gui.main.workflows.camera_configuration import CameraConfiguration
+from src.gui.main.workflows.new_recording_session import \
NewRecordingSession
-from src.freemocap_qt_gui.conference.workflows.record_videos import RecordVideos
-from src.freemocap_qt_gui.conference.workflows.show_cams_charuco import ShowCamsCharuco
-from src.freemocap_qt_gui.conference.workflows.welcome import Welcome
-from src.freemocap_qt_gui.refactored_gui.state.app_state import APP_STATE
+from src.gui.main.workflows.record_videos import RecordVideos
+from src.gui.main.workflows.show_cams_charuco import ShowCamsCharuco
+from src.gui.main.workflows.welcome import Welcome
class MainWindow(QMainWindow):
diff --git a/src/freemocap_qt_gui/conference/main.py b/src/gui/main/main.py
similarity index 81%
rename from src/freemocap_qt_gui/conference/main.py
rename to src/gui/main/main.py
index 9bbd9801..a5c6067b 100644
--- a/src/freemocap_qt_gui/conference/main.py
+++ b/src/gui/main/main.py
@@ -5,8 +5,8 @@ from PyQt6.QtCore import QTimer
from PyQt6.QtWidgets import QApplication
# from src.api.routes.session.session_router import visualize_session_offline
-from src.freemocap_qt_gui.conference.layout.main_window import MainWindow
-from src.freemocap_qt_gui.refactored_gui.app import get_qt_app
+from src.gui.main.app import get_qt_app
+from src.gui.main.layout.main_window import MainWindow
def sigint_handler(*args):
diff --git a/src/freemocap_qt_gui/conference/qt_utils/clear_layout.py b/src/gui/main/qt_utils/clear_layout.py
similarity index 100%
rename from src/freemocap_qt_gui/conference/qt_utils/clear_layout.py
rename to src/gui/main/qt_utils/clear_layout.py
diff --git a/src/freemocap_qt_gui/conference/qt_utils/set_font_size.py b/src/gui/main/qt_utils/set_font_size.py
similarity index 100%
rename from src/freemocap_qt_gui/conference/qt_utils/set_font_size.py
rename to src/gui/main/qt_utils/set_font_size.py
diff --git a/src/freemocap_qt_gui/conference/shared_widgets/page_title.py b/src/gui/main/shared_widgets/page_title.py
similarity index 79%
rename from src/freemocap_qt_gui/conference/shared_widgets/page_title.py
rename to src/gui/main/shared_widgets/page_title.py
index 17c4fca8..435cc04a 100644
--- a/src/freemocap_qt_gui/conference/shared_widgets/page_title.py
+++ b/src/gui/main/shared_widgets/page_title.py
@@ -1,7 +1,7 @@
from PyQt6.QtCore import Qt
from PyQt6.QtWidgets import QLabel
-from src.freemocap_qt_gui.conference.qt_utils.set_font_size import set_font_size
+from src.gui.main.qt_utils.set_font_size import set_font_size
class PageTitle(QLabel):
diff --git a/src/freemocap_qt_gui/conference/shared_widgets/primary_button.py b/src/gui/main/shared_widgets/primary_button.py
similarity index 100%
rename from src/freemocap_qt_gui/conference/shared_widgets/primary_button.py
rename to src/gui/main/shared_widgets/primary_button.py
diff --git a/src/freemocap_qt_gui/refactored_gui/__init__.py b/src/gui/main/state/__init__.py
similarity index 100%
rename from src/freemocap_qt_gui/refactored_gui/__init__.py
rename to src/gui/main/state/__init__.py
diff --git a/src/freemocap_qt_gui/refactored_gui/state/app_state.py b/src/gui/main/state/app_state.py
similarity index 100%
rename from src/freemocap_qt_gui/refactored_gui/state/app_state.py
rename to src/gui/main/state/app_state.py
diff --git a/src/freemocap_qt_gui/refactored_gui/layout/__init__.py b/src/gui/main/workers/__init__.py
similarity index 100%
rename from src/freemocap_qt_gui/refactored_gui/layout/__init__.py
rename to src/gui/main/workers/__init__.py
diff --git a/src/freemocap_qt_gui/conference/workers/cam_charuco_frame_worker.py b/src/gui/main/workers/cam_charuco_frame_worker.py
similarity index 97%
rename from src/freemocap_qt_gui/conference/workers/cam_charuco_frame_worker.py
rename to src/gui/main/workers/cam_charuco_frame_worker.py
index 4ffeb0c7..70cf908e 100644
--- a/src/freemocap_qt_gui/conference/workers/cam_charuco_frame_worker.py
+++ b/src/gui/main/workers/cam_charuco_frame_worker.py
@@ -4,7 +4,7 @@ from PyQt6.QtGui import QImage
from src.cameras.capture.opencv_camera.opencv_camera import OpenCVCamera
from src.config.webcam_config import WebcamConfig
-from src.freemocap_qt_gui.refactored_gui.state.app_state import APP_STATE
+from src.gui.main.state.app_state import APP_STATE
from src.pipelines.calibration_pipeline.charuco_board_detection.charuco_board_detector import \
CharucoBoardDetector
diff --git a/src/freemocap_qt_gui/refactored_gui/workers/cam_detection_thread.py b/src/gui/main/workers/cam_detection_thread.py
similarity index 100%
rename from src/freemocap_qt_gui/refactored_gui/workers/cam_detection_thread.py
rename to src/gui/main/workers/cam_detection_thread.py
diff --git a/src/freemocap_qt_gui/conference/workers/cam_frame_worker.py b/src/gui/main/workers/cam_frame_worker.py
similarity index 100%
rename from src/freemocap_qt_gui/conference/workers/cam_frame_worker.py
rename to src/gui/main/workers/cam_frame_worker.py
diff --git a/src/freemocap_qt_gui/conference/workflows/available_camera.py b/src/gui/main/workflows/available_camera.py
similarity index 100%
rename from src/freemocap_qt_gui/conference/workflows/available_camera.py
rename to src/gui/main/workflows/available_camera.py
diff --git a/src/freemocap_qt_gui/conference/workflows/available_cameras_list.py b/src/gui/main/workflows/available_cameras_list.py
similarity index 92%
rename from src/freemocap_qt_gui/conference/workflows/available_cameras_list.py
rename to src/gui/main/workflows/available_cameras_list.py
index 888c1dd1..0bf2f012 100644
--- a/src/freemocap_qt_gui/conference/workflows/available_cameras_list.py
+++ b/src/gui/main/workflows/available_cameras_list.py
@@ -4,9 +4,9 @@ from PyQt6.QtCore import Qt, pyqtSignal
from PyQt6.QtWidgets import QHBoxLayout, QLabel, QPushButton, QVBoxLayout, QWidget
from src.cameras.detection.models import FoundCamerasResponse
-from src.freemocap_qt_gui.conference.qt_utils.clear_layout import clearLayout
-from src.freemocap_qt_gui.conference.workflows.available_camera import AvailableCamera
-from src.freemocap_qt_gui.refactored_gui.workers.cam_detection_thread import CamDetectionWorker
+from src.gui.main.qt_utils.clear_layout import clearLayout
+from src.gui.main.workers.cam_detection_thread import CamDetectionWorker
+from src.gui.main.workflows.available_camera import AvailableCamera
class AvailableCamerasList(QWidget):
diff --git a/src/freemocap_qt_gui/conference/workflows/calibration_instructions.py b/src/gui/main/workflows/calibration_instructions.py
similarity index 89%
rename from src/freemocap_qt_gui/conference/workflows/calibration_instructions.py
rename to src/gui/main/workflows/calibration_instructions.py
index b45eb825..3597e1e3 100644
--- a/src/freemocap_qt_gui/conference/workflows/calibration_instructions.py
+++ b/src/gui/main/workflows/calibration_instructions.py
@@ -1,7 +1,7 @@
from PyQt6.QtWidgets import QHBoxLayout, QLabel, QVBoxLayout, QWidget
-from src.freemocap_qt_gui.conference.shared_widgets.page_title import PageTitle
-from src.freemocap_qt_gui.conference.shared_widgets.primary_button import PrimaryButton
+from src.gui.main.shared_widgets.page_title import PageTitle
+from src.gui.main.shared_widgets.primary_button import PrimaryButton
class CalibrationInstructions(QWidget):
diff --git a/src/freemocap_qt_gui/conference/workflows/camera_configuration.py b/src/gui/main/workflows/camera_configuration.py
similarity index 87%
rename from src/freemocap_qt_gui/conference/workflows/camera_configuration.py
rename to src/gui/main/workflows/camera_configuration.py
index 52d09a39..deb0da83 100644
--- a/src/freemocap_qt_gui/conference/workflows/camera_configuration.py
+++ b/src/gui/main/workflows/camera_configuration.py
@@ -3,12 +3,12 @@ import time
from PyQt6.QtGui import QPixmap
from PyQt6.QtWidgets import QHBoxLayout, QLabel, QPushButton, QVBoxLayout, QWidget
-from src.freemocap_qt_gui.conference.shared_widgets.page_title import PageTitle
-from src.freemocap_qt_gui.conference.shared_widgets.primary_button import PrimaryButton, \
+from src.gui.main.shared_widgets.page_title import PageTitle
+from src.gui.main.shared_widgets.primary_button import PrimaryButton, \
not_active_primary_button_style_sheet, active_primary_button_style_sheet
-from src.freemocap_qt_gui.conference.workers.cam_frame_worker import CamFrameWorker
-from src.freemocap_qt_gui.conference.workflows.available_cameras_list import AvailableCamerasList
-from src.freemocap_qt_gui.refactored_gui.state.app_state import APP_STATE
+from src.gui.main.state.app_state import APP_STATE
+from src.gui.main.workers.cam_frame_worker import CamFrameWorker
+from src.gui.main.workflows.available_cameras_list import AvailableCamerasList
class CameraConfiguration(QWidget):
diff --git a/src/freemocap_qt_gui/conference/workflows/new_recording_session.py b/src/gui/main/workflows/new_recording_session.py
similarity index 90%
rename from src/freemocap_qt_gui/conference/workflows/new_recording_session.py
rename to src/gui/main/workflows/new_recording_session.py
index 5a0c1ed5..1f681848 100644
--- a/src/freemocap_qt_gui/conference/workflows/new_recording_session.py
+++ b/src/gui/main/workflows/new_recording_session.py
@@ -2,9 +2,9 @@ from PyQt6.QtWidgets import QHBoxLayout, QLabel, QLineEdit, QPushButton, QVBoxLa
QWidget, QCheckBox
from src.config.home_dir import create_session_id
-from src.freemocap_qt_gui.conference.shared_widgets.page_title import PageTitle
-from src.freemocap_qt_gui.conference.shared_widgets.primary_button import PrimaryButton
-from src.freemocap_qt_gui.refactored_gui.state.app_state import APP_STATE
+from src.gui.main.shared_widgets.page_title import PageTitle
+from src.gui.main.shared_widgets.primary_button import PrimaryButton
+from src.gui.main.state.app_state import APP_STATE
class NewRecordingSession(QWidget):
diff --git a/src/freemocap_qt_gui/conference/workflows/record_instructions.py b/src/gui/main/workflows/record_instructions.py
similarity index 93%
rename from src/freemocap_qt_gui/conference/workflows/record_instructions.py
rename to src/gui/main/workflows/record_instructions.py
index 191fea4a..27ee492b 100644
--- a/src/freemocap_qt_gui/conference/workflows/record_instructions.py
+++ b/src/gui/main/workflows/record_instructions.py
@@ -1,6 +1,6 @@
from PyQt6.QtWidgets import QHBoxLayout, QLabel, QVBoxLayout, QWidget
-from src.freemocap_qt_gui.conference.shared_widgets.primary_button import PrimaryButton
+from src.gui.main.shared_widgets.primary_button import PrimaryButton
class RecordInstructions(QWidget):
diff --git a/src/freemocap_qt_gui/conference/workflows/record_videos.py b/src/gui/main/workflows/record_videos.py
similarity index 97%
rename from src/freemocap_qt_gui/conference/workflows/record_videos.py
rename to src/gui/main/workflows/record_videos.py
index 9f17783b..5cd98f84 100644
--- a/src/freemocap_qt_gui/conference/workflows/record_videos.py
+++ b/src/gui/main/workflows/record_videos.py
@@ -3,8 +3,8 @@ from PyQt6.QtWidgets import QCheckBox, QHBoxLayout, QLabel, QPushButton, QVBoxLa
from src.cameras.save_synchronized_videos import save_synchronized_videos
from src.core_processor.mediapipe_skeleton_detector.mediapipe_skeleton_detector import \
MediaPipeSkeletonDetector
-from src.freemocap_qt_gui.conference.workflows.single_camera import SingleCamera
-from src.freemocap_qt_gui.refactored_gui.state.app_state import APP_STATE
+from src.gui.main.state.app_state import APP_STATE
+from src.gui.main.workflows.single_camera import SingleCamera
from src.open_in_blender.open_session_in_blender import open_session_in_blender
from src.pipelines.calibration_pipeline.calibration_pipeline_orchestrator import \
CalibrationPipelineOrchestrator
diff --git a/src/freemocap_qt_gui/conference/workflows/show_cams_charuco.py b/src/gui/main/workflows/show_cams_charuco.py
similarity index 96%
rename from src/freemocap_qt_gui/conference/workflows/show_cams_charuco.py
rename to src/gui/main/workflows/show_cams_charuco.py
index 6da5ea14..867ff2df 100644
--- a/src/freemocap_qt_gui/conference/workflows/show_cams_charuco.py
+++ b/src/gui/main/workflows/show_cams_charuco.py
@@ -1,8 +1,9 @@
from PyQt6.QtWidgets import QHBoxLayout, QLabel, QVBoxLayout, QWidget, QPushButton, QCheckBox
from src.cameras.save_synchronized_videos import save_synchronized_videos
-from src.freemocap_qt_gui.conference.workflows.single_camera import SingleCamera
-from src.freemocap_qt_gui.refactored_gui.state.app_state import APP_STATE
+from src.gui.main.state.app_state import APP_STATE
+from src.gui.main.workflows.single_camera import SingleCamera
+
from src.pipelines.calibration_pipeline.calibration_pipeline_orchestrator import CalibrationPipelineOrchestrator
diff --git a/src/freemocap_qt_gui/conference/workflows/single_camera.py b/src/gui/main/workflows/single_camera.py
similarity index 90%
rename from src/freemocap_qt_gui/conference/workflows/single_camera.py
rename to src/gui/main/workflows/single_camera.py
index f91e72b7..22977f0a 100644
--- a/src/freemocap_qt_gui/conference/workflows/single_camera.py
+++ b/src/gui/main/workflows/single_camera.py
@@ -4,8 +4,8 @@ from PyQt6.QtCore import pyqtSignal
from PyQt6.QtGui import QPixmap
from PyQt6.QtWidgets import QHBoxLayout, QLabel, QWidget
-from src.freemocap_qt_gui.conference.workers.cam_charuco_frame_worker import CamCharucoFrameWorker
-from src.freemocap_qt_gui.conference.workers.cam_frame_worker import CamFrameWorker
+from src.gui.main.workers.cam_charuco_frame_worker import CamCharucoFrameWorker
+from src.gui.main.workers.cam_frame_worker import CamFrameWorker
class WorkerType(enum.Enum):
diff --git a/src/freemocap_qt_gui/conference/workflows/visualize_session.py b/src/gui/main/workflows/visualize_session.py
similarity index 98%
rename from src/freemocap_qt_gui/conference/workflows/visualize_session.py
rename to src/gui/main/workflows/visualize_session.py
index 31f9c75d..58677769 100644
--- a/src/freemocap_qt_gui/conference/workflows/visualize_session.py
+++ b/src/gui/main/workflows/visualize_session.py
@@ -11,7 +11,7 @@ import numpy as np
import sys
from mediapipe.python.solutions import holistic as mp_holistic
-from src.freemocap_qt_gui.refactored_gui.state.app_state import APP_STATE
+from src.gui.refactored_gui.state.app_state import APP_STATE
logger = logging.getLogger(__name__)
diff --git a/src/freemocap_qt_gui/conference/workflows/welcome.py b/src/gui/main/workflows/welcome.py
similarity index 83%
rename from src/freemocap_qt_gui/conference/workflows/welcome.py
rename to src/gui/main/workflows/welcome.py
index 06b64f5b..1f882310 100644
--- a/src/freemocap_qt_gui/conference/workflows/welcome.py
+++ b/src/gui/main/workflows/welcome.py
@@ -1,10 +1,8 @@
from PyQt6.QtCore import Qt
-from PyQt6.QtGui import QPixmap
from PyQt6.QtWidgets import QHBoxLayout, QLabel, QVBoxLayout, QWidget, QGridLayout, QSpacerItem, QCheckBox
-from src.freemocap_qt_gui.conference.qt_utils.set_font_size import set_font_size
-from src.freemocap_qt_gui.conference.shared_widgets.primary_button import PrimaryButton
-from src.freemocap_qt_gui.refactored_gui.state.app_state import APP_STATE
+from src.gui.main.qt_utils.set_font_size import set_font_size
+from src.gui.main.shared_widgets.primary_button import PrimaryButton
class Welcome(QWidget):
diff --git a/src/open_in_blender/open_session_in_blender.py b/src/open_in_blender/open_session_in_blender.py
index db54aa3d..d6eb21ba 100644
--- a/src/open_in_blender/open_session_in_blender.py
+++ b/src/open_in_blender/open_session_in_blender.py
@@ -3,7 +3,6 @@ import sys
from pathlib import Path
import subprocess
from src.config.home_dir import get_session_folder_path, get_most_recent_session_id
-from src.freemocap_qt_gui.refactored_gui.state.app_state import APP_STATE
# blender_exe_path = r"C:\Users\jonma\Blender Foundation\stable\blender-3.1.0-windows-x64\blender.exe"
blender_exe_path = r"C:\Users\jonma\Blender Foundation\Blender 3.1\blender.exe"