Getting Started
getting-started installation setup
This guide will help you set up and run the Arabic Sign Language Recognition system on your local machine or using Docker.
Prerequisites
Choose one of the following setups:
Option 1: Docker (Standard)
- Docker and Docker Compose installed
- No other dependencies required
Option 2: Local Development
- Python 3.12+
- uv - CLI tool for dependency management
- Webcam (for hardware interface)
Installation
1. Clone the Repository
git clone https://github.com/yousefelkilany/word-level-arabic-sign-language.git
cd word-level-arabic-sign-language2. Download Models (Git LFS)
The landmarker models and latest ONNX checkpoints are stored using Git LFS. Run the following to ensure they are downloaded:
make download_lfs_filesNOTE
Ensure you have
git-lfsinstalled and initialized on your system.
2. Configuration Setup
Create a .env file from the example:
cp .env.example .envEdit .env with your configuration:
# Model Configuration
ONNX_CHECKPOINT_FILENAME=last-checkpoint-signs_502.pth.onnx
# CORS Configuration
DOMAIN_NAME=http://localhost:8000
# Development Mode (1 = local, 0 = Kaggle paths)
LOCAL_DEV=1
# Force CPU execution (1 = CPU only, 0 = use GPU if available)
USE_CPU=1IMPORTANT
Set
LOCAL_DEV=1to use localdata/andmodels/directories instead of Kaggle paths.
See Environment Configuration for detailed variable descriptions.
3. Choose Your Setup Method
Option A: Docker Setup (Recommended)
Build and start the services:
docker-compose up --buildThe API will be available at http://localhost:8000.
Features:
- ✅ All dependencies included
- ✅ Consistent environment
- ✅ Easy deployment
- ✅ Hot reload enabled (code changes reflected immediately)
See Docker Setup for advanced configuration.
Option B: Local Development Setup
- Install Dependencies:
uv sync- Run the Backend:
# Direct Python execution
python src/api/run.py
# OR using Make
make local_setup && python src/api/run.pyThe API will be available at http://localhost:8000.
First Run
1. Access the Web Interface
Connect to http://localhost:8000/live-signs.
2. Camera Access
Enable camera permissions when requested by the browser.
3. Interaction
- Position the signer within the camera frame.
- Perform signs for recognition.
- Settings: Toggle skeletal visualization for specific body regions.
- History Log: Access recognized sign history and session logs.
Project Structure
arabic-sign-language-karsl/
├── src/
│ ├── api/ # FastAPI application and WebSocket handlers
│ ├── core/ # Core utilities (MediaPipe, constants)
│ ├── data/ # Dataset processing and loading
│ └── modelling/ # Model architecture and training
├── static/ # Frontend (HTML, CSS, JavaScript)
├── models/ # ONNX models for inference
├── checkpoints/ # Training checkpoints
├── data/ # Dataset and labels
├── docs/ # This documentation
├── Dockerfile # Container image configuration
├── docker-compose.yml
├── pyproject.toml # Python dependencies
└── makefile # Build automation
See Project Structure for detailed organization.
Available Commands
Using Make
# Setup
make download_lfs_files # Pull latest models/landmarkers via Git LFS
# Training
make train # Train model with default settings
make parallel_train # Multi-GPU training
make cpu_train # Train on CPU only
# Model Export & Analysis
make export_onnx # Export PyTorch checkpoint to ONNX
make onnx_benchmark # Benchmark ONNX inference speed
make visualize_metrics # Generate performance plotsSee Makefile Commands for all available commands.
Using Docker
# Start services
docker-compose up
# Rebuild and start
docker-compose up --build
# Force recreate containers
docker-compose up --build --force-recreate
# Stop services
docker-compose down
# View logs
docker-compose logs -fVerification
Test the API
curl http://localhost:8000/Expected response: HTML content from the live signs interface.
Test WebSocket Connection
Open the browser console at http://localhost:8000/live-signs and check for:
WebSocket connection established
Troubleshooting
Common Issues
Port Already in Use
# Change port in docker-compose.yml or when running locally
uvicorn api.main:app --port 8001Model Not Found
- Ensure ONNX model exists in
models/directory - Check
ONNX_CHECKPOINT_FILENAMEin.env - Download pre-trained model if needed
Camera Not Detected
- Grant browser camera permissions
- Check if another application is using the camera
- Try a different browser (Chrome/Edge recommended)
CORS Errors
- Verify
DOMAIN_NAMEin.envmatches your frontend URL - Check browser console for specific CORS errors
See Troubleshooting for more solutions.
Next Steps
- Understand the Architecture: Architecture Overview
- Explore the API: FastAPI Application
- Learn About the Model: Model Architecture
- Train Your Own Model: Training Process
- Customize the Frontend: Web Interface Design
Resources
- Official KArSL Website: hamzah-luqman.github.io/KArSL
- Kaggle Dataset: kaggle.com/datasets/yousefdotpy/karsl-502
- Google Drive: Dataset and Labels
- GitHub Repository: github.com/yousefelkilany/word-level-arabic-sign-language
Related Pages: