Skip to content

Commit 15b265c

Browse files
authored
Merge branch 'main' into jaap/add_torchvision_detector
2 parents 3a791aa + eb15fa8 commit 15b265c

File tree

9 files changed

+93
-34
lines changed

9 files changed

+93
-34
lines changed
Lines changed: 50 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,59 @@
1-
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3-
name: Python package
1+
name: Update pypi release
42

53
on:
64
push:
7-
branches: [ main ]
5+
tags:
6+
- 'v*.*.*'
87
pull_request:
9-
branches: [ main ]
10-
8+
branches:
9+
- main
10+
- public
11+
types:
12+
- labeled
13+
- opened
14+
- edited
15+
- synchronize
16+
- reopened
1117

1218
jobs:
13-
build:
14-
19+
release:
1520
runs-on: ubuntu-latest
16-
strategy:
17-
# You can use PyPy versions in python-version. For example, pypy2 and pypy3
18-
matrix:
19-
python-version: ["3.10"]
2021

2122
steps:
22-
- uses: actions/checkout@v4
23-
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v4
25-
with:
26-
python-version: ${{ matrix.python-version }}
27-
# You can test your matrix by printing the current Python version
28-
- name: Display Python version
29-
run: python -c "import sys; print(sys.version)"
30-
#test installation of DLC-core dependencies:
31-
- name: Install dependencies
32-
run: pip install .
23+
- name: Setup Python
24+
id: setup-python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.x'
28+
29+
- name: Cache dependencies
30+
id: pip-cache
31+
uses: actions/cache@v4
32+
with:
33+
path: ~/.cache/pip
34+
key: ${{ runner.os }}-pip-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('pyproject.toml', 'requirements.txt', 'setup.cfg', 'setup.py') }}
35+
restore-keys: |
36+
${{ runner.os }}-pip-${{ steps.setup-python.outputs.python-version }}-
37+
${{ runner.os }}-pip-
38+
39+
- name: Install dependencies
40+
run: |
41+
pip install --upgrade pip
42+
pip install wheel
43+
pip install "packaging>=24.2"
44+
pip install build
45+
pip install twine
46+
47+
- name: Checkout code
48+
uses: actions/checkout@v4
49+
50+
- name: Build and publish to PyPI
51+
if: ${{ github.event_name == 'push' }}
52+
env:
53+
TWINE_USERNAME: __token__
54+
TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
55+
run: |
56+
python -m build
57+
ls dist/
58+
tar tvf dist/deeplabcut_live-*.tar.gz
59+
python3 -m twine upload --verbose dist/*

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ authors:
5252
date-released: 2020-08-05
5353
doi: "10.7554/eLife.61909"
5454
license: "AGPL-3.0-or-later"
55-
version: "1.1.0"
55+
version: "1.1.1rc1"

MANIFEST.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
include dlclive/check_install/*
1+
include dlclive/check_install/*
2+
include dlclive/modelzoo/model_configs/*.yaml
3+
include dlclive/modelzoo/project_configs/*.yaml

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,18 @@ DeepLabCut-live can be installed from PyPI with PyTorch or Tensorflow directly:
7777
uv pip install deeplabcut-live[pytorch] # or [tf]
7878
```
7979

80+
Note: On **Windows**, the `deeplabcut-live[pytorch]` extra will not install the required CUDA-enabled wheels for PyTorch by default. For GPU support, install CUDA-enabled PyTorch first, then install `deeplabcut-live[pytorch]`.
81+
8082
Please see our instruction manual for more elaborate information on how to install on a [Windows or Linux machine](
8183
docs/install_desktop.md) or on a [NVIDIA Jetson Development Board](
82-
docs/install_jetson.md). Note, this code works with PyTorch, TensorFlow 1 or TensorFlow
84+
docs/install_jetson.md).
85+
86+
This code works with PyTorch, TensorFlow 1 or TensorFlow
8387
2 models, but whatever engine you exported your model with, you must import with the
8488
same version (i.e., export a PyTorch model, then install PyTorch, export with TF1.13,
8589
then use TF1.13 with DlC-Live; export with TF2.3, then use TF2.3 with DLC-live).
8690

87-
Note, you can test your installation by running:
91+
You can test your installation by running:
8892

8993
```bash
9094
dlc-live-test

dlclive/modelzoo/pytorch_model_zoo_export.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,18 @@ def export_modelzoo_model(
1414
detector_name: str | None = None,
1515
) -> None:
1616
"""
17+
Export a DeepLabCut Model Zoo model to a single .pt file.
1718
19+
Downloads the model configuration and weights from HuggingFace, bundles them
20+
together (optionally with a detector), and saves as a single torch archive.
21+
Skips export if the output file already exists.
22+
23+
Args:
24+
export_path: Arbitrary destination path for the exported .pt file.
25+
super_animal: Super animal dataset name (e.g. "superanimal_quadruped").
26+
model_name: Pose model architecture name (e.g. "resnet_50").
27+
detector_name: Optional detector model name. If provided, detector
28+
weights are included in the export.
1829
"""
1930
Path(export_path).parent.mkdir(parents=True, exist_ok=True)
2031
if Path(export_path).exists():

dlclive/modelzoo/utils.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from pathlib import Path
1010

1111
from dlclibrary.dlcmodelzoo.modelzoo_download import download_huggingface_model
12+
from dlclibrary.dlcmodelzoo.modelzoo_download import _load_model_names as huggingface_model_paths
1213
from ruamel.yaml import YAML
1314

1415
from dlclive.modelzoo.resolve_config import update_config
@@ -50,10 +51,7 @@ def list_available_projects() -> list[str]:
5051

5152

5253
def list_available_combinations() -> list[str]:
53-
models = list_available_models()
54-
projects = list_available_projects()
55-
combinations = ["_".join([p, m]) for p in projects for m in models]
56-
return combinations
54+
return list(huggingface_model_paths.keys())
5755

5856

5957
def read_config_as_dict(config_path: str | Path) -> dict:

dlclive/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"""
88

99

10-
__version__ = "1.1.0"
10+
__version__ = "1.1.1rc1"
1111
VERSION = __version__

docs/install_desktop.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ Install from PyPI with PyTorch or TensorFlow:
3232
# Or using uv
3333
uv pip install deeplabcut-live[pytorch] # or [tf]
3434
```
35+
36+
### Windows-users with GPU:
37+
On **Windows**, the `deeplabcut-live[pytorch]` extra will not install the required CUDA-enabled wheels for PyTorch by default. Windows users with a CUDA GPU should install CUDA-enabled PyTorch first:
38+
39+
40+
```bash
41+
# First install PyTorch with CUDA support
42+
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu124
43+
44+
# Then install DeepLabCut-live (it will use the existing GPU-enabled PyTorch)
45+
pip install deeplabcut-live[pytorch]
46+
```
47+
3548

3649
## 2. Install from Git Repository
3750
If you want to install from a local clone of the repository, follow these steps:

pyproject.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "deeplabcut-live"
7-
version = "1.1.0"
7+
version = "1.1.1rc1"
88
description = "Class to load exported DeepLabCut networks and perform pose estimation on single frames (from a camera feed)"
99
readme = "README.md"
1010
requires-python = ">=3.10,<3.13"
@@ -89,7 +89,11 @@ include-package-data = true
8989
include = ["dlclive*"]
9090

9191
[tool.setuptools.package-data]
92-
dlclive = ["check_install/*"]
92+
dlclive = [
93+
"check_install/*",
94+
"modelzoo/model_configs/*.yaml",
95+
"modelzoo/project_configs/*.yaml",
96+
]
9397

9498
# [tool.ruff]
9599
# lint.select = ["E", "F", "B", "I", "UP"]

0 commit comments

Comments
 (0)