Spaces:
Runtime error
Runtime error
Download download_checkpoints.py from GRATITUD3/zero123plus: direct link, hf CLI and curl.
- Browser
- Download file 539 Bytes
-
https://huggingface.co/spaces/GRATITUD3/zero123plus/resolve/1059e8fdb36ccedb4028c00878eb5b99dab5eae2/download_checkpoints.py
- Command line
-
hf download hf://spaces/GRATITUD3/zero123plus@1059e8fdb36ccedb4028c00878eb5b99dab5eae2/download_checkpoints.py
-
curl -L -o download_checkpoints.py https://huggingface.co/spaces/GRATITUD3/zero123plus/resolve/1059e8fdb36ccedb4028c00878eb5b99dab5eae2/download_checkpoints.py
539 Bytes
| import os | |
| import torch | |
| import urllib.request | |
| import huggingface_hub | |
| from diffusers import DiffusionPipeline | |
| if 'HF_TOKEN' in os.environ: | |
| huggingface_hub.login(os.environ['HF_TOKEN']) | |
| sam_checkpoint = "tmp/sam_vit_h_4b8939.pth" | |
| os.makedirs('tmp', exist_ok=True) | |
| urllib.request.urlretrieve( | |
| "https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth", | |
| sam_checkpoint | |
| ) | |
| DiffusionPipeline.from_pretrained( | |
| "sudo-ai/zero123plus-v1.1", custom_pipeline="sudo-ai/zero123plus-pipeline", | |
| torch_dtype=torch.float16 | |
| ) | |