File size: 926 Bytes
aecfe9f
 
 
4190676
 
 
 
 
 
 
 
 
 
aecfe9f
 
c748d9e
fdfc287
aecfe9f
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os
from huggingface_hub import hf_hub_download

os.system("wget https://github.com/IDEA-Research/GroundingDINO.git")
os.system("wget https://github.com/SysCV/sam-hq.git")
os.system("python -m pip install -e sam-hq")
os.system("python -m pip install -e GroundingDINO")
# os.system("pip install opencv-python pycocotools matplotlib onnxruntime onnx ipykernel")
# os.system("wget https://huggingface.co/ShilongLiu/GroundingDINO/resolve/main/groundingdino_swint_ogc.pth")
# os.system("wget https://huggingface.co/lkeab/hq-sam/resolve/main/sam_hq_vit_l.pth")
sys.path.append(os.path.join(os.getcwd(), "GroundingDINO"))
sys.path.append(os.path.join(os.getcwd(), "sam-hq"))

# Fetch code from a private repo
code_path = hf_hub_download(
    repo_id="rootglitch/CarVizGradioDemo01",
    repo_type="space",
    filename="app.py",
    token=os.environ["HF_TOKEN"],
)
with open(code_path, "r") as f:
    code = f.read()
exec(code)