Spaces:
Runtime error
Runtime error
CORRECT FIX: Use python_version in README.md YAML only, remove runtime.txt, optimize deps
Browse files- README.md +5 -5
- app.py +7 -7
- requirements.txt +4 -4
- runtime.txt +0 -1
README.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
| 1 |
---
|
| 2 |
-
title: Arabic Sign Language
|
| 3 |
emoji: 🤟
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: green
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 4.16.0
|
|
|
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
| 11 |
-
python_version: 3.10
|
| 12 |
---
|
| 13 |
|
| 14 |
-
# Arabic Sign Language Recognition
|
| 15 |
|
| 16 |
Upload an image of an Arabic sign language gesture and get instant predictions!
|
| 17 |
|
|
@@ -48,8 +48,8 @@ Total: **43 classes**
|
|
| 48 |
## Technical Stack
|
| 49 |
|
| 50 |
- Python 3.10
|
| 51 |
-
- TensorFlow CPU 2.
|
| 52 |
-
- MediaPipe 0.10.9
|
| 53 |
- OpenCV (headless)
|
| 54 |
- Gradio 4.16.0
|
| 55 |
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Arabic Sign Language API
|
| 3 |
emoji: 🤟
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: green
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 4.16.0
|
| 8 |
+
python_version: "3.10"
|
| 9 |
app_file: app.py
|
| 10 |
pinned: false
|
| 11 |
license: mit
|
|
|
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# Arabic Sign Language Recognition API
|
| 15 |
|
| 16 |
Upload an image of an Arabic sign language gesture and get instant predictions!
|
| 17 |
|
|
|
|
| 48 |
## Technical Stack
|
| 49 |
|
| 50 |
- Python 3.10
|
| 51 |
+
- TensorFlow CPU 2.20+
|
| 52 |
+
- MediaPipe 0.10.9+
|
| 53 |
- OpenCV (headless)
|
| 54 |
- Gradio 4.16.0
|
| 55 |
|
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
"""
|
| 2 |
-
Arabic Sign Language Recognition
|
| 3 |
Optimized for Hugging Face Spaces with Python 3.10
|
| 4 |
"""
|
| 5 |
|
|
@@ -69,7 +69,7 @@ def predict_sign(image):
|
|
| 69 |
# Load model if not loaded
|
| 70 |
load_model()
|
| 71 |
|
| 72 |
-
# Convert BGR to RGB
|
| 73 |
if len(image.shape) == 3 and image.shape[2] == 3:
|
| 74 |
image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
| 75 |
else:
|
|
@@ -128,9 +128,9 @@ def predict_sign(image):
|
|
| 128 |
return image, f"❌ Error: {str(e)}", "Please try again with a different image"
|
| 129 |
|
| 130 |
# Create Gradio interface
|
| 131 |
-
with gr.Blocks(title="Arabic Sign Language
|
| 132 |
gr.Markdown("""
|
| 133 |
-
# 🤟 Arabic Sign Language Recognition
|
| 134 |
|
| 135 |
Upload an image of an Arabic sign language gesture and get instant predictions!
|
| 136 |
|
|
@@ -165,14 +165,14 @@ with gr.Blocks(title="Arabic Sign Language Recognition", theme=gr.themes.Soft())
|
|
| 165 |
confidence_text = gr.Markdown(label="Confidence")
|
| 166 |
|
| 167 |
# Info section
|
| 168 |
-
with gr.Accordion("ℹ️ About this
|
| 169 |
gr.Markdown("""
|
| 170 |
### Model Information
|
| 171 |
|
| 172 |
- **Model**: Multi-Layer Perceptron (MLP)
|
| 173 |
- **Input**: MediaPipe hand landmarks (21 points × 3 coordinates = 63 features)
|
| 174 |
- **Output**: 43 classes (Arabic letters, numbers 0-10, space)
|
| 175 |
-
- **Framework**: TensorFlow/Keras
|
| 176 |
- **Repository**: [katyy2000/arabic-sign-language-recognition](https://huggingface.co/katyy2000/arabic-sign-language-recognition)
|
| 177 |
|
| 178 |
### How it works
|
|
@@ -200,7 +200,7 @@ with gr.Blocks(title="Arabic Sign Language Recognition", theme=gr.themes.Soft())
|
|
| 200 |
|
| 201 |
# Load model on startup
|
| 202 |
print("="*60)
|
| 203 |
-
print("🚀 Starting Arabic Sign Language Recognition")
|
| 204 |
print("="*60)
|
| 205 |
|
| 206 |
try:
|
|
|
|
| 1 |
"""
|
| 2 |
+
Arabic Sign Language Recognition API
|
| 3 |
Optimized for Hugging Face Spaces with Python 3.10
|
| 4 |
"""
|
| 5 |
|
|
|
|
| 69 |
# Load model if not loaded
|
| 70 |
load_model()
|
| 71 |
|
| 72 |
+
# Convert BGR to RGB if needed
|
| 73 |
if len(image.shape) == 3 and image.shape[2] == 3:
|
| 74 |
image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
| 75 |
else:
|
|
|
|
| 128 |
return image, f"❌ Error: {str(e)}", "Please try again with a different image"
|
| 129 |
|
| 130 |
# Create Gradio interface
|
| 131 |
+
with gr.Blocks(title="Arabic Sign Language API", theme=gr.themes.Soft()) as demo:
|
| 132 |
gr.Markdown("""
|
| 133 |
+
# 🤟 Arabic Sign Language Recognition API
|
| 134 |
|
| 135 |
Upload an image of an Arabic sign language gesture and get instant predictions!
|
| 136 |
|
|
|
|
| 165 |
confidence_text = gr.Markdown(label="Confidence")
|
| 166 |
|
| 167 |
# Info section
|
| 168 |
+
with gr.Accordion("ℹ️ About this API", open=False):
|
| 169 |
gr.Markdown("""
|
| 170 |
### Model Information
|
| 171 |
|
| 172 |
- **Model**: Multi-Layer Perceptron (MLP)
|
| 173 |
- **Input**: MediaPipe hand landmarks (21 points × 3 coordinates = 63 features)
|
| 174 |
- **Output**: 43 classes (Arabic letters, numbers 0-10, space)
|
| 175 |
+
- **Framework**: TensorFlow/Keras (CPU optimized)
|
| 176 |
- **Repository**: [katyy2000/arabic-sign-language-recognition](https://huggingface.co/katyy2000/arabic-sign-language-recognition)
|
| 177 |
|
| 178 |
### How it works
|
|
|
|
| 200 |
|
| 201 |
# Load model on startup
|
| 202 |
print("="*60)
|
| 203 |
+
print("🚀 Starting Arabic Sign Language Recognition API")
|
| 204 |
print("="*60)
|
| 205 |
|
| 206 |
try:
|
requirements.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
tensorflow-cpu=
|
| 2 |
-
opencv-python-headless=
|
| 3 |
-
mediapipe=
|
| 4 |
-
huggingface_hub=
|
|
|
|
| 1 |
+
tensorflow-cpu>=2.20.0
|
| 2 |
+
opencv-python-headless>=4.8.0
|
| 3 |
+
mediapipe>=0.10.9
|
| 4 |
+
huggingface_hub>=0.20.0
|
runtime.txt
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
python-3.10
|
|
|
|
|
|