Free Motion Capture for Everyone πβ¨
TypeScript
working chkpt
jonmatthis8cbfd35f1d6d
diff --git a/freemocap/api/websocket/websocket_server.py b/freemocap/api/websocket/websocket_server.pyindex 3d06112a..146e4a58 100644--- a/freemocap/api/websocket/websocket_server.py+++ b/freemocap/api/websocket/websocket_server.py@@ -206,12 +206,8 @@ class WebsocketServer:framerate_source="Display")self._display_framerate_trackers[packet.camera_group_id].update(time.perf_counter_ns())- if len(progress_updates) > 0:- for update_messages in progress_updates:- if len(update_messages) > 0:- for update_message in update_messages:- logger.trace(f"Sending {len(progress_updates)} updates through the websocket ")- await self._send_msgspec_json(update_message)+ for update_message in progress_updates:+ await self._send_msgspec_json(update_message)# Send framerate updates from our local trackers (throttled to ~4Hz)now = time.monotonic()diff --git a/freemocap/core/blender/export_to_blender.py b/freemocap/core/blender/export_to_blender.pyindex cce3852b..9d135407 100644--- a/freemocap/core/blender/export_to_blender.py+++ b/freemocap/core/blender/export_to_blender.py@@ -99,7 +99,7 @@ def export_to_blender(if open_file_on_completion:logger.info(f"Opening {blend_file_path} with {blender_exe_path}")- open_file(blend_file_path,)+ open_file(str(blend_file_path),)logger.debug("Done with blender add on")diff --git a/freemocap/core/pipeline/posthoc/posthoc_pipeline.py b/freemocap/core/pipeline/posthoc/posthoc_pipeline.pyindex d048ec7e..2e51336f 100644--- a/freemocap/core/pipeline/posthoc/posthoc_pipeline.py+++ b/freemocap/core/pipeline/posthoc/posthoc_pipeline.py@@ -174,6 +174,6 @@ class PosthocPipeline(PipelineABC):def get_progress_messages(self) -> list[PipelineProgressMessage]:progress_messages: list[PipelineProgressMessage] = []for node in list(self.video_nodes.values()):- progress_messages.append(node.get_progress_messages())- progress_messages.append(self.aggregation_node.get_progress_messages())+ progress_messages.extend(node.get_progress_messages())+ progress_messages.extend(self.aggregation_node.get_progress_messages())return progress_messagesdiff --git a/freemocap/core/pipeline/posthoc/video_node.py b/freemocap/core/pipeline/posthoc/video_node.pyindex 6543c801..595caf03 100644--- a/freemocap/core/pipeline/posthoc/video_node.py+++ b/freemocap/core/pipeline/posthoc/video_node.py@@ -79,7 +79,7 @@ class VideoNode(SourceNode):video_path=video_path,shutdown_self_flag=shutdown_self_flag,worker=worker,- progress_subscription=pubsub.get_publication_queue(VideoNodeOutputTopic)+ progress_subscription=pubsub.get_subscription(VideoNodeProgressTopic))@staticmethoddiff --git a/freemocap/core/pipeline/realtime/realtime_aggregator_node.py b/freemocap/core/pipeline/realtime/realtime_aggregator_node.pyindex 6453aa3d..b7a8af13 100644--- a/freemocap/core/pipeline/realtime/realtime_aggregator_node.py+++ b/freemocap/core/pipeline/realtime/realtime_aggregator_node.py@@ -85,8 +85,15 @@ def _merge_triangulated_arrays(into[point_name] = coords-def _arrays_to_point3d(arrays: dict[str, np.ndarray]) -> dict[str, Point3d]:+def _arrays_to_point3d(arrays: dict[str, np.ndarray], swap_y_z:bool=False) -> dict[str, Point3d]:"""Convert dict of {name: ndarray(3,)} to dict of {name: Point3d}. Done once at the end."""+ if swap_y_z:+ #hacky swap to make UI look right.+ return {+ name: Point3d(x=float(arr[0]), y=float(arr[2]), z=float(arr[1]))+ for name, arr in arrays.items()+ }+return {name: Point3d(x=float(arr[0]), y=float(arr[1]), z=float(arr[2]))for name, arr in arrays.items()@@ -407,8 +414,8 @@ class RealtimeAggregatorNode(AggregatorNode):pipeline_config=pipeline_config,camera_group_id=camera_group_id,camera_node_outputs=camera_node_outputs,- keypoints_raw=_arrays_to_point3d(raw_keypoints),- keypoints_filtered=_arrays_to_point3d(filtered_keypoints),+ keypoints_raw=_arrays_to_point3d(raw_keypoints, swap_y_z=True),+ keypoints_filtered=_arrays_to_point3d(filtered_keypoints, swap_y_z=True),# rigid_body_poses=rigid_body_poses,),)diff --git a/freemocap/core/tasks/calibration/anipose_calibration/helpers/freemocap_anipose.py b/freemocap/core/tasks/calibration/anipose_calibration/helpers/freemocap_anipose.pyindex c9e20345..e2db3c43 100644--- a/freemocap/core/tasks/calibration/anipose_calibration/helpers/freemocap_anipose.py+++ b/freemocap/core/tasks/calibration/anipose_calibration/helpers/freemocap_anipose.py@@ -122,7 +122,7 @@ def resample_points(final_ixs = sorted(include)newp = imgp[:, final_ixs]- extra = subset_extra(extra, final_ixs)+ extra = subset_extra(extra, np.asarray(final_ixs))return newp, extra@@ -160,7 +160,7 @@ def remap_ids(ids: np.ndarray) -> np.ndarray:def get_connections(xs: np.ndarray,- cam_names: list | None = None,+ cam_names: list|np.ndarray | None = None,both: bool = True,) -> dict[tuple, int]:"""Count shared observation pairs between cameras."""@@ -168,21 +168,21 @@ def get_connections(n_points = xs.shape[1]if cam_names is None:+ # TODO - This is wrong!! we should use camera ID in the dict, NOT the INDEX!cam_names = [str(i) for i in range(n_cams)]- connections: dict[tuple, int] = defaultdict(int)+ connections = {}for rnum in range(n_points):ixs = np.where(~np.isnan(xs[:, rnum, 0]))[0]- keys = [cam_names[ix] for ix in ixs]+ keys = [int(cam_names[ix]) for ix in ixs]for i in range(len(keys)):for j in range(i + 1, len(keys)):a = keys[i]b = keys[j]- connections[(a, b)] += 1+ connections[(a, b)] = connections.get((a, b), 0) + 1if both:- connections[(b, a)] += 1-+ connections[(b, a)] = connections.get((b, a), 0) + 1return connectionsdiff --git a/freemocap/core/tasks/calibration/shared/groundplane_math.py b/freemocap/core/tasks/calibration/shared/groundplane_math.pyindex bd97c96d..794025b8 100644--- a/freemocap/core/tasks/calibration/shared/groundplane_math.py+++ b/freemocap/core/tasks/calibration/shared/groundplane_math.py@@ -39,8 +39,8 @@ def get_charuco_key_corner_indices("""num_cols = squares_x - 1num_rows = squares_y - 1- idx_x = num_cols * (num_rows - 1)- idx_y = num_cols - 1+ idx_y = num_cols * (num_rows - 1)+ idx_x = num_cols - 1return idx_x, idx_y@@ -137,4 +137,4 @@ def find_still_charuco_frame(# +1 because np.diff shifts indices by 1best_frame_idx = np.where(visible)[0][best_visible_idx] + 1 + start- return best_frame_idx+ return int(best_frame_idx)diff --git a/freemocap/core/tasks/mocap/mocap_helpers/charuco_model_from_observations.py b/freemocap/core/tasks/mocap/mocap_helpers/charuco_model_from_observations.pyindex fe3c2de5..741bff01 100644--- a/freemocap/core/tasks/mocap/mocap_helpers/charuco_model_from_observations.py+++ b/freemocap/core/tasks/mocap/mocap_helpers/charuco_model_from_observations.py@@ -22,9 +22,9 @@ from freemocap.core.tasks.calibration.anipose_calibration.helpers.freemocap_anipfrom freemocap.core.tasks.mocap.mocap_helpers.triangulate_trajectory_array import TriangulationConfig, triangulate_dictfrom freemocap.core.types.type_overloads import VideoIdString-if TYPE_CHECKING:- from skellyforge.data_models.trajectory_3d import Trajectory3d- import numpy as np++from skellyforge.data_models.trajectory_3d import Trajectory3d+import numpy as nplogger = logging.getLogger(__name__)diff --git a/pyproject.toml b/pyproject.tomlindex 067a2ef9..4ebc9276 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -21,12 +21,12 @@ dependencies = ["freemocap_blender_addon","skellycam","skellyforge",-# "skellytracker[all]",+ # "skellytracker[all]","skellytracker[mediapipe]",#skelly utils"skellylogs","skellypings",- "scipy-stubs~=1.16.3",+ "scipy-stubs~=1.17.1","beartype>=0.19","msgspec>=0.19",]diff --git a/uv.lock b/uv.lockindex 2efcd673..ccd6b3ea 100644--- a/uv.lock+++ b/uv.lock@@ -582,7 +582,7 @@ requires-dist = [{ name = "pyinstaller", specifier = ">=6.11.0" },{ name = "requests", specifier = ">=2.32.3" },{ name = "scikit-learn", specifier = ">=1.7.2" },- { name = "scipy-stubs", specifier = "~=1.16.3" },+ { name = "scipy-stubs", specifier = "~=1.17.1" },{ name = "skellycam", git = "https://github.com/freemocap/skellycam?branch=development" },{ name = "skellyforge", git = "https://github.com/freemocap/skellyforge?branch=development" },{ name = "skellylogs", git = "https://github.com/freemocap/skellylogs" },@@ -1237,14 +1237,14 @@ wheels = [[[package]]name = "optype"-version = "0.15.0"+version = "0.17.0"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "typing-extensions", marker = "python_full_version < '3.13'" },]-sdist = { url = "https://files.pythonhosted.org/packages/d7/93/6b9e43138ce36fbad134bd1a50460a7bbda61105b5a964e4cf773fe4d845/optype-0.15.0.tar.gz", hash = "sha256:457d6ca9e7da19967ec16d42bdf94e240b33b5d70a56fbbf5b427e5ea39cf41e", size = 99978, upload-time = "2025-12-08T12:32:41.422Z" }+sdist = { url = "https://files.pythonhosted.org/packages/81/9f/3b13bab05debf685678b8af004e46b8c67c6f98ffa08eaf5d33bcf162c16/optype-0.17.0.tar.gz", hash = "sha256:31351a1e64d9eba7bf67e14deefb286e85c66458db63c67dd5e26dd72e4664e5", size = 53484, upload-time = "2026-03-08T23:03:12.594Z" }wheels = [- { url = "https://files.pythonhosted.org/packages/07/8b/93f6c496fc5da062fd7e7c4745b5a8dd09b7b576c626075844fe97951a7d/optype-0.15.0-py3-none-any.whl", hash = "sha256:caba40ece9ea39b499fa76c036a82e0d452a432dd4dd3e8e0d30892be2e8c76c", size = 88716, upload-time = "2025-12-08T12:32:39.669Z" },+ { url = "https://files.pythonhosted.org/packages/6b/44/dca78187415947d1bb90b2ee2a58e47d9573528331e8dc6196996b53612a/optype-0.17.0-py3-none-any.whl", hash = "sha256:8c2d88ff13149454bcf6eb47502f80d288bc542e7238fcc412ac4d222c439397", size = 65854, upload-time = "2026-03-08T23:03:11.425Z" },][package.optional-dependencies]@@ -2164,14 +2164,14 @@ wheels = [[[package]]name = "scipy-stubs"-version = "1.16.3.3"+version = "1.17.1.4"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "optype", extra = ["numpy"] },]-sdist = { url = "https://files.pythonhosted.org/packages/08/91/1700d2a1a9f64f19bb019a547e510b99a6af1fef49641a0bce86bc85fb8e/scipy_stubs-1.16.3.3.tar.gz", hash = "sha256:af47578875d5557567225a16ec1b9b38a48c4c4377d92396413ebd65406c44ee", size = 361468, upload-time = "2025-12-08T13:45:38.37Z" }+sdist = { url = "https://files.pythonhosted.org/packages/d1/75/d944a11fca64aa84fbb4bfcf613b758319c6103cb30a304a0e9727009d62/scipy_stubs-1.17.1.4.tar.gz", hash = "sha256:cae00c5207aa62ceb4bcadea202d9fbbf002e958f9e4de981720436b8d5c1802", size = 396980, upload-time = "2026-04-13T11:46:54.528Z" }wheels = [- { url = "https://files.pythonhosted.org/packages/7c/e2/3b8826f281f59301e3284989b19cfc56fdccf799134c1befedd38482a23a/scipy_stubs-1.16.3.3-py3-none-any.whl", hash = "sha256:f6316b36cd0fb272c994ae5b10c4a73c644a7e156ed8d32bcd9c35303d0e1b7e", size = 561750, upload-time = "2025-12-08T13:45:36.568Z" },+ { url = "https://files.pythonhosted.org/packages/92/f8/334aa5a7a482ea89cb14d92f6a4d9ffa1e193e733144d4d14c7ffcb33583/scipy_stubs-1.17.1.4-py3-none-any.whl", hash = "sha256:e6e5c390fb864745bc3d5f591de81f5cb4f84403857d4f660acb5b6339956f5b", size = 604752, upload-time = "2026-04-13T11:46:53.135Z" },][[package]]@@ -2256,7 +2256,7 @@ dependencies = [[[package]]name = "skellyforge"version = "2024.12.1009"-source = { git = "https://github.com/freemocap/skellyforge?branch=development#b8a327295dc3f3fa37b01049e6558a29186de0d3" }+source = { git = "https://github.com/freemocap/skellyforge?branch=development#15de25f52a7873666ccf070ebe7ce84d5d8fa95a" }dependencies = [{ name = "numpy" },{ name = "pandas" },