lightning-pose-app 2.0.4__tar.gz → 2.0.4.1__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 (79) hide show
  1. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/PKG-INFO +1 -1
  2. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/pyproject.toml +1 -1
  3. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/main.py +39 -6
  4. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/index.html +1 -0
  5. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/rootconfig.py +5 -0
  6. lightning_pose_app-2.0.4.1/src/litpose_app/utils/check_for_upgrade.py +49 -0
  7. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/__init__.py +0 -0
  8. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/config.py +0 -0
  9. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/config_default.yaml +0 -0
  10. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/config_default_multiview.yaml +0 -0
  11. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/datatypes.py +0 -0
  12. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/deps.py +0 -0
  13. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/3rdpartylicenses.txt +0 -0
  14. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/app.component-AUUQIS4L.css.map +0 -0
  15. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/create-model-dialog.component-XM4MKM6L.css.map +0 -0
  16. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/error-dialog.component-HYLQSJEP.css.map +0 -0
  17. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/extract-frames-dialog.component-DKKIPRKS.css.map +0 -0
  18. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/favicon.ico +0 -0
  19. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/keypoint-container.component-KO24463N.css.map +0 -0
  20. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/keypoint-container.component-SZ5BMRPW.css.map +0 -0
  21. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/labeler-page.component-QRMYNSCU.css.map +0 -0
  22. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/main-NBDWJMTE.js +0 -0
  23. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/main-NBDWJMTE.js.map +0 -0
  24. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/models-list.component-MDSKECMI.css.map +0 -0
  25. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/models-page.component-L4SVYDR4.css.map +0 -0
  26. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/project-home-page.component-R5CHNSJR.css.map +0 -0
  27. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/project-settings.component-M7JLU4LS.css.map +0 -0
  28. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/project-settings.component-MIMBNLAS.css.map +0 -0
  29. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/project_home_card_labeler.jpg +0 -0
  30. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/project_home_card_models.png +0 -0
  31. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/project_home_card_settings.jpg +0 -0
  32. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/project_home_card_viewer.png +0 -0
  33. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/static/favicon.ico +0 -0
  34. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/static/project_home_card_labeler.jpg +0 -0
  35. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/static/project_home_card_models.png +0 -0
  36. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/static/project_home_card_settings.jpg +0 -0
  37. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/static/project_home_card_viewer.png +0 -0
  38. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/styles-U236RTUB.css +0 -0
  39. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/styles-U236RTUB.css.map +0 -0
  40. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/tree-listbox.component-2S52Y7TI.css.map +0 -0
  41. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/tree-option.component-KZLESR6G.css.map +0 -0
  42. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/video-player-controls.component-C4JZHYJ2.css.map +0 -0
  43. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/video-tile.component-FX44DSOB.css.map +0 -0
  44. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/viewer-page.component-XNVVMQT5.css.map +0 -0
  45. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/viewer-sessions-panel.component-NXAFLPPW.css.map +0 -0
  46. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/browser/zoomable-content.component-OMWL5RR7.css.map +0 -0
  47. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/ngdist/ng_app/prerendered-routes.json +0 -0
  48. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/paths/__init__.py +0 -0
  49. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/paths/path_util.py +0 -0
  50. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/paths/path_util_legacy.py +0 -0
  51. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/project.py +0 -0
  52. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/routes/config_root.py +0 -0
  53. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/routes/configs.py +0 -0
  54. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/routes/extract_frames.py +0 -0
  55. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/routes/ffprobe.py +0 -0
  56. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/routes/inference.py +0 -0
  57. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/routes/labeler/__init__.py +0 -0
  58. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/routes/labeler/bundle_adjust.py +0 -0
  59. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/routes/labeler/find_label_files.py +0 -0
  60. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/routes/labeler/multiview_autolabel.py +0 -0
  61. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/routes/labeler/save_mvframe.py +0 -0
  62. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/routes/labeler/test_bundle_adjust.ipynb +0 -0
  63. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/routes/labeler/test_multiview_autolabel.ipynb +0 -0
  64. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/routes/models.py +0 -0
  65. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/routes/project.py +0 -0
  66. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/routes/rglob.py +0 -0
  67. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/routes/videos.py +0 -0
  68. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/tasks/__init__.py +0 -0
  69. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/tasks/extract_frames.py +0 -0
  70. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/tasks/transcode_fine.py +0 -0
  71. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/train_scheduler.py +0 -0
  72. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/utils/__init__.py +0 -0
  73. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/utils/enqueue.py +0 -0
  74. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/utils/file_response.py +0 -0
  75. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/utils/fix_empty_first_row.py +0 -0
  76. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/utils/mv_label_file.py +0 -0
  77. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/utils/video/__init__.py +0 -0
  78. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/src/litpose_app/utils/video/export_frames.py +0 -0
  79. {lightning_pose_app-2.0.4 → lightning_pose_app-2.0.4.1}/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: 2.0.4
3
+ Version: 2.0.4.1
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 = "2.0.4"
7
+ version = "2.0.4.1"
8
8
  requires-python = ">=3.10"
