MediaPipe
hand-tracking
opencv
gesture-recognition
computer-vision
real-time
human-computer-interaction
Instructions to use Noor-Khan/vision-hands with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MediaPipe
How to use Noor-Khan/vision-hands with MediaPipe:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Download tests/test_cli.py from Noor-Khan/vision-hands: direct link, hf CLI and curl.
- Browser
- Download file 1.73 kB
-
https://huggingface.co/Noor-Khan/vision-hands/resolve/main/tests/test_cli.py
- Command line
-
hf download hf://Noor-Khan/vision-hands/tests/test_cli.py
-
curl -L -o test_cli.py https://huggingface.co/Noor-Khan/vision-hands/resolve/main/tests/test_cli.py
1.73 kB
| import pytest | |
| from handportal.cli import parse_args | |
| def test_cli_overrides_runtime_options(): | |
| args = parse_args(["--camera", "2", "--width", "640", "--height", "360", "--windowed"]) | |
| assert (args.camera, args.width, args.height) == (2, 640, 360) | |
| assert args.windowed is True | |
| def test_cli_rejects_invalid_dimensions(): | |
| with pytest.raises(SystemExit): | |
| parse_args(["--width", "0"]) | |
| def test_cli_rejects_oversized_dimensions(): | |
| # Only "positive" was checked, so --width 100000 reached | |
| # make_vignette_layer at startup and died allocating a gigantic | |
| # array instead of failing with a clear usage error. | |
| with pytest.raises(SystemExit): | |
| parse_args(["--width", "100000", "--height", "720"]) | |
| with pytest.raises(SystemExit): | |
| parse_args(["--width", "1280", "--height", "5000"]) | |
| def test_cli_accepts_8k_dimensions(): | |
| args = parse_args(["--width", "7680", "--height", "4320"]) | |
| assert (args.width, args.height) == (7680, 4320) | |
| def test_cli_rejects_negative_camera_index(): | |
| with pytest.raises(SystemExit): | |
| parse_args(["--camera", "-1"]) | |
| def test_cli_rejects_out_of_range_pinch_threshold(): | |
| with pytest.raises(SystemExit): | |
| parse_args(["--pinch-threshold", "0.5"]) | |
| def test_cli_rejects_missing_model_file(): | |
| # A typo'd --model path used to silently download a fresh model to the | |
| # mistyped path instead of failing fast. | |
| with pytest.raises(SystemExit): | |
| parse_args(["--model", "no-such-model.task"]) | |
| def test_cli_accepts_existing_model_file(tmp_path): | |
| model = tmp_path / "hand_landmarker.task" | |
| model.write_bytes(b"fake-model") | |
| args = parse_args(["--model", str(model)]) | |
| assert args.model == str(model) | |