Spaces:
Runtime error
Runtime error
Download app/api/enhancer.py from akashmx77/image_tools: direct link, hf CLI and curl.
- Browser
- Download file 714 Bytes
-
https://huggingface.co/spaces/akashmx77/image_tools/resolve/main/app/api/enhancer.py
- Command line
-
hf download hf://spaces/akashmx77/image_tools/app/api/enhancer.py
-
curl -L -o enhancer.py https://huggingface.co/spaces/akashmx77/image_tools/resolve/main/app/api/enhancer.py
714 Bytes
| # app/api/enhancer.py | |
| from fastapi import APIRouter, File, UploadFile | |
| from fastapi.responses import FileResponse | |
| from app.services.enhancer_service import enhance_image | |
| from typing import Annotated | |
| router = APIRouter() | |
| async def enhance( | |
| file: Annotated[UploadFile, File(description="Image file (JPEG/PNG)")] | |
| ): | |
| """Enhances image quality through multi-stage processing pipeline""" | |
| output_path = await enhance_image(file) | |
| return FileResponse( | |
| output_path, | |
| media_type="image/png", | |
| headers={"X-Enhancement-Method": "v2.1"} | |
| ) | |