Skip to content

Ahmed-AI-Developer/Deaf-Connect-AI-FastAPI

Repository files navigation

Deaf Connect AI — Deployment Guide

Project Structure

deaf_connect_api/
├── main.py           ← FastAPI backend
├── labels.py         ← 16 sign labels
├── requirements.txt  ← Python dependencies
├── render.yaml       ← Render config
├── model/
│   └── sign_model.h5 ← Your trained model (copy here)
└── static/
    └── api-client.js ← Frontend JS client

STEP 1 — Prepare Files

Copy your trained model:

model/sign_model.h5  ← apna trained model yahan rakho
labels.py            ← already ready hai

STEP 2 — GitHub Pe Push Karo

cd deaf_connect_api
git init
git add .
git commit -m "Deaf Connect AI FastAPI backend"
git branch -M main
git remote add origin https://github.com/YOUR_USERNAME/deaf-connect-api.git
git push -u origin main

STEP 3 — Render Pe Deploy Karo

  1. render.com pe jao → Sign up (free)
  2. "New +" → "Web Service"
  3. GitHub repo connect karo
  4. Settings:
    • Name: deaf-connect-api
    • Environment: Python 3
    • Build Command: pip install -r requirements.txt
    • Start Command: uvicorn main:app --host 0.0.0.0 --port $PORT
  5. "Create Web Service" click karo
  6. Wait 3-5 minutes — deploy hoga
  7. URL milega: https://deaf-connect-api.onrender.com

STEP 4 — Frontend Update Karo (Vercel)

api-client.js mein yeh line update karo:

const API_BASE_URL = "https://deaf-connect-api.onrender.com";

Phir Vercel pe push karo — auto deploy ho jayega.


API Endpoints

Method URL Description
GET /health Server status check
GET /labels All 16 labels
GET /sentences All 10 sentences
POST /predict Landmarks → Sign label
POST /build-sentence Words → Sentence
POST /speak Text → Audio (base64)
POST /transcribe Audio → Text

Test API (after deploy)

# Health check
curl https://deaf-connect-api.onrender.com/health

# Get labels
curl https://deaf-connect-api.onrender.com/labels

# Test predict (dummy data)
curl -X POST https://deaf-connect-api.onrender.com/predict \
  -H "Content-Type: application/json" \
  -d '{"landmarks": [0.5]*126, "confidence_threshold": 0.65}'

# Test sentence
curl -X POST https://deaf-connect-api.onrender.com/build-sentence \
  -H "Content-Type: application/json" \
  -d '{"words": ["accident", "now", "help"]}'

API Docs (Auto-generated)

After deploy, visit:


Important Notes

  1. Free Render — server sleeps after 15 min inactivity

    • First request after sleep takes ~30 seconds (cold start)
    • Add a health ping every 10 min to keep alive
  2. Model size — sign_model.h5 large hai toh GitHub LFS use karo:

    git lfs install
    git lfs track "*.h5"
    git add .gitattributes
  3. pyttsx3 on Linux — Render Linux pe hai, pyttsx3 needs espeak: Add this file: build.sh

    apt-get install -y espeak
    pip install -r requirements.txt

    Change build command in Render to: bash build.sh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors