Click3R / app.py
yaojin17's picture
Point links at the renamed repos
085cda3 verified
Raw History Blame Contribute Delete
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]
)