Download app.py from Fred808/Seer: direct link, hf CLI and curl.
- Browser
- Download file 450 Bytes
-
https://huggingface.co/spaces/Fred808/Seer/resolve/main/app.py
- Command line
-
hf download hf://spaces/Fred808/Seer/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Fred808/Seer/resolve/main/app.py
450 Bytes
| import os | |
| os.environ["HF_HOME"] = "/tmp/hf_cache" | |
| os.environ["TRANSFORMERS_CACHE"] = "/tmp/hf_cache" | |
| from fastapi import FastAPI, File, UploadFile | |
| from vision_model import describe_image | |
| import shutil | |
| app = FastAPI() | |
| async def process_vision(image: UploadFile = File(...)): | |
| with open("frame.jpg", "wb") as f: | |
| shutil.copyfileobj(image.file, f) | |
| desc = describe_image("frame.jpg") | |
| return {"description": desc} |