Skip to content

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

TypeScript

Run through while making the 'process from recorded videos' how to (#271)

jonmatthis87c4e204d8e8
diff --git a/src/gui/main/main_window/left_panel_controls/toolbox_widgets/calibrate_capture_volume_panel.py b/src/gui/main/main_window/left_panel_controls/toolbox_widgets/calibrate_capture_volume_panel.py
index ba94c941..df07411c 100644
--- a/src/gui/main/main_window/left_panel_controls/toolbox_widgets/calibrate_capture_volume_panel.py
+++ b/src/gui/main/main_window/left_panel_controls/toolbox_widgets/calibrate_capture_volume_panel.py
@@ -68,17 +68,17 @@ class CalibrateCaptureVolumePanel(QWidget):
self._load_calibration_toml_dialog_button.hide()
self._user_selected_camera_calibration_toml_path_label.hide()
-
- self._calibrate_from_synchronized_videos_radio_button = QRadioButton(
- "Calibrate from Synchronized Videos"
- )
- self._layout.addWidget(self._calibrate_from_synchronized_videos_radio_button)
- self._calibrate_from_synchronized_videos_radio_button.toggled.connect(
- self._handle_calibrate_from_synchronized_videos_radio_button_toggled
- )
- self._calibrate_from_videos_TODO_label = QLabel("TODO - This, lol")
- self._layout.addWidget(self._calibrate_from_videos_TODO_label)
- self._calibrate_from_videos_TODO_label.hide()
+ #
+ # self._calibrate_from_synchronized_videos_radio_button = QRadioButton(
+ # "Calibrate from Synchronized Videos"
+ # )
+ # self._layout.addWidget(self._calibrate_from_synchronized_videos_radio_button)
+ # self._calibrate_from_synchronized_videos_radio_button.toggled.connect(
+ # self._handle_calibrate_from_synchronized_videos_radio_button_toggled
+ # )
+ # self._calibrate_from_videos_button = QPushButton("Calibrate from `synchronized_videos/`")
+ # self._layout.addWidget(self._calibrate_from_videos_button)
+ # self._calibrate_from_videos_button.hide()
self._record_calibration_videos_radio_button = QRadioButton(
"Record New Calibration Videos"
@@ -110,7 +110,7 @@ class CalibrateCaptureVolumePanel(QWidget):
self._calibrate_capture_volume_from_videos_button = QPushButton(
"Calibrate Capture Volume From Videos"
)
- self._calibrate_capture_volume_from_videos_button.setEnabled(False)
+ self._calibrate_capture_volume_from_videos_button.setEnabled(True)
self._layout.addWidget(
self._calibrate_capture_volume_from_videos_button,
)
@@ -207,27 +207,18 @@ class CalibrateCaptureVolumePanel(QWidget):
def _handle_use_previous_calibration_radio_button_toggled(self):
self._hide_load_camera_calibration_stuff()
- self._hide_calibrate_from_videos_stuff()
self._hide_record_new_calibration_videos_stuff()
self._enable_disable_calibration_parameters_stuff(False)
def _handle_load_camera_calibration_radio_button_toggled(self):
self._load_calibration_toml_dialog_button.show()
self._user_selected_camera_calibration_toml_path_label.show()
- self._hide_calibrate_from_videos_stuff()
self._hide_record_new_calibration_videos_stuff()
self._enable_disable_calibration_parameters_stuff(False)
- def _handle_calibrate_from_synchronized_videos_radio_button_toggled(self):
- self._calibrate_from_videos_TODO_label.show()
- self._hide_load_camera_calibration_stuff()
- self._hide_record_new_calibration_videos_stuff()
- self._enable_disable_calibration_parameters_stuff(True)
-
def _handle_record_calibration_videos_radio_button_toggled(self):
self._show_record_new_calibration_videos_stuff()
self._hide_load_camera_calibration_stuff()
- self._hide_calibrate_from_videos_stuff()
self._enable_disable_calibration_parameters_stuff(True)
def _open_load_camera_calibration_toml_dialog(self):
@@ -265,6 +256,3 @@ class CalibrateCaptureVolumePanel(QWidget):
def _enable_disable_calibration_parameters_stuff(self, bool_in: bool):
self._charuco_combo_box.setEnabled(bool_in)
self._charuco_square_size_line_edit_widget.setEnabled(bool_in)
-
- def _hide_calibrate_from_videos_stuff(self):
- self._calibrate_from_videos_TODO_label.hide()
diff --git a/src/gui/main/main_window/main_window.py b/src/gui/main/main_window/main_window.py
index ae08c2ca..0a13804b 100644
--- a/src/gui/main/main_window/main_window.py
+++ b/src/gui/main/main_window/main_window.py
@@ -653,6 +653,20 @@ class MainWindow(QMainWindow):
calibration_videos_folder_path = get_calibration_videos_folder_path(
self._session_id
)
+ if (
+ not Path(calibration_videos_folder_path).exists()
+ or len(list(Path(calibration_videos_folder_path).glob("*.mp4"))) == 0
+ ):
+ logger.info(
+ f"Calibration videos folder does not exist (or its empty): {calibration_videos_folder_path}, copying vidoes from `synchronized_videos` to `calibration_videos` and trying with that"
+ )
+ Path(calibration_videos_folder_path).mkdir(parents=True, exist_ok=True)
+ shutil.copytree(
+ get_synchronized_videos_folder_path(self._session_id),
+ calibration_videos_folder_path,
+ dirs_exist_ok=True,
+ )
+
charuco_board_definition = self._get_user_specified_charuco_definition()
logger.info(
f"Launching Anipose calibration thread worker with the following parameters: {charuco_board_definition.__dict__}"