-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (54 loc) · 2.01 KB
/
Copy pathMakefile
File metadata and controls
72 lines (54 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.PHONY: install install-dev format lint test clean run
install:
@if [ ! -d ".venv" ]; then uv venv; else echo "Virtual environment already exists, skipping uv venv"; fi
uv pip install -e .
install-dev:
uv pip install -e ".[dev]"
format:
black handpose examples tests
ruff check --fix handpose examples tests
lint:
black --check handpose examples tests
ruff check handpose examples tests
mypy handpose
test:
pytest tests
py-files := $(shell find handpose examples tests -name '*.py')
static-checks:
@black --diff --check $(py-files)
@ruff check $(py-files)
@python -m pip install "numpy>=1.21.0,<2.0" --quiet
@mypy --install-types --non-interactive $(py-files)
.PHONY: lint
ik:
.venv/bin/mjpython examples/live_demo_ik.py --model orca_hand_fixed.mjcf --scale 1.0
ik-dual:
.venv/bin/mjpython examples/live_demo_ik.py --model orca_hand_fixed.mjcf --scale 1.0 --dual
manual:
.venv/bin/mjpython examples/live_demo.py --dual
clean:
rm -rf build/ dist/ *.egg-info
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
rm -rf .mypy_cache .pytest_cache .ruff_cache
SHELL := /bin/bash
PYTHON := python
PIP := python -m pip
# 1. Install prerequisites required to compile C extensions
install-build-deps:
@echo "Installing build dependencies..."
$(PIP) install --upgrade pip setuptools wheel
$(PIP) install "numpy" "cython" "torch" "torchvision"
# 2. Install xtcocotools manually without build isolation
install-xtcocotools:
@echo "Installing xtcocotools (no build isolation)..."
$(PIP) install xtcocotools==1.14.3 --no-build-isolation
install-detectron2:
@echo "Installing Detectron2..."
$(PIP) install "git+https://github.com/facebookresearch/detectron2.git" --no-build-isolation
# 4. Install HaMeR in editable mode
install-hamer: install-build-deps install-xtcocotools install-detectron2
@echo "Installing HaMeR..."
cd third_party/hamer && $(PIP) install . --no-build-isolation
# Install all dependencies
install-deps: install-build-deps install-xtcocotools install-detectron2 install-hamer