Download app/utils.py from clove1002/VDB: direct link, hf CLI and curl.
- Browser
- Download file 210 Bytes
-
https://huggingface.co/spaces/clove1002/VDB/resolve/main/app/utils.py
- Command line
-
hf download hf://spaces/clove1002/VDB/app/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/clove1002/VDB/resolve/main/app/utils.py
210 Bytes
| from fastapi import UploadFile | |
| from PIL import Image | |
| import io | |
| def read_image(file: UploadFile) -> Image.Image: | |
| image_bytes = file.file.read() | |
| return Image.open(io.BytesIO(image_bytes)).convert("RGB") | |