Skip to main content

glider-dlc

Run DeepLabCut pose models in GLIDER.

Install this, point GLIDER at the folder DeepLabCut wrote, and it converts once and runs. There is nothing to export beforehand and no command to remember.

uv pip install glider-dlc

What it does

GLIDER runs pose models through onnxruntime, described by a glider_pose.json sidecar next to the model. DeepLabCut writes a pytorch_config.yaml and a snapshot-*.pt. This plugin is the bridge: it recognises the second shape and produces the first.

Pick a model folder in the Camera panel — the train folder, or the project above it. If it is a DeepLabCut folder that has not been converted, GLIDER asks once, converts, and writes model.onnx and glider_pose.json beside the snapshot. Every later run loads the ONNX directly. Retrain and drop a new snapshot in and it notices the stamp is stale and offers to convert again — a conversion that quietly answered with the network you just replaced would be the worst outcome available.

The environment it builds

DeepLabCut cannot live in GLIDER's environment. It is needed to read a snapshot at all — a DLC checkpoint is a bare PyTorch state_dict, so rebuilding the network from one needs DeepLabCut's own model classes — but it brings torch, timm, albumentations and a long tail with it, about 1.3 GB installed.

The alternative to putting it there is not making you build an environment by hand. It is building one for you. The first time you select a DeepLabCut model, this plugin uses uv to create a private Python 3.12 virtualenv under ~/.glider/envs/deeplabcut, installs DeepLabCut into it, and shells into that interpreter to convert. GLIDER's own environment is untouched. The dialog tells you the size before anything is downloaded, and it happens once per machine.

The plugin itself has no dependencies at all. uv is found on PATH — it is what GLIDER's own installer already uses — and its absence is reported with an install link rather than a crash.

Already have DeepLabCut working somewhere?

export GLIDER_DLC_ENV=/path/to/your/dlc/venv

Nothing is downloaded, and GLIDER converts in your environment instead.

Scope

DeepLabCut 3.x, single animal. A converted model runs as one decode per frame producing one set of keypoints, which is what the behaviour classifier downstream expects. Multi-animal models — the ones with a paf or identity head — are reported by name rather than converted wrongly.

DeepLabCut 2.x is TensorFlow, not PyTorch, and is not converted automatically. A 2.x folder is recognised and says so, rather than reporting a missing pytorch_config.yaml; export it by hand with tools/export_pose_onnx.py in your own DLC 2.x environment.

What is read, and what is refused

Everything in the sidecar comes from the model's own config or is measured from the network. Nothing is defaulted, because none of these fail loudly when wrong — a bad stride or normalisation shifts every keypoint by a constant and still draws a plausible skeleton:

Field Source
keypoint_names metadata.bodyparts — required, and must be unique
locref_stdev the head's predictor.locref_std — required unless location_refinement is off
mean / std / divide_by_255 data.inference.normalize_images, which means ImageNet statistics
pad_to_stride data.inference.auto_padding (32 for HRNet, absent for ResNet)
output_stride measured from the network, see below

The stride is measured rather than read because it is the backbone's stride divided by whatever the head's deconvolutions undo, and those move between backbones: a ResNet-50 and an HRNet-w32 trained on the same data differ by a factor of four. It is measured from two input sizes, not one, because every DeepLabCut head adds one cell past the edge (out = in / stride + 1) — a single ratio reads a stride-8 ResNet as 7.53 at 128 px and 7.88 at 512 px, while the difference between two sizes gives 8 exactly.

A model whose normalisation cannot be expressed in the sidecar (scale_to_unit_range, which rescales each frame against its own extremes) is refused rather than converted wrongly.

Verified

Against DeepLabCut 3.0.1 on Python 3.12 with torch 2.13, for both backbone families:

stride ONNX vs. DeepLabCut
ResNet-50 8 3.1e-06 relative
HRNet-w32 2 1.7e-06 relative

Both export with dynamic height and width, so any camera resolution runs against the same file, and both correctly detect a retrained snapshot as stale.

Development

uv pip install -e ./plugins/glider-dlc
PYTHONPATH="src;plugins/glider-dlc/src" QT_QPA_PLATFORM=offscreen pytest plugins/glider-dlc/tests/

The suite runs without DeepLabCut — that is the point of the plugin, so it is also the point of the tests. Every uv call is faked; what is checked is the decision-making around them, and the path and config logic GLIDER asks about before anything is downloaded.

The one test that performs a real conversion is marked slow and skips everywhere DeepLabCut is not importable, including CI. To run it, use the provisioned interpreter:

~/.glider/envs/deeplabcut/Scripts/python -m pytest plugins/glider-dlc -m slow

Metadata

Release files for glider-dlc 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for glider-dlc 0.1.0
File Size Uploaded Provenance Actions
glider_dlc-0.1.0.tar.gz 28.7 kB With provenance Details for glider_dlc-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for glider-dlc 0.1.0
File Interpreter ABI Platform Actions
glider_dlc-0.1.0-py3-none-any.whl Python 3 none any Details for glider_dlc-0.1.0-py3-none-any.whl

Total release size: 47.5 kB

Release files / glider_dlc-0.1.0.tar.gz

Download URL glider_dlc-0.1.0.tar.gz
Size 28.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7a9d4d4f2e406d4cfc24f7e0576b607f76497b9710c773498ce92e7f3bd919e8
BLAKE2b-256 checksum
How to use checksums
37b20c581f8889fe298b6fc445a4e705d13ac04ace25711e4bd476c7d0576156
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release files / glider_dlc-0.1.0-py3-none-any.whl

Download URL glider_dlc-0.1.0-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5090d5fc8cbaac3e8c44b724d13fcd2fbd4cbcb3c7b589f2c4efbd57e6a5c397
BLAKE2b-256 checksum
How to use checksums
b2f28e58af3571a88bd250ec1561b33e2dc0073688096c24c83e8803473a39f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Security for glider-dlc 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for glider_dlc-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page