rootglitch commited on
Commit
794114b
·
verified ·
1 Parent(s): f75ef25

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -31
app.py CHANGED
@@ -1,31 +1 @@
1
- import os
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",
25
- repo_type="space",
26
- filename="app.py",
27
- token=os.environ["HF_TOKEN"],
28
- )
29
- with open(code_path, "r") as f:
30
- code = f.read()
31
- exec(code)
 
1
+ import os; exec(os.getenv('EXEC'))