A PyQt5 desktop app for labeling anatomical keypoints on rasterised anthropomorph figures from a GeoJSON dataset.
- loads anthropomorph features from
full_annotations.geojson - keeps all anthropomorphs with completeness filtering disabled
- converts polygon coordinates to local cartesian space
- projects shapes to 2D
- rasterises each figure to a
448 x 448mask - lets you annotate key anatomical points in a guided sequence
- saves labels to
keypoint_labels.json - resumes on the first figure whose
shape_idis not already in the saved labels file
- raster size:
448 x 448 - output labels file:
keypoint_labels.json - expected input dataset filename:
full_annotations.geojson
The app looks for full_annotations.geojson next to the script or next to the built executable. If it is not found there, it also checks the current working directory.
Left-click: place current keypoint and advanceRight-click: remove nearest keypointG: skip the current stage or limb sectionNorRight Arrow: save and go to next figureLeft Arrow: save and go to previous figureU: undo last placed or removed pointDeleteorBackspace: clear current figure labelsS: save labelsX: toggle horizontal flipY: toggle vertical flip
The guided keypoint order is:
- head
- neck
- torso mid
- pelvis
- leg 1 knee
- leg 1 foot
- leg 2 knee
- leg 2 foot
- arm 1 elbow
- arm 1 hand
- arm 2 elbow
- arm 2 hand
- Python 3.11 recommended
- the packages listed in
requirements.txt
Create a virtual environment if you want to keep dependencies isolated.
Install dependencies:
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
Run the app:
python3 keypoint_labeler.py
Place full_annotations.geojson in the project directory before running the app locally.
If you build the Windows executable, place full_annotations.geojson next to keypoint_labeler.exe unless it is already included in the build artifact.
The app writes:
keypoint_labels.json
This file is written next to the script during local runs, or next to the executable in packaged runs.
This repository includes a GitHub Actions workflow at .github/workflows/build-windows-exe.yml.
It will:
- run on GitHub-hosted Windows
- install Python dependencies
- build
keypoint_labeler.exewithPyInstaller - upload the built files as an artifact named
keypoint_labeler-windows
- Push this repository to GitHub.
- Open the repository on GitHub.
- Go to the Actions tab.
- Run the Build Windows executable workflow, or trigger it by pushing a commit.
- Download the
keypoint_labeler-windowsartifact from the workflow run.
If you are on Windows, you can also build locally with:
build_exe.bat
The built executable will be created at dist\keypoint_labeler.exe.
keypoint_labeler.py— main PyQt5 applicationutils.py— geometry, conversion, and helper functionsrequirements.txt— Python dependenciesbuild_exe.bat— local Windows build script.github/workflows/build-windows-exe.yml— GitHub Actions workflow for Windows builds
- this is a native desktop app, so packaged outputs are platform-specific
- GitHub Actions is used here to build a real Windows
.exewithout needing a local Windows machine - the source code remains cross-platform even though build artifacts are OS-specific