majinyu commited on
Commit
338116c
·
1 Parent(s): 4f73ea5

install some requirements in app.py

Browse files
Files changed (2) hide show
  1. app.py +6 -7
  2. requirements.txt +3 -3
app.py CHANGED
@@ -1,13 +1,12 @@
1
  import os
2
 
3
  # setup Grouded-Segment-Anything
4
- os.system("python -m pip install -e 'Grounded-Segment-Anything/segment_anything'")
5
- os.system("python -m pip install -e 'Grounded-Segment-Anything/GroundingDINO'")
6
- os.system("pip install --upgrade diffusers[torch]")
7
- os.system("pip install opencv-python pycocotools matplotlib onnxruntime onnx ipykernel")
8
-
9
- # setup recognize-anything
10
- os.system("python -m pip install -e 'recognize-anything'")
11
 
12
  import random # noqa: E402
13
 
 
1
  import os
2
 
3
  # setup Grouded-Segment-Anything
4
+ # building GroundingDINO requires torch but imports it before installing,
5
+ # so directly installing in requirements.txt causes dependency error.
6
+ os.system((
7
+ "git clone https://github.com/IDEA-Research/Grounded-Segment-Anything.git "
8
+ "&& pip install -e 'Grounded-Segment-Anything/GroundingDINO'"
9
+ ))
 
10
 
11
  import random # noqa: E402
12
 
requirements.txt CHANGED
@@ -8,10 +8,9 @@ Pillow
8
  scipy
9
  git+https://github.com/openai/CLIP.git
10
  git+https://github.com/IDEA-Research/Grounded-Segment-Anything.git/#subdirectory=segment_anything
11
- git+https://github.com/IDEA-Research/Grounded-Segment-Anything.git/#subdirectory=GroundingDINO
12
  git+https://github.com/xinyu1205/recognize-anything.git
13
  addict
14
- diffusers
15
  gradio
16
  huggingface_hub
17
  matplotlib
@@ -25,4 +24,5 @@ setuptools
25
  supervision
26
  termcolor
27
  yapf
28
- nltk
 
 
8
  scipy
9
  git+https://github.com/openai/CLIP.git
10
  git+https://github.com/IDEA-Research/Grounded-Segment-Anything.git/#subdirectory=segment_anything
 
11
  git+https://github.com/xinyu1205/recognize-anything.git
12
  addict
13
+ diffusers[torch]
14
  gradio
15
  huggingface_hub
16
  matplotlib
 
24
  supervision
25
  termcolor
26
  yapf
27
+ nltk
28
+ ipykernel