lightning-pose-app 1.8.1a17__tar.gz → 1.8.1a19__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/PKG-INFO +1 -1
  2. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/pyproject.toml +1 -1
  3. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/routes/labeler/bundle_adjust.py +26 -11
  4. lightning_pose_app-1.8.1a19/src/litpose_app/routes/labeler/test_bundle_adjust.ipynb +212 -0
  5. lightning_pose_app-1.8.1a17/src/litpose_app/routes/labeler/test_bundle_adjust.ipynb +0 -113
  6. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/__init__.py +0 -0
  7. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/config.py +0 -0
  8. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/deps.py +0 -0
  9. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/main.py +0 -0
  10. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/3rdpartylicenses.txt +0 -0
  11. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/app.component-UHVEDPZR.css.map +0 -0
  12. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/create-model-dialog.component-XM4MKM6L.css.map +0 -0
  13. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/error-dialog.component-HYLQSJEP.css.map +0 -0
  14. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/extract-frames-dialog.component-DKKIPRKS.css.map +0 -0
  15. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/favicon.ico +0 -0
  16. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/index.html +0 -0
  17. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/keypoint-container.component-VEIHFX5W.css.map +0 -0
  18. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/keypoint-container.component-XEIQLTQH.css.map +0 -0
  19. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/labeler-page.component-2C3HHMLS.css.map +0 -0
  20. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/main-KC4KA54O.js +0 -0
  21. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/main-KC4KA54O.js.map +0 -0
  22. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/models-list.component-2QANIGQC.css.map +0 -0
  23. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/models-page.component-IUFTF74U.css.map +0 -0
  24. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/project-settings.component-5IRK7U7U.css.map +0 -0
  25. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/project-settings.component-M7JLU4LS.css.map +0 -0
  26. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/styles-5EVDHR6N.css +0 -0
  27. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/styles-5EVDHR6N.css.map +0 -0
  28. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/tree-listbox.component-SA2WHIMD.css.map +0 -0
  29. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/tree-option.component-ZP2K7I3T.css.map +0 -0
  30. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/video-player-controls.component-C4JZHYJ2.css.map +0 -0
  31. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/video-tile.component-XSYKMARQ.css.map +0 -0
  32. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/viewer-page.component-MRTIUFL2.css.map +0 -0
  33. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/viewer-sessions-panel.component-RA7FRRQH.css.map +0 -0
  34. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/browser/zoomable-content.component-WOVVSJCQ.css.map +0 -0
  35. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/ngdist/ng_app/prerendered-routes.json +0 -0
  36. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/routes/configs.py +0 -0
  37. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/routes/extract_frames.py +0 -0
  38. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/routes/ffprobe.py +0 -0
  39. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/routes/labeler/__init__.py +0 -0
  40. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/routes/labeler/find_label_files.py +0 -0
  41. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/routes/labeler/multiview_autolabel.py +0 -0
  42. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/routes/labeler/save_mvframe.py +0 -0
  43. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/routes/labeler/test_multiview_autolabel.ipynb +0 -0
  44. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/routes/labeler/write_multifile.py +0 -0
  45. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/routes/models.py +0 -0
  46. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/routes/project.py +0 -0
  47. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/routes/rglob.py +0 -0
  48. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/routes/transcode.py +0 -0
  49. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/tasks/__init__.py +0 -0
  50. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/tasks/extract_frames.py +0 -0
  51. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/tasks/management.py +0 -0
  52. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/tasks/transcode_fine.py +0 -0
  53. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/train_scheduler.py +0 -0
  54. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/utils/__init__.py +0 -0
  55. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/utils/config_watcher.py +0 -0
  56. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/utils/enqueue.py +0 -0
  57. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/utils/file_response.py +0 -0
  58. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/utils/fix_empty_first_row.py +0 -0
  59. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/utils/mv_label_file.py +0 -0
  60. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/utils/video/__init__.py +0 -0
  61. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/utils/video/export_frames.py +0 -0
  62. {lightning_pose_app-1.8.1a17 → lightning_pose_app-1.8.1a19}/src/litpose_app/utils/video/frame_selection.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lightning-pose-app
