rootglitch commited on
Commit
f75ef25
·
verified ·
1 Parent(s): 4eec4e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -7
app.py CHANGED
@@ -2,16 +2,23 @@ import os
2
  import sys
3
  from huggingface_hub import hf_hub_download
4
 
5
- os.system("wget https://github.com/IDEA-Research/GroundingDINO.git")
6
- os.system("wget https://github.com/SysCV/sam-hq.git")
7
- os.system("python -m pip install -e sam-hq")
8
- os.system("python -m pip install -e GroundingDINO")
9
- # os.system("pip install opencv-python pycocotools matplotlib onnxruntime onnx ipykernel")
10
- # os.system("wget https://huggingface.co/ShilongLiu/GroundingDINO/resolve/main/groundingdino_swint_ogc.pth")
11
- # os.system("wget https://huggingface.co/lkeab/hq-sam/resolve/main/sam_hq_vit_l.pth")
 
 
12
  sys.path.append(os.path.join(os.getcwd(), "GroundingDINO"))
13
  sys.path.append(os.path.join(os.getcwd(), "sam-hq"))
14
 
 
 
 
 
 
15
  # Fetch code from a private repo
16
  code_path = hf_hub_download(
17
  repo_id="rootglitch/CarVizGradioDemo01",
 
2
  import sys
3
  from huggingface_hub import hf_hub_download
4
 
5
+ # Clone repositories correctly
6
+ os.system("git clone https://github.com/IDEA-Research/GroundingDINO.git")
7
+ os.system("git clone https://github.com/SysCV/sam-hq.git")
8
+
9
+ # Install dependencies correctly
10
+ os.system("pip install -e GroundingDINO")
11
+ os.system("pip install -e sam-hq")
12
+
13
+ # Ensure the repositories are in Python's path
14
  sys.path.append(os.path.join(os.getcwd(), "GroundingDINO"))
15
  sys.path.append(os.path.join(os.getcwd(), "sam-hq"))
16
 
17
+ # # Download model weights from Hugging Face
18
+ # hf_hub_download(repo_id="ShilongLiu/GroundingDINO", filename="groundingdino_swint_ogc.pth", local_dir="GroundingDINO")
19
+ # hf_hub_download(repo_id="lkeab/hq-sam", filename="sam_hq_vit_l.pth", local_dir="sam-hq")
20
+
21
+
22
  # Fetch code from a private repo
23
  code_path = hf_hub_download(
24
  repo_id="rootglitch/CarVizGradioDemo01",