File size: 870 Bytes
d66a781
 
 
 
 
61dea4a
 
d66a781
 
 
 
085cda3
d66a781
61dea4a
 
 
 
 
 
d66a781
 
 
 
 
 
 
 
 
bd702ef
d66a781
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""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]
    )