-
Notifications
You must be signed in to change notification settings - Fork 30
/
install.py
42 lines (28 loc) · 879 Bytes
/
install.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import json
import launch
def install_segmentanything():
launch.run_pip('install segment_anything')
def install_segmentanything_hq():
launch.run_pip('install segment_anything_hq')
def install_ultralytics():
launch.run_pip('install ultralytics')
def install_diffusers():
launch.run_pip('install diffusers==0.27.2')
try:
from basicsr.utils.download_util import load_file_from_url
except:
launch.run_pip('install basicsr==1.4.2')
required = {
('segment_anything', install_segmentanything),
('segment_anything_hq', install_segmentanything_hq),
('ultralytics', install_ultralytics),
('diffusers', install_diffusers)
}
for pack_name, func in required:
if not launch.is_installed(pack_name):
func()
'''
with open('ui-config.json', 'rt', encoding='UTF8') as f:
j = json.load(f)
print(json.dumps(j, indent=2))
'''