Download fastapi_app.py from LearningnRunning/adult_image_detector: direct link, hf CLI and curl.
- Browser
- Download file 462 Bytes
-
https://huggingface.co/spaces/LearningnRunning/adult_image_detector/resolve/main/fastapi_app.py
- Command line
-
hf download hf://spaces/LearningnRunning/adult_image_detector/fastapi_app.py
-
curl -L -o fastapi_app.py https://huggingface.co/spaces/LearningnRunning/adult_image_detector/resolve/main/fastapi_app.py
462 Bytes
| from fastapi import FastAPI, File, UploadFile, Form | |
| from utils.api import process_image_api | |
| app = FastAPI() | |
| async def process_image_endpoint( | |
| file: UploadFile = File(...), | |
| conf_threshold: float = Form(0.25), | |
| iou_threshold: float = Form(0.45), | |
| label_mode: str = Form("Draw Confidence") | |
| ): | |
| return await process_image_api(file, conf_threshold, iou_threshold, label_mode) | |
| # Gunicorn용 app 변수 | |
| application = app |