{"title": "Kyc Setup", "content": "# Face Recognition Setup Guide\n\n## Overview\n\nThe application now uses **cloud-based face recognition** instead of local libraries, eliminating deployment issues while providing reliable face recognition capabilities.\n\n## Supported Providers\n\n### 1. Luxand Cloud API (Default - Recommended)\n- **Website**: https://luxand.cloud/\n- **Pricing**: Free tier available (500 requests/month)\n- **Features**: Face detection, verification, high accuracy (99%+)\n- **Performance**: Lightning fast (60ms response time)\n- **Setup**: Simple API token authentication\n\n### 2. Alternative Providers\n- **Face++ API**: https://www.faceplusplus.com/\n- **AWS Rekognition**: https://aws.amazon.com/rekognition/\n- **Azure Face API**: https://azure.microsoft.com/en-us/services/cognitive-services/face/\n- **Google Cloud Vision**: https://cloud.google.com/vision\n\n## Quick Setup (Luxand Cloud)\n\n### 1. Get API Token\n1. Visit https://luxand.cloud/\n2. Sign up for a free account (500 requests/month)\n3. Go to your dashboard\n4. Copy your API token\n\n### 2. Configure Environment Variables\nAdd these to your `.env` file:\n\n```bash\nFACE_API_KEY=your_luxand_api_token_here\nFACE_API_ENDPOINT=https://api.luxand.cloud\n```\n\n### 3. Test the Setup\nDeploy your application and test:\n\n```bash\n# Check if face recognition is enabled\nGET /api/auth/face/status/\n\n# Should return:\n{\n  \"status\": \"success\",\n  \"data\": {\n    \"face_recognition_available\": true,\n    \"status\": \"enabled\",\n    \"message\": \"Face recognition is available\"\n  }\n}\n```\n\n## API Endpoints\n\n### Check Status\n- **URL**: `GET /api/auth/face/status/`\n- **Description**: Check if face recognition is available\n- **Authentication**: Required\n\n### Register Face\n- **URL**: `POST /api/auth/face/register/`\n- **Description**: Register user's face for verification\n- **Authentication**: Required\n- **Body**:\n```json\n{\n  \"face_image\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ...\"\n}\n```\n- **Response**:\n```json\n{\n  \"status\": \"success\",\n  \"data\": {\n    \"message\": \"Face registered successfully\",\n    \"face_image_url\": \"/media/face_identities/123_face.jpg\",\n    \"subject_id\": \"registered\"\n  }\n}\n```\n\n### Verify Face\n- **URL**: `POST /api/auth/face/verify/`\n- **Description**: Verify user's face against registered face\n- **Authentication**: Required\n- **Body**:\n```json\n{\n  \"face_image\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ...\"\n}\n```\n- **Response**:\n```json\n{\n  \"status\": \"success\",\n  \"data\": {\n    \"match\": true,\n    \"confidence\": 0.95,\n    \"message\": \"Face verification successful\"\n  }\n}\n```\n\n## Benefits of Cloud-Based Solution\n\n\u2705 **No Deployment Issues**: No heavy dependencies to compile  \n\u2705 **Lightning Fast Deployment**: Docker builds in seconds, not hours  \n\u2705 **Professional Grade**: 99%+ accuracy with 60ms response time  \n\u2705 **Highly Scalable**: Handles unlimited users seamlessly  \n\u2705 **Always Updated**: Latest face recognition algorithms  \n\u2705 **Cost-Effective**: Free tier + affordable paid plans  \n\u2705 **Secure**: Neural network templates, no photo storage  \n\n## Migration from Local Libraries\n\nThe new system is backward compatible:\n- Existing face data is automatically migrated\n- No code changes needed in frontend\n- Same API endpoints and responses\n- Better error handling and reliability\n- Improved accuracy and performance\n\n## Troubleshooting\n\n### Face Recognition Not Available\nIf you get \"Face recognition is not configured\":\n1. Check your `FACE_API_KEY` environment variable\n2. Verify your API token is valid at https://luxand.cloud/\n3. Ensure you have internet connectivity\n4. Check if you've exceeded your quota\n\n### API Errors\n- **Invalid image**: Ensure JPEG/PNG format, base64 encoded\n- **No face detected**: Use clear, well-lit images with single face\n- **Multiple faces**: Ensure only one face per image\n- **Quota exceeded**: Upgrade your Luxand plan or wait for reset\n- **Network timeout**: Check internet connection\n\n### Image Requirements\n- **Format**: JPEG or PNG\n- **Encoding**: Base64 (with or without data URI prefix)\n- **Size**: Recommend under 5MB\n- **Quality**: Clear, well-lit images\n- **Content**: Single face per image\n- **Resolution**: Minimum 200x200 pixels\n\n## Production Deployment\n\n1. **Set Environment Variables**:\n   ```bash\n   FACE_API_KEY=your_production_token\n   FACE_API_ENDPOINT=https://api.luxand.cloud\n   ```\n\n2. **Deploy Normally** - no special build steps needed:\n   ```bash\n   docker build -t q_app .\n   docker-compose down\n   docker-compose up -d\n   docker-compose logs --follow\n   ```\n\n3. **Monitor Usage**: Check your Luxand dashboard for API usage\n\n## Pricing Information\n\nBased on [Luxand.cloud](https://luxand.cloud/):\n\n- **Free Tier**: 500 requests/month\n- **Paid Plans**: Starting at $49/month for 5,000 requests\n- **Enterprise**: Custom pricing for high volume\n\n## Why This Solution is Superior\n\n### vs Local Libraries (`dlib`, `face_recognition`)\n- \u274c **Local**: Hours to compile, frequent build failures\n- \u2705 **Cloud**: Deploys in seconds, never fails\n\n### vs Other Cloud Providers\n- **More Cost-Effective**: Competitive pricing with generous free tier\n- **Better Performance**: 60ms response time\n- **Higher Accuracy**: 99%+ accuracy rate\n- **Easier Integration**: Simple token-based authentication\n\n## Ready for Production\n\nYour application now has **enterprise-grade face recognition** that:\n- Deploys reliably every time\n- Performs better than local libraries\n- Scales automatically with your users\n- Costs less than alternative solutions\n\nThe face recognition feature is now **production-ready** with zero deployment headaches!\n"}