3
- Version: 1.8.1a17
3
+ Version: 1.8.1a19
4
4
  Summary:
5
5
  Requires-Python: >=3.10
6
6
  Classifier: Programming Language :: Python :: 3
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [project]
6
6
  name = "lightning-pose-app"
7
- version = "1.8.1a17"
7
+ version = "1.8.1a19"
8
8
  requires-python = ">=3.10"
9
9
  dependencies = [
10
10
  "aiofiles~=24.1.0",
@@ -57,9 +57,8 @@ def bundle_adjust(
57
57
  return BundleAdjustResponse.model_validate(result)
58
58
 
59
59
 
60
-
61
60
  def _bundle_adjust_impl(
62
- request: BundleAdjustRequest, project_info: ProjectInfo, config: Config
61
+ request: BundleAdjustRequest, project_info: ProjectInfo, config: Config
63
62
  ):
64
63
  camera_group_toml_path = find_calibration_file(
65
64
  request.sessionKey, project_info, config
@@ -76,7 +75,7 @@ def _bundle_adjust_impl(
76
75
  parts = framePath.split("/")
77
76
  if len(parts) < 3:
78
77
  return False
79
- sessionViewNameWithDots = parts[-2] # e.g. 05272019_fly1_0_R1C24_Cam-A_rot-ccw-0.06_sec
78
+ sessionViewNameWithDots = parts[-2] # e.g. 05272019_fly1_0_R1C24_Cam-A_rot-ccw-0.06_sec
80
79
 
81
80
  def processPart(sessionViewName):
82
81
  """Mirrors frame.model.ts get autolabelSessionKey()"""
@@ -142,20 +141,36 @@ def _bundle_adjust_impl(
142
141
  for view in views:
143
142
  df = dfs_by_view[view]
144
143
  dfs_by_view[view] = df.loc[df.index.to_series().apply(is_of_current_session)]
144
+ if len(dfs_by_view[view]) == 0:
145
+ raise RuntimeError(
146
+ f"Insufficient frames found after filtering for session {request.sessionKey}. Possible error in session extraction logic.")
145
147
 
146
- # Normalize columns: x, y alternating.
148
+ # Remove rows with NaN coordinates
149
+ # Get indices of rows with NaN coordinates in any view
150
+ nan_indices = set()
147
151
  for view in views:
148
152
  df = dfs_by_view[view]
153
+ picked_columns = [c for c in df.columns if c[2] in ("x", "y")]
154
+ nan_indices.update(df.loc[:, picked_columns].dropna().index.symmetric_difference(df.index))
149
155
 
156
+ # Drop those indices from all views
157
+ for view in views:
158
+ dfs_by_view[view] = dfs_by_view[view].drop(nan_indices)
159
+ if len(dfs_by_view[view]) == 0:
160
+ raise RuntimeError(
161
+ f"Insufficient frames found after dropping NaN rows for session {request.sessionKey}.")
162
+ # Normalize columns: x, y alternating.
163
+ for view in views:
164
+ df = dfs_by_view[view]
150
165
  picked_columns = [c for c in df.columns if c[2] in ("x", "y")]
151
166
  assert len(picked_columns) % 2 == 0
152
167
  assert (
153
- picked_columns[::2][0][2] == "x"
154
- and len(set(list(map(lambda t: t[2], picked_columns[::2])))) == 1
168
+ picked_columns[::2][0][2] == "x"
169
+ and len(set(map(lambda t: t[2], picked_columns[::2]))) == 1
155
170
  )
156
171
  assert (
157
- picked_columns[1::2][0][2] == "y"
158
- and len(set(list(map(lambda t: t[2], picked_columns[1::2])))) == 1
172
+ picked_columns[1::2][0][2] == "y"
173
+ and len(set(map(lambda t: t[2], picked_columns[1::2]))) == 1
159
174
  )
160
175
  dfs_by_view[view] = df.loc[:, picked_columns]
161
176
 
@@ -179,9 +194,9 @@ def _bundle_adjust_impl(
179
194
 
180
195
  if target_path.exists():
181
196
  backup_path = (
182
- project_info.data_dir
183
- / config.CALIBRATION_BACKUPS_DIRNAME
184
- / target_path.with_suffix(f".{time.time_ns()}.toml").name
197
+ project_info.data_dir
198
+ / config.CALIBRATION_BACKUPS_DIRNAME
199
+ / target_path.with_suffix(f".{time.time_ns()}.toml").name
185
200
  )
186
201
  backup_path.parent.mkdir(parents=True, exist_ok=True)
187
202
  os.rename(target_path, backup_path)
@@ -0,0 +1,212 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "metadata": {
5
+ "ExecuteTime": {
6
+ "end_time": "2025-10-21T18:12:15.867772Z",
7
+ "start_time": "2025-10-21T18:12:12.121614Z"
8
+ }
9
+ },
10
+ "cell_type": "code",
11
+ "source": [
12
+ "import numpy as np\n",
13
+ "\n",
14
+ "from litpose_app.deps import project_info\n",
15
+ "from litpose_app.routes.rglob import rglob, RGlobRequest\n",
16
+ "from multiview_autolabel import *\n",
17
+ "from bundle_adjust import *\n",
18
+ "warm_up_anipose()"
19
+ ],
20
+ "id": "426cdcedf0207a92",
21
+ "outputs": [],
22
+ "execution_count": 2
23
+ },
24
+ {
25
+ "metadata": {
26
+ "ExecuteTime": {
27
+ "end_time": "2025-10-21T18:24:57.793056Z",
28
+ "start_time": "2025-10-21T18:24:57.786487Z"
29
+ }
30
+ },
31
+ "cell_type": "code",
32
+ "source": [
33
+ "import numpy as np\n",
34
+ "# Assuming Camera and CameraGroup are in a file named 'cameras.py'\n",
35
+ "from aniposelib.cameras import CameraGroup, Camera\n",
36
+ "\n",
37
+ "\n",
38
+ "def demonstrate_triangulate():\n",
39
+ " # --- 1. Create dummy Camera objects ---\n",
40
+ " # For demonstration, we'll create two cameras with simple parameters.\n",
41
+ " # In a real scenario, these would come from calibration.\n",
42
+ "\n",
43
+ " # Camera 1 parameters\n",
44
+ " camera_matrix_1 = np.array([[1000, 0, 640],\n",
45
+ " [0, 1000, 480],\n",
46
+ " [0, 0, 1]], dtype=np.float64)\n",
47
+ " dist_coeffs_1 = np.array([0, 0, 0, 0, 0], dtype=np.float64) # No distortion for simplicity\n",
48
+ " rvec_1 = np.array([[0.], [0.], [0.]], dtype=np.float64) # No rotation\n",
49
+ " tvec_1 = np.array([[0.], [0.], [0.]], dtype=np.float64) # Origin at world origin\n",
50
+ " cam1 = Camera(name='cam1',\n",
51
+ " matrix=camera_matrix_1,\n",
52
+ " dist=dist_coeffs_1,\n",
53
+ " rvec=rvec_1,\n",
54
+ " tvec=tvec_1,\n",
55
+ " size=(1280, 960)) # Image width, height\n",
56
+ "\n",
57
+ " # Camera 2 parameters - shifted and slightly rotated relative to Camera 1\n",
58
+ " camera_matrix_2 = np.array([[1050, 0, 650],\n",
59
+ " [0, 1050, 470],\n",
60
+ " [0, 0, 1]], dtype=np.float64)\n",
61
+ " dist_coeffs_2 = np.array([0.01, -0.02, 0, 0, 0], dtype=np.float64) # Some distortion\n",
62
+ " rvec_2 = np.array([[0.05], [-0.1], [0.03]], dtype=np.float64) # Small rotation\n",
63
+ " tvec_2 = np.array([[0.5], [0.1], [-0.2]], dtype=np.float64) # Translated from origin\n",
64
+ " cam2 = Camera(name='cam2',\n",
65
+ " matrix=camera_matrix_2,\n",
66
+ " dist=dist_coeffs_2,\n",
67
+ " rvec=rvec_2,\n",
68
+ " tvec=tvec_2,\n",
69
+ " size=(1280, 960))\n",
70
+ "\n",
71
+ " print(\"Cameras initialized.\")\n",
72
+ " print(f\"Camera 1 name: {cam1.get_name()}\")\n",
73
+ " print(f\"Camera 2 name: {cam2.get_name()}\")\n",
74
+ "\n",
75
+ " # --- 2. Create a CameraGroup ---\n",
76
+ " camera_group = CameraGroup(cameras=[cam1, cam2])\n",
77
+ " print(\"\\nCameraGroup created with 2 cameras.\")\n",
78
+ "\n",
79
+ " # --- 3. Define a sample 3D point (world coordinates) ---\n",
80
+ " # We will try to triangulate this point\n",
81
+ " true_3d_point = np.array([[1.0, 2.0, 5.0]], dtype=np.float64) # Shape (1, 3)\n",
82
+ "\n",
83
+ " print(f\"\\nTrue 3D point in world coordinates: {true_3d_point}\")\n",
84
+ "\n",
85
+ " # --- 4. Project the 3D point onto each camera to get 2D observations ---\n",
86
+ " # The 'project' method of CameraGroup expects points for each camera.\n",
87
+ " # The output of Camera.project is (N, 2) for N points.\n",
88
+ " points_2d_cam1 = cam1.project(true_3d_point)\n",
89
+ " points_2d_cam2 = cam2.project(true_3d_point)\n",
90
+ "\n",
91
+ " # Reshape the points to match expected format (num_cameras, num_points, 2)\n",
92
+ " points_2d_cam1 = points_2d_cam1.reshape(1, 2)\n",
93
+ " points_2d_cam2 = points_2d_cam2.reshape(1, 2)\n",
94
+ "\n",
95
+ " # TEST NAN\n",
96
+ " #points_2d_cam1[0, 0] = np.nan\n",
97
+ "\n",
98
+ " points_for_triangulation = np.stack([points_2d_cam1, points_2d_cam2])\n",
99
+ "\n",
100
+ " print(f\"\\nProjected 2D point for Camera 1:\\n{points_2d_cam1}\")\n",
101
+ " print(f\"Projected 2D point for Camera 2:\\n{points_2d_cam2}\")\n",
102
+ " print(f\"Shape of points for triangulation: {points_for_triangulation.shape}\")\n",
103
+ "\n",
104
+ " # --- 5. Use CameraGroup.triangulate to reconstruct the 3D point ---\n",
105
+ " # We'll set undistort=True because cam2 has distortion coefficients.\n",
106
+ " # The triangulate method returns a numpy array of shape (num_points, 3).\n",
107
+ " triangulated_points = camera_group.triangulate(points_for_triangulation, undistort=True)\n",
108
+ "\n",
109
+ " print(f\"\\nTriangulated 3D points:\\n{triangulated_points}\")\n",
110
+ "\n",
111
+ " # Compare the triangulated point with the original 3D point\n",
112
+ " if triangulated_points.shape[0] > 0:\n",
113
+ " reconstructed_point = triangulated_points[0]\n",
114
+ " error = np.linalg.norm(reconstructed_point - true_3d_point[0])\n",
115
+ " print(f\"\\nOriginal 3D point: {true_3d_point[0]}\")\n",
116
+ " print(f\"Reconstructed 3D point: {reconstructed_point}\")\n",
117
+ " print(f\"Reconstruction error (L2 norm): {error:.6f}\")\n"
118
+ ],
119
+ "id": "d57c636c870d94d4",
120
+ "outputs": [
121
+ {
122
+ "name": "stdout",
123
+ "output_type": "stream",
124
+ "text": [
125
+ "Cameras initialized.\n",
126
+ "Camera 1 name: cam1\n",
127
+ "Camera 2 name: cam2\n",
128
+ "\n",
129
+ "CameraGroup created with 2 cameras.\n",
130
+ "\n",
131
+ "True 3D point in world coordinates: [[1. 2. 5.]]\n",
132
+ "\n",
133
+ "Projected 2D point for Camera 1:\n",
134
+ "[[ nan 880.]]\n",
135
+ "Projected 2D point for Camera 2:\n",
136
+ "[[847.82290042 865.22061803]]\n",
137
+ "Shape of points for triangulation: (2, 1, 2)\n",
138
+ "\n",
139
+ "Triangulated 3D points:\n",
140
+ "[[nan nan nan]]\n",
141
+ "\n",
142
+ "Original 3D point: [1. 2. 5.]\n",
143
+ "Reconstructed 3D point: [nan nan nan]\n",
144
+ "Reconstruction error (L2 norm): nan\n"
145
+ ]
146
+ }
147
+ ],
148
+ "execution_count": 10
149
+ },
150
+ {
151
+ "metadata": {
152
+ "ExecuteTime": {
153
+ "end_time": "2025-10-21T18:12:16.051120Z",
154
+ "start_time": "2025-10-21T18:12:15.877447Z"
155
+ }
156
+ },
157
+ "cell_type": "code",
158
+ "source": [
159
+ "\n",
160
+ "from collections import defaultdict\n",
161
+ "from pathlib import Path\n",
162
+ "\n",
163
+ "request = BundleAdjustRequest(sessionKey='05272019_fly1_0_R1C24__rot-ccw-0.06_sec')\n",
164
+ "\n",
165
+ "from litpose_app import deps\n",
166
+ "config = deps.config()\n",
167
+ "project_info = deps.project_info(config)\n",
168
+ "\n",
169
+ "bundle_adjust(request, project_info, config)\n",
170
+ "\n",
171
+ "\n"
172
+ ],
173
+ "id": "37a1ad52fe6211ac",
174
+ "outputs": [
175
+ {
176
+ "ename": "ValidationError",
177
+ "evalue": "1 validation error for BundleAdjustRequest\nmvlabelfile\n Field required [type=missing, input_value={'sessionKey': '05272019_...1C24__rot-ccw-0.06_sec'}, input_type=dict]\n For further information visit https://errors.pydantic.dev/2.11/v/missing",
178
+ "output_type": "error",
179
+ "traceback": [
180
+ "\u001B[31m---------------------------------------------------------------------------\u001B[39m",
181
+ "\u001B[31mValidationError\u001B[39m Traceback (most recent call last)",
182
+ "\u001B[36mCell\u001B[39m\u001B[36m \u001B[39m\u001B[32mIn[3]\u001B[39m\u001B[32m, line 4\u001B[39m\n\u001B[32m 1\u001B[39m \u001B[38;5;28;01mfrom\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34;01mcollections\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[38;5;28;01mimport\u001B[39;00m defaultdict\n\u001B[32m 2\u001B[39m \u001B[38;5;28;01mfrom\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34;01mpathlib\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[38;5;28;01mimport\u001B[39;00m Path\n\u001B[32m----> \u001B[39m\u001B[32m4\u001B[39m request = \u001B[43mBundleAdjustRequest\u001B[49m\u001B[43m(\u001B[49m\u001B[43msessionKey\u001B[49m\u001B[43m=\u001B[49m\u001B[33;43m'\u001B[39;49m\u001B[33;43m05272019_fly1_0_R1C24__rot-ccw-0.06_sec\u001B[39;49m\u001B[33;43m'\u001B[39;49m\u001B[43m)\u001B[49m\n\u001B[32m 6\u001B[39m \u001B[38;5;28;01mfrom\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34;01mlitpose_app\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[38;5;28;01mimport\u001B[39;00m deps\n\u001B[32m 7\u001B[39m config = deps.config()\n",
183
+ "\u001B[36mFile \u001B[39m\u001B[32m~/miniforge3/envs/lpv/lib/python3.12/site-packages/pydantic/main.py:253\u001B[39m, in \u001B[36mBaseModel.__init__\u001B[39m\u001B[34m(self, **data)\u001B[39m\n\u001B[32m 251\u001B[39m \u001B[38;5;66;03m# `__tracebackhide__` tells pytest and some other tools to omit this function from tracebacks\u001B[39;00m\n\u001B[32m 252\u001B[39m __tracebackhide__ = \u001B[38;5;28;01mTrue\u001B[39;00m\n\u001B[32m--> \u001B[39m\u001B[32m253\u001B[39m validated_self = \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43m__pydantic_validator__\u001B[49m\u001B[43m.\u001B[49m\u001B[43mvalidate_python\u001B[49m\u001B[43m(\u001B[49m\u001B[43mdata\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mself_instance\u001B[49m\u001B[43m=\u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m)\u001B[49m\n\u001B[32m 254\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mself\u001B[39m \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m validated_self:\n\u001B[32m 255\u001B[39m warnings.warn(\n\u001B[32m 256\u001B[39m \u001B[33m'\u001B[39m\u001B[33mA custom validator is returning a value other than `self`.\u001B[39m\u001B[38;5;130;01m\\n\u001B[39;00m\u001B[33m'\u001B[39m\n\u001B[32m 257\u001B[39m \u001B[33m\"\u001B[39m\u001B[33mReturning anything other than `self` from a top level model validator isn\u001B[39m\u001B[33m'\u001B[39m\u001B[33mt supported when validating via `__init__`.\u001B[39m\u001B[38;5;130;01m\\n\u001B[39;00m\u001B[33m\"\u001B[39m\n\u001B[32m 258\u001B[39m \u001B[33m'\u001B[39m\u001B[33mSee the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\u001B[39m\u001B[33m'\u001B[39m,\n\u001B[32m 259\u001B[39m stacklevel=\u001B[32m2\u001B[39m,\n\u001B[32m 260\u001B[39m )\n",
184
+ "\u001B[31mValidationError\u001B[39m: 1 validation error for BundleAdjustRequest\nmvlabelfile\n Field required [type=missing, input_value={'sessionKey': '05272019_...1C24__rot-ccw-0.06_sec'}, input_type=dict]\n For further information visit https://errors.pydantic.dev/2.11/v/missing"
185
+ ]
186
+ }
187
+ ],
188
+ "execution_count": 3
189
+ }
190
+ ],
191
+ "metadata": {
192
+ "kernelspec": {
193
+ "display_name": "Python 3",
194
+ "language": "python",
195
+ "name": "python3"
196
+ },
197
+ "language_info": {
198
+ "codemirror_mode": {
199
+ "name": "ipython",
200
+ "version": 2
201
+ },
202
+ "file_extension": ".py",
203
+ "mimetype": "text/x-python",
204
+ "name": "python",
205
+ "nbconvert_exporter": "python",
206
+ "pygments_lexer": "ipython2",
207
+ "version": "2.7.6"
208
+ }
209
+ },
210
+ "nbformat": 4,
211
+ "nbformat_minor": 5
212
+ }
@@ -1,113 +0,0 @@
1
- {
2
- "cells": [
3
- {
4
- "metadata": {
5
- "ExecuteTime": {
6
- "end_time": "2025-09-04T22:29:30.548302Z",
7
- "start_time": "2025-09-04T22:29:28.207273Z"
8
- }
9
- },
10
- "cell_type": "code",
11
- "source": [
12
- "import numpy as np\n",
13
- "\n",
14
- "from litpose_app.deps import project_info\n",
15
- "from litpose_app.routes.rglob import rglob, RGlobRequest\n",
16
- "from multiview_autolabel import *\n",
17
- "from bundle_adjust import *\n",
18
- "warm_up_anipose()"
19
- ],
20
- "id": "426cdcedf0207a92",
21
- "outputs": [],
22
- "execution_count": 1
23
- },
24
- {
25
- "metadata": {
26
- "ExecuteTime": {
27
- "end_time": "2025-09-04T22:29:36.203750Z",
28
- "start_time": "2025-09-04T22:29:30.552170Z"
29
- }
30
- },
31
- "cell_type": "code",
32
- "source": [
33
- "\n",
34
- "from collections import defaultdict\n",
35
- "from pathlib import Path\n",
36
- "\n",
37
- "request = BundleAdjustRequest(sessionKey='05272019_fly1_0_R1C24__rot-ccw-0.06_sec')\n",
38
- "\n",
39
- "from litpose_app import deps\n",
40
- "config = deps.config()\n",
41
- "project_info = deps.project_info(config)\n",
42
- "\n",
43
- "bundle_adjust(request, project_info, config)\n",
44
- "\n",
45
- "\n"
46
- ],
47
- "id": "37a1ad52fe6211ac",
48
- "outputs": [
49
- {
50
- "name": "stdout",
51
- "output_type": "stream",
52
- "text": [
53
- "Skipping /home/ksikka/work/LightningPoseData/fly-anipose/calibrations.csv because no view name was present.\n",
54
- "Skipping /home/ksikka/work/LightningPoseData/fly-anipose/calibrations_new.csv because no view name was present.\n",
55
- "/home/ksikka/work/LightningPoseData/fly-anipose/CollectedData_Cam-A_new.csv\n",
56
- "/home/ksikka/work/LightningPoseData/fly-anipose/CollectedData_Cam-B_new.csv\n",
57
- "/home/ksikka/work/LightningPoseData/fly-anipose/CollectedData_Cam-C_new.csv\n",
58
- "/home/ksikka/work/LightningPoseData/fly-anipose/CollectedData_Cam-D_new.csv\n",
59
- "/home/ksikka/work/LightningPoseData/fly-anipose/CollectedData_Cam-E_new.csv\n",
60
- "/home/ksikka/work/LightningPoseData/fly-anipose/CollectedData_Cam-F_new.csv\n",
61
- "/home/ksikka/work/LightningPoseData/fly-anipose/CollectedData_Cam-A.csv\n",
62
- "/home/ksikka/work/LightningPoseData/fly-anipose/CollectedData_Cam-B.csv\n",
63
- "/home/ksikka/work/LightningPoseData/fly-anipose/CollectedData_Cam-C.csv\n",
64
- "/home/ksikka/work/LightningPoseData/fly-anipose/CollectedData_Cam-D.csv\n",
65
- "/home/ksikka/work/LightningPoseData/fly-anipose/CollectedData_Cam-E.csv\n",
66
- "/home/ksikka/work/LightningPoseData/fly-anipose/CollectedData_Cam-F.csv\n"
67
- ]
68
- },
69
- {
70
- "name": "stderr",
71
- "output_type": "stream",
72
- "text": [
73
- "2025-09-04 18:29:31,194 - INFO - finding looplift candidates\n",
74
- "2025-09-04 18:29:32,323 - INFO - finding looplift candidates\n",
75
- "2025-09-04 18:29:32,493 - INFO - finding looplift candidates\n"
76
- ]
77
- },
78
- {
79
- "data": {
80
- "text/plain": [
81
- "'ok'"
82
- ]
83
- },
84
- "execution_count": 2,
85
- "metadata": {},
86
- "output_type": "execute_result"
87
- }
88
- ],
89
- "execution_count": 2
90
- }
91
- ],
92
- "metadata": {
93
- "kernelspec": {
94
- "display_name": "Python 3",
95
- "language": "python",
96
- "name": "python3"
97
- },
98
- "language_info": {
99
- "codemirror_mode": {
100
- "name": "ipython",
101
- "version": 2
102
- },
103
- "file_extension": ".py",
104
- "mimetype": "text/x-python",
105
- "name": "python",
106
- "nbconvert_exporter": "python",
107
- "pygments_lexer": "ipython2",
108
- "version": "2.7.6"
109
- }
110
- },
111
- "nbformat": 4,
112
- "nbformat_minor": 5
113
- }