Spaces:
Sleeping
Sleeping
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) |