--- title: Color By Number Pro API emoji: 🎨 colorFrom: blue colorTo: indigo sdk: gradio app_file: app.py pinned: false --- # Color-by-Number Pro API Advanced image processing backend for converting photos, illustrations, and anime into high-quality color-by-number templates. ## Features - **SAM2 Segmentation**: Pixel-perfect region detection. - **Depth Estimation**: Automatic difficulty layers based on image depth. - **Adjacency Matrix**: Pre-calculated region neighbors for fast frontend logic. - **Pole of Inaccessibility**: Perfect number placement inside complex borders. - **SVG Output**: Clean, vectorized outputs with optional auto-coloring. ## API Documentation Once running, visit the interactive docs at: `https://your-space-name.hf.space/docs` ### Main Endpoints - `POST /api/process`: Primary endpoint for converting images. - `GET /health`: Check service status. ## Deployment on Hugging Face 1. Create a new **Space**. 2. Select **Gradio** as the SDK (even though we use FastAPI). 3. Upload all files. 4. Set `GENERATION_API_KEY` in the Space settings if using AI prompt generation. ## Local Development ```bash pip install -r requirements.txt python app.py ```