--- title: Image Color Palette Extractor emoji: 🎨 colorFrom: blue colorTo: red sdk: gradio app_file: app.py pinned: false license: mit short_description: Extract dominant colors from images --- ## Image Color Palette Extractor This application extracts dominant colors from images using an advanced color clustering algorithm. It uses LAB color space for better color perception and provides a visual palette of the most prominent colors in the image. ## Features - Upload an image or select a preset image. - Detect and segment features in the image. - Apply AI-powered smile enhancement to improve dental appearance. - Load models lazily for improved Docker deployment performance. - Health check endpoint for monitoring application status. ## USAGE 1. Upload your image or select a preset 2. Click "Generate Smile" to enhance the smile in the image 3. The enhanced image will appear on the right ## Deployment Notes This application uses lazy loading for the segmentation model to improve performance in Docker containers. The model is loaded only when needed for the first time, which helps with deployment on platforms like Hugging Face Spaces. ### Environment Variables - `REPLICATE_API_TOKEN`: Your Replicate API token for accessing the flux-fill-dev model ### Docker Deployment ```bash docker build -t smile-enhancer . docker run -p 7860:7860 smile-enhancer docker run -p 7860:7860 --env REPLICATE_API_TOKEN=your_token_here smile-enhancer ``` ### Hugging Face Deployment The application is configured to work with Hugging Face Spaces using the Docker SDK. Make sure to set the `REPLICATE_API_TOKEN` secret in your Space settings.