Skip to content

Commit c05652e

Browse files
authored
Merge pull request #1 from Juliaj/dev
feat: Implement a classifer for rock, paper and scisssor gesture
2 parents c154cdc + cd0472e commit c05652e

28 files changed

Lines changed: 4071 additions & 1 deletion

.envrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Use pixi for environment management
2+
watch_file pixi.lock
3+
eval "$(pixi shell-hook -e dev)"
4+
5+
# Unset ROS environment variables to avoid conflicts
6+
source scripts/unset_ros2_env.sh

.github/workflows/test.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Test
2+
3+
on:
4+
pull_request: {}
5+
push:
6+
branches: main
7+
8+
jobs:
9+
test:
10+
strategy:
11+
matrix:
12+
python-version: ['3.12']
13+
os: [ubuntu-latest]
14+
15+
name: Python ${{ matrix.os }} ${{ matrix.python-version }}
16+
runs-on: ${{ matrix.os }}
17+
18+
steps:
19+
- uses: actions/checkout@v5
20+
21+
- uses: actions/setup-python@v6
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- uses: prefix-dev/setup-pixi@v0.9.1
26+
with:
27+
pixi-version: v0.63.2
28+
cache: true
29+
environments: dev
30+
31+
- name: Download hand landmarker model
32+
run: |
33+
mkdir -p models
34+
curl -L -o models/hand_landmarker.task \
35+
https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/1/hand_landmarker.task
36+
37+
- run: pixi run fmt
38+
- run: pixi run lint
39+
- run: pixi run types
40+
- name: Run tests
41+
run: pixi run test -m "not slow" -v --tb=short --timeout=60

.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
7+
# Distribution / packaging
8+
build/
9+
dist/
10+
*.egg-info/
11+
*.egg
12+
13+
# Virtual environments
14+
.env
15+
.venv
16+
venv/
17+
ENV/
18+
19+
# Testing
20+
.pytest_cache/
21+
.cache
22+
23+
# Ruff
24+
.ruff_cache/
25+
26+
# Pixi
27+
.pixi
28+
29+
# Models (large files)
30+
models/*.task
31+
!models/.gitkeep
32+
33+
# Data files (large binary files)
34+
# Ignore .jpg images in data subfolders, but allow .zip files
35+
# Allow .npz files (processed features are small and useful for reproducibility)
36+
data/**/*.jpg

.pre-commit-config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.15.0
4+
hooks:
5+
- id: ruff
6+
args: [--fix]
7+
- id: ruff-format
8+
9+
- repo: https://github.com/pre-commit/pre-commit-hooks
10+
rev: v5.0.0
11+
hooks:
12+
- id: trailing-whitespace
13+
- id: end-of-file-fixer
14+
- id: check-yaml
15+
- id: check-added-large-files
16+
args: ['--maxkb=20000']
17+
exclude: '\.zip$'

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
# motionhand
1+
# handmotion
2+
23
Hand Gesture Classifier
4+
5+
![License](https://img.shields.io/badge/license-Apache%202.0-blue)
6+
[![Powered by: Pixi](https://img.shields.io/badge/Powered_by-Pixi-facc15)](https://pixi.sh)

data/processed/rps/data.npz

209 KB
Binary file not shown.

data/raw/rps.zip

11.7 MB
Binary file not shown.

docs/DEVELOPMENT.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Development Guide
2+
3+
## Development Workflow
4+
5+
### Initial Setup
6+
7+
```bash
8+
# Install dependencies
9+
pixi install
10+
11+
# Activate the dev environment (or use direnv for automatic activation)
12+
pixi shell -e dev
13+
```
14+
15+
### Common Tasks
16+
17+
```bash
18+
# pre-commit check
19+
pixi run pre-commit
20+
21+
# Run tests
22+
pixi run test
23+
24+
# Run all checks (format, lint, types, test)
25+
pixi run all
26+
```
27+
28+
### Adding Dependencies
29+
30+
```bash
31+
# Add a conda dependency
32+
pixi add <package-name>
33+
34+
# Add a PyPI dependency
35+
pixi add --pypi <package-name>
36+
37+
# Add a dev dependency
38+
pixi add --dev <package-name>
39+
```
40+
## Environment Setup
41+
42+
The project uses `.envrc` for automatic environment activation via direnv.
43+
44+
### What is `.envrc`?
45+
46+
The `.envrc` file is used by direnv to automatically load environment variables when you enter the project directory.
47+
48+
**Contents:**
49+
- `watch_file pixi.lock` - Tells direnv to reload when `pixi.lock` changes (e.g., after adding dependencies)
50+
- `eval "$(pixi shell-hook -e dev)"` - Activates the pixi dev environment, setting up the Python environment, PATH, and other variables
51+
52+
**How it works:**
53+
- When you `cd` into the project directory, direnv automatically activates the pixi dev environment
54+
- When you leave, it deactivates
55+
- No need to manually run `pixi shell` or activate virtual environments
56+
57+
**Setup required:**
58+
- Install `direnv` and add it to your shell (usually a one-time setup)
59+
- Run `direnv allow` once in the project directory to trust the `.envrc` file
60+
61+
This keeps your development environment activated automatically as you work.

handmotion/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""Hand gesture classifier package."""
2+
3+
__version__ = "0.0.1"

0 commit comments

Comments
 (0)