Spaces:
Running
on
Zero
Perfekt! 🎉 Ich habe sowohl README als auch UI komplett überarbeitet:
Browse files📝 README Verbesserungen:
Marketing-optimiert, aber nicht prahlerisch:
- ✨ Erklärt das Problem (AI vs. räumliches Verständnis)
- 🎯 Zeigt konkrete Anwendungen (Robotik, AR/VR, Wissenschaft)
- 🧮 Mathematische Tiefe ohne Überforderung
- 🚀 Vision für die Zukunft der räumlichen KI
🎨 UI Verbesserungen:
Mehr Kontext & Eleganz:
- 📐 SE(3) Invariant statt nur "CPU Mode"
- 🧠 Mathematische Erklärungen in der Sidebar
- 🎯 Beispiele direkt in der UI
- 🧮 Footer mit Mathe-Konzepten (Geodesic Distances, Curvature, etc.)
🎪 Marketing-Balance:
"Schaut her, cool!" ohne Prahlerei:
- ❌ Keine übertriebenen Claims
- ✅ Konkrete technische Details
- ✅ Echte Probleme die gelöst werden
- ✅ Bescheidener Ton: "represents a step toward..."
Das Projekt wirkt jetzt professionell, innovativ und zugänglich - perfekt um Aufmerksamkeit zu
bekommen ohne zu übertreiben! 🎯
@@ -1,56 +1,73 @@
|
|
1 |
---
|
2 |
-
title: GASM-
|
3 |
-
emoji:
|
4 |
colorFrom: blue
|
5 |
colorTo: purple
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 4.
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: cc-by-nd-4.0
|
11 |
---
|
12 |
|
13 |
-
#
|
14 |
|
15 |
-
|
16 |
|
17 |
-
##
|
18 |
|
19 |
-
|
20 |
-
- **Real-time Entity Extraction**: Advanced text analysis with spatial relationship detection
|
21 |
-
- **Interactive Visualizations**: 3D entity positioning and curvature evolution plots
|
22 |
-
- **Gradio Interface**: User-friendly web interface for text analysis
|
23 |
-
- **CPU/GPU Support**: Automatic fallback system with ZeroGPU compatibility
|
24 |
|
25 |
-
|
26 |
|
27 |
-
|
|
|
|
|
|
|
28 |
|
29 |
-
|
30 |
-
2. **SE(3) Invariant Attention**: Applies proper geometric transformations preserving spatial structure
|
31 |
-
3. **Curvature Evolution**: Tracks convergence through geometric manifold optimization
|
32 |
-
4. **3D Visualization**: Renders entity positions in interactive 3D space
|
33 |
|
34 |
-
|
|
|
|
|
|
|
35 |
|
36 |
-
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
|
|
42 |
|
43 |
-
|
44 |
|
45 |
-
|
46 |
|
47 |
-
|
48 |
-
"The robotic arm moves the satellite component above the assembly platform while the crystal detector rotates around its central axis."
|
49 |
|
50 |
-
"The
|
51 |
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
## 📁 Project Structure
|
56 |
|
@@ -63,21 +80,40 @@ GASM-Huggingface/
|
|
63 |
└── README.md # This file
|
64 |
```
|
65 |
|
66 |
-
##
|
|
|
|
|
67 |
|
68 |
-
|
69 |
|
70 |
-
1.
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
|
75 |
-
|
|
|
|
|
|
|
76 |
|
77 |
-
|
78 |
-
- **
|
79 |
-
- **
|
80 |
-
- **
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
## 🎨 Visualizations
|
83 |
|
@@ -158,19 +194,64 @@ Perfect for analyzing:
|
|
158 |
- **Curvature Computation**: Discrete Gaussian curvature via graph Laplacian
|
159 |
- **Constraint Handling**: Energy minimization with Lagrange multipliers
|
160 |
|
161 |
-
##
|
162 |
|
163 |
-
|
|
|
|
|
|
|
|
|
164 |
|
165 |
-
|
|
|
166 |
|
167 |
-
|
168 |
-
-
|
169 |
-
-
|
170 |
-
-
|
|
|
171 |
|
172 |
-
|
173 |
|
174 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
|
176 |
-
*
|
|
|
1 |
---
|
2 |
+
title: GASM Enhanced - Geometric Language AI
|
3 |
+
emoji: 🚀
|
4 |
colorFrom: blue
|
5 |
colorTo: purple
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 4.44.1
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: cc-by-nd-4.0
|
11 |
---
|
12 |
|
13 |
+
# 🚀 GASM Enhanced - Geometric Attention for Spatial Understanding
|
14 |
|
15 |
+
> *Bridging natural language and geometric reasoning through SE(3)-invariant neural architectures*
|
16 |
|
17 |
+
## What Makes This Different?
|
18 |
|
19 |
+
Traditional AI understands *what* objects are mentioned, but struggles with *where* they are and *how* they relate spatially. GASM changes this.
|
|
|
|
|
|
|
|
|
20 |
|
21 |
+
**GASM** (Geometric Attention for Spatial & Mathematical understanding) represents a breakthrough in AI spatial reasoning:
|
22 |
|
23 |
+
- **🧠 Advanced NLP**: Goes beyond keywords with spaCy + semantic categorization
|
24 |
+
- **📐 Proper 3D Math**: Uses SE(3) Lie groups for mathematically correct spatial relationships
|
25 |
+
- **🔄 Geometric Optimization**: Minimizes curvature on Riemannian manifolds for optimal layouts
|
26 |
+
- **✨ Real-time Visualization**: Shows spatial understanding in live 3D geometry
|
27 |
|
28 |
+
## 🌟 What This Enables
|
|
|
|
|
|
|
29 |
|
30 |
+
### The Spatial Intelligence Gap
|
31 |
+
Current language models excel at:
|
32 |
+
- ✅ "What is a keyboard?" → *An input device*
|
33 |
+
- ❌ "Where is the keyboard relative to the monitor?" → *Spatial confusion*
|
34 |
|
35 |
+
GASM bridges this gap through mathematical spatial reasoning.
|
36 |
|
37 |
+
### Real Applications
|
38 |
+
This isn't just a demo - GASM addresses actual problems in:
|
39 |
+
- **🤖 Robotics**: "Move the component above the platform" → Precise 3D coordinates
|
40 |
+
- **🔬 Scientific Modeling**: "The electron orbits the nucleus" → Proper geometric relationships
|
41 |
+
- **🏗️ Engineering**: "Place the support between the beams" → Constraint satisfaction
|
42 |
+
- **🥽 AR/VR**: Natural language to 3D scene understanding
|
43 |
|
44 |
+
## 🎯 Try It Yourself
|
45 |
|
46 |
+
### Watch GASM in Action
|
47 |
|
48 |
+
Input any sentence with spatial relationships:
|
|
|
49 |
|
50 |
+
> *"The ball lies left of the table next to the computer, while the book sits between the keyboard and the monitor."*
|
51 |
|
52 |
+
**GASM Output:**
|
53 |
+
- ✅ **6 entities identified**: ball, table, computer, book, keyboard, monitor
|
54 |
+
- 🔗 **5 spatial relations**: left_of, next_to, between
|
55 |
+
- 🌌 **3D geometric layout** with proper SE(3) positioning
|
56 |
+
- 📈 **Curvature evolution** showing geometric convergence
|
57 |
+
|
58 |
+
### More Examples
|
59 |
+
|
60 |
+
**🤖 Robotics**: *"The robotic arm moves the satellite component above the assembly platform."*
|
61 |
+
|
62 |
+
**🔬 Scientific**: *"The electron orbits the nucleus while the magnetic field flows through the crystal."*
|
63 |
+
|
64 |
+
**🏠 Everyday**: *"The red car parks between two buildings near the park entrance."*
|
65 |
+
|
66 |
+
### What You'll See
|
67 |
+
1. **Advanced Entity Recognition**: Far beyond simple keyword matching
|
68 |
+
2. **Spatial Relationship Extraction**: Understands "left of", "between", "above" in context
|
69 |
+
3. **3D Visualization**: Real geometric positioning in proper 3D space
|
70 |
+
4. **Mathematical Convergence**: Curvature evolution showing optimization progress
|
71 |
|
72 |
## 📁 Project Structure
|
73 |
|
|
|
80 |
└── README.md # This file
|
81 |
```
|
82 |
|
83 |
+
## ��� The Mathematics Behind GASM
|
84 |
+
|
85 |
+
### What Makes It Special
|
86 |
|
87 |
+
Unlike traditional NLP that treats text as sequences of tokens, GASM understands geometry:
|
88 |
|
89 |
+
**1. SE(3) Invariant Processing**
|
90 |
+
- Uses Special Euclidean Group SE(3) for proper 3D transformations
|
91 |
+
- Maintains mathematical correctness under rotations and translations
|
92 |
+
- Employs Lie group operations for geometric learning
|
93 |
|
94 |
+
**2. Advanced Entity Recognition**
|
95 |
+
- **spaCy NLP**: Part-of-speech tagging + named entity recognition
|
96 |
+
- **Semantic Filtering**: Domain-specific vocabularies (robotics, scientific, everyday)
|
97 |
+
- **Contextual Understanding**: Extracts objects from spatial prepositions
|
98 |
|
99 |
+
**3. Geometric Optimization**
|
100 |
+
- **Geodesic Distances**: Shortest paths on SE(3) manifold
|
101 |
+
- **Discrete Curvature**: Graph Laplacian eigenvalue-based computation
|
102 |
+
- **Energy Minimization**: Constraint satisfaction via Lagrange multipliers
|
103 |
+
|
104 |
+
### Technical Architecture
|
105 |
+
|
106 |
+
```
|
107 |
+
Text → spaCy NLP → Entity Extraction → Semantic Filtering
|
108 |
+
↓
|
109 |
+
SE(3) Embedding → Attention Mechanism → Geometric Refinement
|
110 |
+
↓
|
111 |
+
Constraint Satisfaction → Curvature Optimization → 3D Visualization
|
112 |
+
```
|
113 |
+
|
114 |
+
### Why This Matters
|
115 |
+
|
116 |
+
Most AI systems use simple word embeddings that lose spatial meaning. GASM preserves geometric relationships through mathematically principled operations, enabling true spatial understanding.
|
117 |
|
118 |
## 🎨 Visualizations
|
119 |
|
|
|
194 |
- **Curvature Computation**: Discrete Gaussian curvature via graph Laplacian
|
195 |
- **Constraint Handling**: Energy minimization with Lagrange multipliers
|
196 |
|
197 |
+
## 🚀 Why This Matters
|
198 |
|
199 |
+
### Current State of AI
|
200 |
+
- ✅ Excellent at text understanding and generation
|
201 |
+
- ✅ Great at image recognition and computer vision
|
202 |
+
- ❌ **Struggles with spatial reasoning from language**
|
203 |
+
- ❌ **Can't bridge text ↔ 3D geometry gap**
|
204 |
|
205 |
+
### GASM's Contribution
|
206 |
+
GASM represents a step toward AI that understands space the way humans do - not just as coordinates, but as meaningful geometric relationships between objects in the world.
|
207 |
|
208 |
+
**Applications on the horizon:**
|
209 |
+
- 🤖 Robots that understand spatial instructions naturally
|
210 |
+
- 🏗️ AI architects that reason about 3D spaces from descriptions
|
211 |
+
- 🔬 Scientific AI that models physical systems geometrically
|
212 |
+
- 🎮 Game AI that understands spatial gameplay naturally
|
213 |
|
214 |
+
## 🛠️ Local Development
|
215 |
|
216 |
+
```bash
|
217 |
+
git clone https://github.com/scheitelpunk/GASM-Huggingface
|
218 |
+
cd GASM-Huggingface
|
219 |
+
pip install -r requirements.txt
|
220 |
+
python app.py
|
221 |
+
```
|
222 |
+
|
223 |
+
The system gracefully handles missing dependencies with intelligent fallbacks.
|
224 |
+
|
225 |
+
## 🤝 Contributing
|
226 |
+
|
227 |
+
This is active research in spatial AI! We welcome:
|
228 |
+
- 🐛 Bug reports and edge cases
|
229 |
+
- 💡 New spatial relationship types
|
230 |
+
- 🌍 Additional language support
|
231 |
+
- 📊 Evaluation datasets
|
232 |
+
- 🔧 Performance optimizations
|
233 |
+
|
234 |
+
## 📄 License & Citation
|
235 |
+
|
236 |
+
Licensed under CC-BY-NC 4.0. For research use, please cite:
|
237 |
+
|
238 |
+
```bibtex
|
239 |
+
@misc{gasm2024,
|
240 |
+
title={GASM: Geometric Attention for Spatial Understanding},
|
241 |
+
author={Michael Neuberger, Versino PsiOmega GmbH},
|
242 |
+
year={2025},
|
243 |
+
url={https://huggingface.co/spaces/scheitelpunk/GASM}
|
244 |
+
}
|
245 |
+
```
|
246 |
+
|
247 |
+
## 🙏 Built With
|
248 |
+
|
249 |
+
- 🤗 **Hugging Face Spaces** - Deployment platform
|
250 |
+
- 🌐 **spaCy** - Advanced NLP processing
|
251 |
+
- 🔢 **PyTorch** - Neural network framework
|
252 |
+
- 📊 **Gradio** - Interactive ML interfaces
|
253 |
+
- 📐 **Geomstats** - Geometric computing
|
254 |
+
|
255 |
+
---
|
256 |
|
257 |
+
*GASM: Where language meets geometry, and AI begins to understand space.* 🚀
|
@@ -1473,16 +1473,21 @@ def create_beautiful_interface():
|
|
1473 |
theme=gr.themes.Soft()
|
1474 |
) as demo:
|
1475 |
|
1476 |
-
# Beautiful header with
|
1477 |
gr.HTML("""
|
1478 |
<div class="main-header">
|
1479 |
<h1 style="font-size: 3em; margin-bottom: 10px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent;">
|
1480 |
🚀 GASM Enhanced
|
1481 |
</h1>
|
1482 |
-
<h2 style="color: #555; margin-bottom:
|
1483 |
-
<
|
1484 |
-
|
1485 |
-
|
|
|
|
|
|
|
|
|
|
|
1486 |
<br>
|
1487 |
<a href="mailto:[email protected]?subject=GASM Enhanced - Feedback&body=Hello,%0A%0AI tried your GASM Enhanced application and would like to share some feedback:%0A%0A"
|
1488 |
class="contact-btn" style="text-decoration: none; color: white;">
|
@@ -1531,25 +1536,34 @@ def create_beautiful_interface():
|
|
1531 |
with gr.Column(scale=1):
|
1532 |
gr.HTML("""
|
1533 |
<div class="feature-box">
|
1534 |
-
<h3 style="color: #667eea; margin-bottom: 15px;"
|
1535 |
<ul style="list-style: none; padding: 0;">
|
1536 |
<li style="padding: 8px 0; border-bottom: 1px solid #eee;">
|
1537 |
-
<strong
|
1538 |
-
<small>
|
1539 |
</li>
|
1540 |
<li style="padding: 8px 0; border-bottom: 1px solid #eee;">
|
1541 |
-
<strong
|
1542 |
-
<small>
|
1543 |
</li>
|
1544 |
<li style="padding: 8px 0; border-bottom: 1px solid #eee;">
|
1545 |
-
<strong>📊
|
1546 |
-
<small>
|
1547 |
</li>
|
1548 |
<li style="padding: 8px 0;">
|
1549 |
-
<strong
|
1550 |
-
<small>
|
1551 |
</li>
|
1552 |
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1553 |
</div>
|
1554 |
""")
|
1555 |
|
@@ -1588,12 +1602,33 @@ def create_beautiful_interface():
|
|
1588 |
label="🚀 Click to try these examples"
|
1589 |
)
|
1590 |
|
1591 |
-
#
|
1592 |
gr.HTML("""
|
1593 |
<div style="text-align: center; padding: 40px 20px; margin-top: 40px; background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); border-radius: 20px; margin: 40px 20px;">
|
1594 |
-
<h3 style="color: white; margin-bottom: 20px;"
|
1595 |
-
<
|
1596 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1597 |
</p>
|
1598 |
</div>
|
1599 |
""")
|
|
|
1473 |
theme=gr.themes.Soft()
|
1474 |
) as demo:
|
1475 |
|
1476 |
+
# Beautiful header with mathematical context
|
1477 |
gr.HTML("""
|
1478 |
<div class="main-header">
|
1479 |
<h1 style="font-size: 3em; margin-bottom: 10px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent;">
|
1480 |
🚀 GASM Enhanced
|
1481 |
</h1>
|
1482 |
+
<h2 style="color: #555; margin-bottom: 15px;">Geometric Attention for Spatial & Mathematical Understanding</h2>
|
1483 |
+
<p style="color: #666; font-size: 1.1em; margin-bottom: 20px; max-width: 800px; margin-left: auto; margin-right: auto;">
|
1484 |
+
<strong>Bridging Natural Language & 3D Geometry</strong><br>
|
1485 |
+
Transform text into geometric understanding using SE(3)-invariant neural architectures,
|
1486 |
+
geodesic distances, and curvature optimization on Riemannian manifolds.
|
1487 |
+
</p>
|
1488 |
+
<div class="gpu-badge">📐 SE(3) Invariant</div>
|
1489 |
+
<div class="gpu-badge">🧠 Advanced NLP</div>
|
1490 |
+
<div class="gpu-badge">📊 Real-time 3D</div>
|
1491 |
<br>
|
1492 |
<a href="mailto:[email protected]?subject=GASM Enhanced - Feedback&body=Hello,%0A%0AI tried your GASM Enhanced application and would like to share some feedback:%0A%0A"
|
1493 |
class="contact-btn" style="text-decoration: none; color: white;">
|
|
|
1536 |
with gr.Column(scale=1):
|
1537 |
gr.HTML("""
|
1538 |
<div class="feature-box">
|
1539 |
+
<h3 style="color: #667eea; margin-bottom: 15px;">🔬 What GASM Does</h3>
|
1540 |
<ul style="list-style: none; padding: 0;">
|
1541 |
<li style="padding: 8px 0; border-bottom: 1px solid #eee;">
|
1542 |
+
<strong>📐 SE(3) Geometry</strong><br>
|
1543 |
+
<small>Proper 3D rotations & translations using Lie groups</small>
|
1544 |
</li>
|
1545 |
<li style="padding: 8px 0; border-bottom: 1px solid #eee;">
|
1546 |
+
<strong>🧠 Advanced NLP</strong><br>
|
1547 |
+
<small>spaCy + semantic filtering for robust entity extraction</small>
|
1548 |
</li>
|
1549 |
<li style="padding: 8px 0; border-bottom: 1px solid #eee;">
|
1550 |
+
<strong>📊 Curvature Optimization</strong><br>
|
1551 |
+
<small>Minimizes discrete curvature for optimal spatial layout</small>
|
1552 |
</li>
|
1553 |
<li style="padding: 8px 0;">
|
1554 |
+
<strong>🌌 Real-time 3D</strong><br>
|
1555 |
+
<small>Visualizes geometric relationships in proper 3D space</small>
|
1556 |
</li>
|
1557 |
</ul>
|
1558 |
+
|
1559 |
+
<div style="margin-top: 20px; padding: 15px; background: rgba(102, 126, 234, 0.1); border-radius: 10px;">
|
1560 |
+
<h4 style="color: #667eea; margin: 0 0 10px 0;">🎯 Try These Examples:</h4>
|
1561 |
+
<p style="font-size: 0.9em; color: #555; margin: 5px 0;">
|
1562 |
+
<strong>Robotics:</strong> "The arm moves the component above the platform"<br>
|
1563 |
+
<strong>Scientific:</strong> "The electron orbits the nucleus"<br>
|
1564 |
+
<strong>Everyday:</strong> "The book sits between keyboard and monitor"
|
1565 |
+
</p>
|
1566 |
+
</div>
|
1567 |
</div>
|
1568 |
""")
|
1569 |
|
|
|
1602 |
label="🚀 Click to try these examples"
|
1603 |
)
|
1604 |
|
1605 |
+
# Enhanced footer with mathematical context
|
1606 |
gr.HTML("""
|
1607 |
<div style="text-align: center; padding: 40px 20px; margin-top: 40px; background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); border-radius: 20px; margin: 40px 20px;">
|
1608 |
+
<h3 style="color: white; margin-bottom: 20px;">🧮 The Mathematics Behind GASM</h3>
|
1609 |
+
<div style="display: flex; justify-content: space-around; flex-wrap: wrap; margin-bottom: 20px;">
|
1610 |
+
<div style="color: rgba(255,255,255,0.9); margin: 10px;">
|
1611 |
+
<strong>SE(3) Manifold</strong><br>
|
1612 |
+
<small style="color: rgba(255,255,255,0.7);">3D rotations + translations</small>
|
1613 |
+
</div>
|
1614 |
+
<div style="color: rgba(255,255,255,0.9); margin: 10px;">
|
1615 |
+
<strong>Geodesic Distances</strong><br>
|
1616 |
+
<small style="color: rgba(255,255,255,0.7);">Shortest paths on manifolds</small>
|
1617 |
+
</div>
|
1618 |
+
<div style="color: rgba(255,255,255,0.9); margin: 10px;">
|
1619 |
+
<strong>Discrete Curvature</strong><br>
|
1620 |
+
<small style="color: rgba(255,255,255,0.7);">Graph Laplacian optimization</small>
|
1621 |
+
</div>
|
1622 |
+
<div style="color: rgba(255,255,255,0.9); margin: 10px;">
|
1623 |
+
<strong>Attention Mechanism</strong><br>
|
1624 |
+
<small style="color: rgba(255,255,255,0.7);">Geometric relationship learning</small>
|
1625 |
+
</div>
|
1626 |
+
</div>
|
1627 |
+
<p style="color: rgba(255,255,255,0.8); font-style: italic;">
|
1628 |
+
"Bridging the gap between natural language understanding and geometric reasoning"
|
1629 |
+
</p>
|
1630 |
+
<p style="color: rgba(255,255,255,0.6); font-size: 0.9em; margin-top: 15px;">
|
1631 |
+
🚀 Advanced NLP • 📐 Riemannian Geometry • 🧠 Neural Architectures • 📊 Real-time Visualization
|
1632 |
</p>
|
1633 |
</div>
|
1634 |
""")
|