accelerometry-annotator 3.2.0__py3-none-any.whl
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.
- accelerometry_annotator-3.2.0.dist-info/METADATA +218 -0
- accelerometry_annotator-3.2.0.dist-info/RECORD +21 -0
- accelerometry_annotator-3.2.0.dist-info/WHEEL +5 -0
- accelerometry_annotator-3.2.0.dist-info/licenses/LICENSE +22 -0
- accelerometry_annotator-3.2.0.dist-info/top_level.txt +1 -0
- visualize_accelerometry/__init__.py +1 -0
- visualize_accelerometry/app.py +1193 -0
- visualize_accelerometry/callbacks.py +631 -0
- visualize_accelerometry/config.py +79 -0
- visualize_accelerometry/data_loading.py +243 -0
- visualize_accelerometry/js/download.js +32 -0
- visualize_accelerometry/plotting.py +239 -0
- visualize_accelerometry/state.py +164 -0
- visualize_accelerometry/static/favicon.ico +0 -0
- visualize_accelerometry/static/favicon.svg +21 -0
- visualize_accelerometry/static/logo-dark.svg +41 -0
- visualize_accelerometry/static/logo.jpg +0 -0
- visualize_accelerometry/static/logo.svg +41 -0
- visualize_accelerometry/templates/index.html +26 -0
- visualize_accelerometry/templates/login.html +159 -0
- visualize_accelerometry/templates/logout.html +124 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: accelerometry-annotator
|
|
3
|
+
Version: 3.2.0
|
|
4
|
+
Summary: Web-based tool for visualizing and annotating wrist-worn accelerometry data from physical performance assessments.
|
|
5
|
+
Author-email: Manu Murugesan <manorathan@uchicago.edu>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/TavoloPerUno/py_visualize_accelerometry
|
|
8
|
+
Project-URL: Documentation, https://tavoloperuno.github.io/py_visualize_accelerometry/
|
|
9
|
+
Project-URL: Demo, https://tavoloperuno-accelerometry-viewer-demo.hf.space/
|
|
10
|
+
Project-URL: Repository, https://github.com/TavoloPerUno/py_visualize_accelerometry
|
|
11
|
+
Project-URL: Issues, https://github.com/TavoloPerUno/py_visualize_accelerometry/issues
|
|
12
|
+
Keywords: accelerometry,annotation,wearable-sensors,gait-analysis,physical-performance,time-series,data-visualization,bokeh,panel
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
24
|
+
Requires-Python: >=3.9
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: bokeh<3.4,>=3.3
|
|
28
|
+
Requires-Dist: panel<1.4,>=1.3
|
|
29
|
+
Requires-Dist: pandas
|
|
30
|
+
Requires-Dist: numpy
|
|
31
|
+
Requires-Dist: tables
|
|
32
|
+
Requires-Dist: openpyxl
|
|
33
|
+
Requires-Dist: jinja2
|
|
34
|
+
Provides-Extra: lttb
|
|
35
|
+
Requires-Dist: lttbc; extra == "lttb"
|
|
36
|
+
Dynamic: license-file
|
|
37
|
+
|
|
38
|
+
# Accelerometry Annotation Tool
|
|
39
|
+
|
|
40
|
+
A web-based application for visualizing and annotating wrist-worn accelerometry data from physical performance assessments. Built with [Panel](https://panel.holoviz.org/) and [Bokeh](https://bokeh.org/), it enables research teams to collaboratively label activity segments in large time-series recordings.
|
|
41
|
+
|
|
42
|
+

|
|
43
|
+
|
|
44
|
+
## Live Demo
|
|
45
|
+
|
|
46
|
+
A publicly accessible demo is hosted on Hugging Face Spaces:
|
|
47
|
+
|
|
48
|
+
**[Launch Demo](https://tavoloperuno-accelerometry-viewer-demo.hf.space/)**
|
|
49
|
+
|
|
50
|
+
| Username | Password | Role |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| `demo_admin` | `demo` | Admin (can manage users, impersonate) |
|
|
53
|
+
| `demo_user` | `demo` | Annotator |
|
|
54
|
+
|
|
55
|
+
> **Note:** The demo uses real accelerometer data from the dataset below,
|
|
56
|
+
> resampled and composed into short recordings (~10 min at 85 Hz). It does
|
|
57
|
+
> not contain real participant recordings. Example annotations are
|
|
58
|
+
> pre-populated to showcase labeling, flags, and inter-annotator variability.
|
|
59
|
+
>
|
|
60
|
+
> Alharbi, F. (2022). *Accelerometer Gyro Mobile Phone Dataset* [Dataset]. UCI Machine Learning Repository. https://doi.org/10.3390/s22176513
|
|
61
|
+
|
|
62
|
+
## Shared Server Deployment (HPC / Slurm)
|
|
63
|
+
|
|
64
|
+
For HPC environments, you can run a single shared instance via Slurm that all team members connect to through SSH tunneling.
|
|
65
|
+
|
|
66
|
+
**Connect** (each user — submits job automatically if not running):
|
|
67
|
+
```bash
|
|
68
|
+
bash hpc_utils/connect.sh
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Stop the server**:
|
|
72
|
+
```bash
|
|
73
|
+
bash hpc_utils/stop_server.sh
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## What it does
|
|
77
|
+
|
|
78
|
+
Researchers collect tri-axial accelerometry signals (x, y, z) during standardized physical performance tests. This tool lets annotators visually inspect those signals and mark the time boundaries of each test:
|
|
79
|
+
|
|
80
|
+
- **Chair Stand Test** — Measures lower-extremity strength by timing repeated sit-to-stand cycles from a standard chair. A key indicator of fall risk and functional independence in older adults.
|
|
81
|
+
- **Timed Up and Go (TUG)** — Assesses functional mobility: the participant rises from a chair, walks 3 meters, turns, walks back, and sits down. Taking 12+ seconds indicates increased fall risk (CDC STEADI).
|
|
82
|
+
- **3-Meter Walk Test** — Measures gait speed over a short distance as a proxy for mobility and physical function. Gait speed is widely regarded as "the sixth vital sign" for predicting disability and mortality.
|
|
83
|
+
- **6-Minute Walk Test** — A submaximal endurance test where the participant walks as far as possible in 6 minutes. Used to evaluate aerobic capacity in cardiac and pulmonary research.
|
|
84
|
+
|
|
85
|
+
## Features
|
|
86
|
+
|
|
87
|
+
- **LTTB downsampling** — Renders 500K+ data points smoothly by reducing to ~5,000 visually representative points using the Largest Triangle Three Buckets algorithm
|
|
88
|
+
- **Range selector** — Minimap for navigating long recordings without losing context
|
|
89
|
+
- **Box-select annotation** — Select a time range and label it with one click
|
|
90
|
+
- **Segment, scoring, and review flags** — Mark annotations for segmentation, scoring, or review with distinct hatch-pattern overlays
|
|
91
|
+
- **Notes** — Attach free-text notes to any annotation
|
|
92
|
+
- **Multi-user collaboration** — Each annotator sees their own file assignments; admins can impersonate users and manage accounts
|
|
93
|
+
- **Authentication** — Built-in basic auth (or OAuth for production deployments)
|
|
94
|
+
- **Auto-save to Excel** — Per-user annotation files for easy downstream analysis
|
|
95
|
+
|
|
96
|
+
## Installation
|
|
97
|
+
|
|
98
|
+
### Prerequisites
|
|
99
|
+
|
|
100
|
+
- Python 3.9+
|
|
101
|
+
- Conda (recommended) or pip
|
|
102
|
+
|
|
103
|
+
### Setup
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Clone the repository
|
|
107
|
+
git clone git@github.com:TavoloPerUno/py_visualize_accelerometry.git
|
|
108
|
+
cd py_visualize_accelerometry
|
|
109
|
+
|
|
110
|
+
# Create and activate conda environment
|
|
111
|
+
conda create -n panel_app python=3.12
|
|
112
|
+
conda activate panel_app
|
|
113
|
+
|
|
114
|
+
# Install dependencies
|
|
115
|
+
pip install -r requirements.txt
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Data setup
|
|
119
|
+
|
|
120
|
+
Place HDF5 accelerometry files (`.h5`) in:
|
|
121
|
+
```
|
|
122
|
+
visualize_accelerometry/data/readings/
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Each file should contain a `readings` table with columns: `timestamp`, `x`, `y`, `z`.
|
|
126
|
+
|
|
127
|
+
### Credentials
|
|
128
|
+
|
|
129
|
+
Create a `credentials.json` file in the project root:
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"username1": "password1",
|
|
133
|
+
"username2": "password2"
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
See `credentials.json.example` for reference.
|
|
138
|
+
|
|
139
|
+
## Running the app
|
|
140
|
+
|
|
141
|
+
### Local development
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
panel serve visualize_accelerometry/app.py \
|
|
145
|
+
--port 5601 \
|
|
146
|
+
--basic-auth credentials.json \
|
|
147
|
+
--cookie-secret $(python -c "import secrets; print(secrets.token_hex(32))") \
|
|
148
|
+
--allow-websocket-origin localhost:5601 \
|
|
149
|
+
--basic-login-template visualize_accelerometry/templates/login.html
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Then open http://localhost:5601/app in your browser.
|
|
153
|
+
|
|
154
|
+
### HPC (SLURM)
|
|
155
|
+
|
|
156
|
+
See [Shared server startup](docs/shared-server-startup.md) for the self-service shared server workflow, or [Slurm deployment guide](docs/slurm-deployment.md) for the full deployment guide.
|
|
157
|
+
|
|
158
|
+
## Project structure
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
py_visualize_accelerometry/
|
|
162
|
+
├── visualize_accelerometry/
|
|
163
|
+
│ ├── app.py # Main Panel application and layout
|
|
164
|
+
│ ├── callbacks.py # UI event handlers and annotation logic
|
|
165
|
+
│ ├── config.py # Colors, paths, user lists, constants
|
|
166
|
+
│ ├── data_loading.py # HDF5 I/O, annotation file management
|
|
167
|
+
│ ├── plotting.py # Bokeh plots with LTTB downsampling
|
|
168
|
+
│ ├── state.py # Per-session state management
|
|
169
|
+
│ ├── templates/ # Login/logout HTML templates
|
|
170
|
+
│ ├── static/ # Favicon, logo
|
|
171
|
+
│ └── data/
|
|
172
|
+
│ ├── readings/ # HDF5 accelerometry files
|
|
173
|
+
│ └── output/ # Per-user annotation Excel files
|
|
174
|
+
├── hpc_utils/ # HPC deployment scripts (Slurm, SSH tunneling)
|
|
175
|
+
│ ├── connect.sh # Self-service connect script
|
|
176
|
+
│ ├── start_server.sh # Slurm job script
|
|
177
|
+
│ ├── stop_server.sh # Stop running server
|
|
178
|
+
│ └── logs/ # Job and server logs
|
|
179
|
+
├── requirements.txt
|
|
180
|
+
└── credentials.json # Auth credentials (not in repo)
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Documentation
|
|
184
|
+
|
|
185
|
+
Full documentation is available at [https://tavoloperuno.github.io/py_visualize_accelerometry/](https://tavoloperuno.github.io/py_visualize_accelerometry/).
|
|
186
|
+
|
|
187
|
+
To build documentation locally:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
pip install sphinx sphinx-rtd-theme myst-parser
|
|
191
|
+
cd docs
|
|
192
|
+
make html
|
|
193
|
+
open _build/html/index.html
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Versioning and releases
|
|
197
|
+
|
|
198
|
+
This project uses [Semantic Versioning](https://semver.org/). The canonical version lives in `visualize_accelerometry/__init__.py` as `__version__`.
|
|
199
|
+
|
|
200
|
+
### Cutting a release
|
|
201
|
+
|
|
202
|
+
1. Update `__version__` in `visualize_accelerometry/__init__.py`
|
|
203
|
+
2. Update `CHANGELOG.md` with the new version's changes
|
|
204
|
+
3. Commit the changes:
|
|
205
|
+
```bash
|
|
206
|
+
git add visualize_accelerometry/__init__.py CHANGELOG.md
|
|
207
|
+
git commit -m "release: v<VERSION>"
|
|
208
|
+
```
|
|
209
|
+
4. Create and push the tag:
|
|
210
|
+
```bash
|
|
211
|
+
git tag v<VERSION>
|
|
212
|
+
git push git v<VERSION>
|
|
213
|
+
```
|
|
214
|
+
5. The `release.yml` GitHub Actions workflow will automatically create a GitHub Release with auto-generated notes from commits since the last tag.
|
|
215
|
+
|
|
216
|
+
## License
|
|
217
|
+
|
|
218
|
+
This project is developed by the [National Social Life, Health, and Aging Project (NSHAP)](https://www.norc.org/research/projects/national-social-life-health-and-aging-project.html) lab at the University of Chicago.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
accelerometry_annotator-3.2.0.dist-info/licenses/LICENSE,sha256=24OmAApTAqr0wMqDnUbzu3Wwt-_rKwIsmWZxFuejOz0,1135
|
|
2
|
+
visualize_accelerometry/__init__.py,sha256=OUX37Yd6ZO82d0GJL2dmK0gZTtc_xvlTvGQIl2I-D8k,22
|
|
3
|
+
visualize_accelerometry/app.py,sha256=oDwOLdpGEqhS7vYdE90vGkbot7bq0ngPIUBgPwQSpX4,44309
|
|
4
|
+
visualize_accelerometry/callbacks.py,sha256=QA38LkPdx58jsp4VOvFsN8z_WREGrj6p25kIgIGnxVg,24331
|
|
5
|
+
visualize_accelerometry/config.py,sha256=jn1em9kU3I0r9dlx_K1ZbxisqNRTZEWNBlIdvg3Gwe0,3108
|
|
6
|
+
visualize_accelerometry/data_loading.py,sha256=FCoV0pVEzexdUZ67yeNYeHxfs2_6IbazcyxAim2bzmQ,7884
|
|
7
|
+
visualize_accelerometry/plotting.py,sha256=-Hf93NnrdOt13Dlpi12lb_rQS0LP7vS48zsPWi0BCak,8686
|
|
8
|
+
visualize_accelerometry/state.py,sha256=XD9eFPqykX2t1meE5jE412xQI3wc5pTcVKPRjl7QKPg,6153
|
|
9
|
+
visualize_accelerometry/js/download.js,sha256=sXDdJJXQHN33b1RtqMAtOX8Fqzu8iJ-ITezuJNpAzAk,921
|
|
10
|
+
visualize_accelerometry/static/favicon.ico,sha256=gfs-mRx1Xhw4W3ljhkri-jsLYUT9L-QrSzzz0-mXfMQ,63276
|
|
11
|
+
visualize_accelerometry/static/favicon.svg,sha256=YRzC7kvrawoZVSGDy13zIVEtNnTSZIJGArt1PnhHxO0,1256
|
|
12
|
+
visualize_accelerometry/static/logo-dark.svg,sha256=I1V26j0tj8VkJRolw3eh-s8yEuCw2gLpyl2ITyYoLkk,2383
|
|
13
|
+
visualize_accelerometry/static/logo.jpg,sha256=gfs-mRx1Xhw4W3ljhkri-jsLYUT9L-QrSzzz0-mXfMQ,63276
|
|
14
|
+
visualize_accelerometry/static/logo.svg,sha256=yEz7qqFDUItZJha94oE9Ze9gYfyYBLF4OwTNi5kXaAM,2349
|
|
15
|
+
visualize_accelerometry/templates/index.html,sha256=kVwp2zoQDednF3fF2-TwaCg4nqD1PFqPbf9MM3Qn-_E,656
|
|
16
|
+
visualize_accelerometry/templates/login.html,sha256=IZKShhDbNV13PpZkBadbGhHCFJzjhO6q_KFTa3dWXEU,9858
|
|
17
|
+
visualize_accelerometry/templates/logout.html,sha256=hpdp45-cHxQMkrNqWiIDfgGj6OzUsw2Qas2VPnrGtO4,7120
|
|
18
|
+
accelerometry_annotator-3.2.0.dist-info/METADATA,sha256=DP0K8qaKJrjhcUas0dSXwCQSTvusnqN68sdI3Q-s3Cw,8948
|
|
19
|
+
accelerometry_annotator-3.2.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
20
|
+
accelerometry_annotator-3.2.0.dist-info/top_level.txt,sha256=qWW2zE_4GqJHwfAfmDhxXeJ5kbdLd3Fw6wene6gq_YU,24
|
|
21
|
+
accelerometry_annotator-3.2.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 National Social Life, Health, and Aging Project (NSHAP),
|
|
4
|
+
University of Chicago
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
visualize_accelerometry
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "3.2.0"
|