Spaces:
Sleeping
Sleeping
Commit
Β·
076371e
1
Parent(s):
6424d60
Initial Space setup
Browse files- README.md +66 -3
- app.py +149 -0
- requirements.txt +2 -0
README.md
CHANGED
|
@@ -1,7 +1,70 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
|
|
|
| 3 |
|
| 4 |
-
**
|
| 5 |
|
|
|
|
| 6 |
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Reachy Recognizer
|
| 3 |
+
emoji: π€
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 4.44.0
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
license: mit
|
| 11 |
+
---
|
| 12 |
|
| 13 |
+
# π€ Reachy Recognizer
|
| 14 |
|
| 15 |
+
**Human-Aware AI Companion for Reachy Mini**
|
| 16 |
|
| 17 |
+
A complete face recognition and conversational AI system that enables Reachy Mini robots to recognize people, greet them with personalized responses, and engage in natural voice conversations.
|
| 18 |
|
| 19 |
+
## β¨ Features
|
| 20 |
+
|
| 21 |
+
- **Face Recognition**: Real-time face detection and recognition using OpenCV DNN
|
| 22 |
+
- **Personalized Greetings**: Context-aware greetings based on person identity and time of day
|
| 23 |
+
- **Voice Conversation**: Natural language conversations powered by OpenAI GPT
|
| 24 |
+
- **Adaptive Behaviors**: Dynamic robot movements and expressions
|
| 25 |
+
- **Event System**: Smart debouncing and state management
|
| 26 |
+
|
| 27 |
+
## π Quick Installation
|
| 28 |
+
|
| 29 |
+
### Install to Your Reachy Robot
|
| 30 |
+
|
| 31 |
+
**[π₯ Click here to install to your Reachy](https://pollen-robotics.github.io/reachy_mini_app_example/?install=true)**
|
| 32 |
+
|
| 33 |
+
Or use the manual installation:
|
| 34 |
+
|
| 35 |
+
```bash
|
| 36 |
+
curl -X POST http://localhost:8000/api/install \
|
| 37 |
+
-H "Content-Type: application/json" \
|
| 38 |
+
-d '{"url": "https://github.com/chelleboyer/reachy-recognizer", "name": "reachy_recognizer"}'
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
### Manual Setup
|
| 42 |
+
|
| 43 |
+
```bash
|
| 44 |
+
git clone https://github.com/chelleboyer/reachy-recognizer.git
|
| 45 |
+
cd reachy-recognizer
|
| 46 |
+
pip install -e .
|
| 47 |
+
python main.py
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
## οΏ½ Documentation
|
| 51 |
+
|
| 52 |
+
- [Project Structure](https://github.com/chelleboyer/reachy-recognizer/blob/main/docs/PROJECT_STRUCTURE.md)
|
| 53 |
+
- [Configuration Guide](https://github.com/chelleboyer/reachy-recognizer/blob/main/docs/CONFIGURATION.md)
|
| 54 |
+
- [Setup Instructions](https://github.com/chelleboyer/reachy-recognizer/blob/main/docs/SETUP.md)
|
| 55 |
+
|
| 56 |
+
## π Performance
|
| 57 |
+
|
| 58 |
+
- **Recognition Speed**: β₯5 FPS real-time processing
|
| 59 |
+
- **Detection Accuracy**: >95% with OpenCV DNN
|
| 60 |
+
- **Recognition Accuracy**: >90% with SFace embeddings
|
| 61 |
+
- **Response Latency**: <200ms end-to-end
|
| 62 |
+
|
| 63 |
+
## π Links
|
| 64 |
+
|
| 65 |
+
- [GitHub Repository](https://github.com/chelleboyer/reachy-recognizer)
|
| 66 |
+
- [Installation Page](https://pollen-robotics.github.io/reachy_mini_app_example/)
|
| 67 |
+
|
| 68 |
+
## π License
|
| 69 |
+
|
| 70 |
+
MIT License - See [LICENSE](https://github.com/chelleboyer/reachy-recognizer/blob/main/LICENSE)
|
app.py
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Reachy Recognizer - Hugging Face Space App
|
| 3 |
+
|
| 4 |
+
This is a placeholder app that provides information about the Reachy Recognizer
|
| 5 |
+
and enables one-click installation to Reachy Mini robots.
|
| 6 |
+
"""
|
| 7 |
+
|
| 8 |
+
import gradio as gr
|
| 9 |
+
|
| 10 |
+
def create_interface():
|
| 11 |
+
"""Create the Gradio interface."""
|
| 12 |
+
|
| 13 |
+
with gr.Blocks(title="Reachy Recognizer", theme=gr.themes.Soft()) as demo:
|
| 14 |
+
gr.Markdown(
|
| 15 |
+
"""
|
| 16 |
+
# π€ Reachy Recognizer
|
| 17 |
+
|
| 18 |
+
**Human-Aware AI Companion for Reachy Mini**
|
| 19 |
+
|
| 20 |
+
A complete face recognition and conversational AI system that enables Reachy Mini
|
| 21 |
+
to recognize people, greet them with personalized responses, and engage in natural
|
| 22 |
+
voice conversations.
|
| 23 |
+
"""
|
| 24 |
+
)
|
| 25 |
+
|
| 26 |
+
with gr.Row():
|
| 27 |
+
with gr.Column():
|
| 28 |
+
gr.Markdown(
|
| 29 |
+
"""
|
| 30 |
+
## β¨ Features
|
| 31 |
+
|
| 32 |
+
- **Face Recognition**: Real-time face detection and recognition
|
| 33 |
+
- **Personalized Greetings**: Context-aware greetings based on person and time
|
| 34 |
+
- **Voice Conversation**: Natural language conversations with OpenAI GPT
|
| 35 |
+
- **Adaptive Behaviors**: Dynamic robot movements and expressions
|
| 36 |
+
- **Event System**: Smart debouncing and state management
|
| 37 |
+
"""
|
| 38 |
+
)
|
| 39 |
+
|
| 40 |
+
with gr.Column():
|
| 41 |
+
gr.Markdown(
|
| 42 |
+
"""
|
| 43 |
+
## π Installation
|
| 44 |
+
|
| 45 |
+
### To Reachy Robot
|
| 46 |
+
|
| 47 |
+
1. Make sure your Reachy Mini is running
|
| 48 |
+
2. Navigate to your Reachy dashboard (typically `http://localhost:8000`)
|
| 49 |
+
3. Use the installation button below
|
| 50 |
+
|
| 51 |
+
### Manual Installation
|
| 52 |
+
|
| 53 |
+
```bash
|
| 54 |
+
git clone https://github.com/chelleboyer/reachy-recognizer.git
|
| 55 |
+
cd reachy-recognizer
|
| 56 |
+
pip install -e .
|
| 57 |
+
```
|
| 58 |
+
"""
|
| 59 |
+
)
|
| 60 |
+
|
| 61 |
+
gr.Markdown("---")
|
| 62 |
+
|
| 63 |
+
with gr.Row():
|
| 64 |
+
dashboard_url = gr.Textbox(
|
| 65 |
+
label="Reachy Dashboard URL",
|
| 66 |
+
value="http://localhost:8000",
|
| 67 |
+
placeholder="http://localhost:8000"
|
| 68 |
+
)
|
| 69 |
+
|
| 70 |
+
with gr.Row():
|
| 71 |
+
install_btn = gr.Button("π₯ Install to Reachy", variant="primary", size="lg")
|
| 72 |
+
status_box = gr.Textbox(label="Status", interactive=False)
|
| 73 |
+
|
| 74 |
+
def install_to_reachy(url):
|
| 75 |
+
"""Simulate installation (actual installation happens via API)."""
|
| 76 |
+
import requests
|
| 77 |
+
try:
|
| 78 |
+
response = requests.post(
|
| 79 |
+
f"{url}/api/install",
|
| 80 |
+
json={
|
| 81 |
+
"url": "https://github.com/chelleboyer/reachy-recognizer",
|
| 82 |
+
"name": "reachy_recognizer"
|
| 83 |
+
},
|
| 84 |
+
timeout=10
|
| 85 |
+
)
|
| 86 |
+
if response.ok:
|
| 87 |
+
return "β
Installation started! Check your Reachy dashboard."
|
| 88 |
+
else:
|
| 89 |
+
return f"β Installation failed: {response.text}"
|
| 90 |
+
except Exception as e:
|
| 91 |
+
return f"β Error connecting to Reachy: {str(e)}"
|
| 92 |
+
|
| 93 |
+
install_btn.click(
|
| 94 |
+
fn=install_to_reachy,
|
| 95 |
+
inputs=[dashboard_url],
|
| 96 |
+
outputs=[status_box]
|
| 97 |
+
)
|
| 98 |
+
|
| 99 |
+
gr.Markdown("---")
|
| 100 |
+
|
| 101 |
+
with gr.Accordion("π About the Project", open=False):
|
| 102 |
+
gr.Markdown(
|
| 103 |
+
"""
|
| 104 |
+
## System Architecture
|
| 105 |
+
|
| 106 |
+
The Reachy Recognizer is built with a modular architecture:
|
| 107 |
+
|
| 108 |
+
- **Vision System**: Face detection, encoding, and recognition
|
| 109 |
+
- **Event System**: Debounced event handling for recognition state changes
|
| 110 |
+
- **Behavior System**: Robot movements, gestures, and idle behaviors
|
| 111 |
+
- **Voice System**: Text-to-speech with adaptive voice selection
|
| 112 |
+
- **Conversation System**: Speech-to-text and LLM integration
|
| 113 |
+
- **Coordination**: Centralized greeting and interaction management
|
| 114 |
+
|
| 115 |
+
## Performance
|
| 116 |
+
|
| 117 |
+
- **Recognition Speed**: β₯5 FPS real-time processing
|
| 118 |
+
- **Detection Accuracy**: >95% with OpenCV DNN
|
| 119 |
+
- **Recognition Accuracy**: >90% with SFace embeddings
|
| 120 |
+
- **Latency**: <200ms end-to-end greeting response
|
| 121 |
+
|
| 122 |
+
## Requirements
|
| 123 |
+
|
| 124 |
+
- Python β₯3.12
|
| 125 |
+
- Reachy Mini robot or simulator
|
| 126 |
+
- OpenCV with DNN module
|
| 127 |
+
- OpenAI API key (for conversations)
|
| 128 |
+
|
| 129 |
+
## License
|
| 130 |
+
|
| 131 |
+
MIT License - See [GitHub repository](https://github.com/chelleboyer/reachy-recognizer)
|
| 132 |
+
"""
|
| 133 |
+
)
|
| 134 |
+
|
| 135 |
+
with gr.Accordion("π Links", open=False):
|
| 136 |
+
gr.Markdown(
|
| 137 |
+
"""
|
| 138 |
+
- [GitHub Repository](https://github.com/chelleboyer/reachy-recognizer)
|
| 139 |
+
- [Documentation](https://github.com/chelleboyer/reachy-recognizer/tree/main/docs)
|
| 140 |
+
- [Project Structure](https://github.com/chelleboyer/reachy-recognizer/blob/main/docs/PROJECT_STRUCTURE.md)
|
| 141 |
+
- [Configuration Guide](https://github.com/chelleboyer/reachy-recognizer/blob/main/docs/CONFIGURATION.md)
|
| 142 |
+
"""
|
| 143 |
+
)
|
| 144 |
+
|
| 145 |
+
return demo
|
| 146 |
+
|
| 147 |
+
if __name__ == "__main__":
|
| 148 |
+
demo = create_interface()
|
| 149 |
+
demo.launch()
|
requirements.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
gradio>=4.0.0
|
| 2 |
+
requests>=2.31.0
|