Spaces:
Running
Running
| # Packaging & Publishing to Reachy Mini | |
| This app follows the standard Reachy Mini app contract: | |
| - A `FaceDetection(ReachyMiniApp)` class implementing `run(reachy_mini, stop_event)`. | |
| - A `__main__` block in `face_detection/main.py` that calls `FaceDetection().wrapped_run()`. | |
| - A `reachy_mini_apps` entry point in `pyproject.toml`: | |
| ```toml | |
| [project.entry-points."reachy_mini_apps"] | |
| reachy-mini-face-detection = "face_detection.main:FaceDetection" | |
| ``` | |
| - A `reachy_mini_python_app` tag in `README.md` frontmatter (required for the app store). | |
| ## 1. Validate the structure | |
| ```bash | |
| uv pip install reachy-mini | |
| reachy-mini-app-assistant check . | |
| ``` | |
| ## 2. Test locally against the daemon | |
| You can run the app directly while the daemon is up (use `--sim` if you have no | |
| hardware): | |
| ```bash | |
| reachy-mini-daemon --sim # or: reachy-mini-daemon (Lite) | |
| python -m face_detection.main | |
| ``` | |
| Or install it and drive it from the dashboard like a real user: | |
| ```bash | |
| uv pip install -e . | |
| # open http://127.0.0.1:8000/ -> the app appears in the installed list | |
| ``` | |
| ## 3. Publish to Hugging Face | |
| ```bash | |
| uv pip install --upgrade huggingface_hub | |
| hf auth login # token needs Write permission | |
| # First time: create the Space + git remote from this folder | |
| reachy-mini-app-assistant publish . | |
| # Subsequent updates | |
| git add . && git commit -m "update" && git push | |
| ``` | |
| Once published, any Reachy Mini owner can install it in one click from the | |
| dashboard (its README carries the `reachy_mini_python_app` tag). | |
| ## 4. Install on a robot | |
| **From the dashboard:** click *Install* on the app. | |
| **Via REST API:** | |
| ```bash | |
| curl -X POST http://reachy-mini.local:8000/api/apps/install \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"url": "https://huggingface.co/spaces/<user>/reachy_mini_face_detection"}' | |
| curl -X POST http://reachy-mini.local:8000/api/apps/start-app/face_detection | |
| curl -X POST http://reachy-mini.local:8000/api/apps/stop-current-app | |
| ``` | |
| **Offline (e.g. at a conference, Wireless unit):** | |
| ```bash | |
| scp -r . pollen@reachy-mini.local:/tmp/face_detection | |
| ssh pollen@reachy-mini.local "/venvs/apps_venv/bin/pip install /tmp/face_detection" | |
| ``` | |
| ## Notes | |
| - `numpy` and `opencv-python` are the only runtime dependencies; both ship | |
| prebuilt wheels for Windows, Linux and macOS, and the Haar cascades are | |
| bundled with OpenCV (no model download). | |
| - The robot SDK (`reachy-mini`) is an optional `[robot]` extra so the detection | |
| and behaviour logic can be developed and tested on any laptop. | |