9
9
  dependencies = [
10
10
  "aiofiles~=24.1.0",
@@ -9,16 +9,18 @@ from textwrap import dedent
9
9
 
10
10
  import anyio
11
11
  import uvicorn
12
- from fastapi import FastAPI, HTTPException, APIRouter, Request
13
- from fastapi.responses import FileResponse
12
+ from fastapi import FastAPI, HTTPException, APIRouter, Request, Depends
13
+ from fastapi.responses import FileResponse, HTMLResponse
14
14
  from starlette import status
15
15
  from starlette.responses import Response
16
16
  from starlette.staticfiles import StaticFiles
17
17
 
18
18
  from . import deps
19
+ from .rootconfig import RootConfig
19
20
  from .routes.labeler.multiview_autolabel import warm_up_anipose
20
21
  from .routes.videos import cleanup_old_uploads
21
22
  from .train_scheduler import _train_scheduler_process_target
23
+ from .utils.check_for_upgrade import check_for_upgrade
22
24
  from .utils.file_response import file_response
23
25
 
24
26
  ## Setup logging
@@ -191,11 +193,42 @@ async def favicon():
191
193
 
192
194
  # Catch-all route. serve index.html.
193
195
  @app.get("/{full_path:path}")
194
- async def index():
195
- return FileResponse(
196
- Path(__file__).parent / "ngdist" / "ng_app" / "browser" / "index.html"
197
- )
196
+ def index(rc: RootConfig = Depends(deps.root_config)):
197
+ index_path = Path(__file__).parent / "ngdist" / "ng_app" / "browser" / "index.html"
198
+ content = index_path.read_text(encoding="utf-8")
199
+ analytics_tag_placeholder = "<!-- ANALYTICS_TAG_PLACEHOLDER -->"
200
+ assert analytics_tag_placeholder in content
201
+
202
+ # Skip analytics tag insertion if DO_NOT_TRACK is set
203
+ import os
204
+
205
+ if os.environ.get("DO_NOT_TRACK") != "1":
206
+ content = content.replace(analytics_tag_placeholder, rc.UMAMI_ANALYTICS_TAG)
207
+
208
+ return HTMLResponse(content=content)
198
209
 
199
210
 
200
211
  def run_app(host: str, port: int):
212
+ import os
213
+
214
+ if os.environ.get("DO_NOT_TRACK") != "1":
215
+ usage_message = dedent(
216
+ """
217
+ ================================================================================
218
+ 📊 Lightning Pose App Usage Tracking
219
+
220
+ To help us improve this tool and secure future grant funding, launching the app
221
+ in your browser will initiate privacy-focused web event tracking. We use Umami,
222
+ which ensures no personal data is ever collected or stored.
223
+
224
+ To opt out, please restart the app with the environment variable DO_NOT_TRACK=1
225
+ For example: DO_NOT_TRACK=1 litpose run_app
226
+ ================================================================================
227
+ """
228
+ )
229
+ print(usage_message, file=sys.stderr)
230
+ else:
231
+ logger.info("App tracking is opted out, skipping analytics tag insertion")
232
+
233
+ check_for_upgrade()
201
234
  uvicorn.run(app, host=host, port=port, timeout_graceful_shutdown=1)
@@ -301,6 +301,7 @@
301
301
  -webkit-font-smoothing: antialiased;
302
302
  }
303
303
  </style>
304
+ <!-- ANALYTICS_TAG_PLACEHOLDER -->
304
305
  <style>
305
306
  @layer properties;
306
307
  @layer theme, base, components, utilities;
@@ -16,6 +16,11 @@ class RootConfig(BaseSettings):
16
16
  default_factory=lambda data: data["LP_SYSTEM_DIR"] / "uploads"
17
17
  )
18
18
 
19
+ UMAMI_ANALYTICS_TAG: str = (
20
+ '<script defer src="https://cloud.umami.is/script.js" '
21
+ 'data-website-id="ba9731f2-f746-4c4e-8fc6-d876e1556a6e"></script>'
22
+ )
23
+
19
24
  @model_validator(mode="after")
20
25
  def init_dirs_and_files(self):
21
26
  """Creates directories as needed on application startup"""
@@ -0,0 +1,49 @@
1
+ import logging
2
+ import os
3
+ import sys
4
+ from textwrap import dedent
5
+
6
+ logger = logging.getLogger(__name__)
7
+
8
+
9
+ def check_for_upgrade():
10
+ if os.environ.get("LP_IGNORE_UPGRADE") == "1":
11
+ logger.info(f"LP_IGNORE_UPGRADE=1 present, Skipping upgrade check ")
12
+ return
13
+
14
+ import json
15
+ import urllib.request
16
+ from packaging import version
17
+ import importlib.metadata
18
+
19
+ package_name = "lightning-pose-app"
20
+ try:
21
+ current_version = importlib.metadata.version(package_name)
22
+ # Fetch latest version from PyPI
23
+ with urllib.request.urlopen(
24
+ f"https://pypi.org/pypi/{package_name}/json", timeout=5
25
+ ) as response:
26
+ data = json.load(response)
27
+ latest_version = data["info"]["version"]
28
+
29
+ if version.parse(latest_version) > version.parse(current_version):
30
+ print(
31
+ dedent(
32
+ f"""
33
+ {'-' * 80}
34
+ 🚀 A new version of {package_name} is available: {latest_version} (current: {current_version})
35
+
36
+ To upgrade, run:
37
+ pip install --upgrade {package_name}
38
+
39
+ To skip this check in the future, use the LP_IGNORE_UPGRADE env variable:
40
+ LP_IGNORE_UPGRADE=1 litpose run_app
41
+ {'-' * 80}
42
+ """
43
+ )
44
+ )
45
+
46
+ sys.exit(0)
47
+ except Exception as e:
48
+ # Don't block startup if PyPI is down or package isn't installed via pip
49
+ logger.debug(f"Upgrade check failed: {e}")