Spaces:
Running on Zero
Running on Zero
Download app.py from uva-cv-lab/Click3R: direct link, hf CLI and curl.
- Browser
- Download file 870 Bytes
-
https://huggingface.co/spaces/uva-cv-lab/Click3R/resolve/main/app.py
- Command line
-
hf download hf://spaces/uva-cv-lab/Click3R/app.py
-
curl -L -o app.py https://huggingface.co/spaces/uva-cv-lab/Click3R/resolve/main/app.py
870 Bytes
| """Hugging Face ZeroGPU entry point of the CLICK3R demo.""" | |
| import spaces # Must be imported before torch on ZeroGPU. | |
| from huggingface_hub import hf_hub_download | |
| from click3r.demo.app import create_interface, load_click3r | |
| from dust3r.model import AsymmetricCroCo3DStereo | |
| OUTPUT = "/tmp/click3r_demo" | |
| model, img_size = load_click3r( | |
| hf_hub_download("uva-cv-lab/Click3R", "click3r.pth"), "cuda" | |
| ) | |
| original = ( | |
| AsymmetricCroCo3DStereo.from_pretrained( | |
| "naver/DUSt3R_ViTLarge_BaseDecoder_224_linear" | |
| ) | |
| .to("cuda") | |
| .eval() | |
| ) | |
| interface = create_interface( | |
| model, | |
| "cuda", | |
| OUTPUT, | |
| "click3r.pth", | |
| img_size=img_size, | |
| original_model=original, | |
| gpu_decorator=spaces.GPU(duration=30), | |
| ) | |
| if __name__ == "__main__": | |
| interface.queue(default_concurrency_limit=1, max_size=16).launch( | |
| allowed_paths=[OUTPUT] | |
| ) | |