jmanhype commited on
Commit
d299ce8
β€’
1 Parent(s): 06e9d12

Update Gradio version and optimize dependencies

Browse files
Files changed (2) hide show
  1. requirements.txt +14 -18
  2. scripts/gradio/app_gradio_space.py +20 -22
requirements.txt CHANGED
@@ -1,37 +1,36 @@
 
 
 
 
 
 
 
 
 
 
1
  diffusers @ git+https://github.com/TMElyralab/diffusers.git@tme
2
  ip_adapter @ git+https://github.com/tencent-ailab/IP-Adapter.git@main
3
  clip @ git+https://github.com/openai/CLIP.git@main
4
  controlnet_aux @ git+https://github.com/TMElyralab/controlnet_aux.git@tme
5
  mmcm @ git+https://github.com/TMElyralab/MMCM.git@setup
6
- torch
7
- torchvision
8
- torchaudio
9
  ninja==1.11.1
10
- transformers==4.33.1
11
  bitsandbytes==0.41.1
12
- decord==0.6.0
13
- accelerate==0.22.0
14
  xformers==0.0.21
15
  omegaconf
16
  einops
17
  imageio==2.31.1
18
  pandas
19
- h5py
20
  matplotlib
21
- modelcards==0.1.6
22
  pynvml==11.5.0
23
  moviepy==1.0.3
24
  scikit-learn
25
- librosa
26
  ffmpeg-python
27
  easydict
28
- webp
29
  mediapipe==0.10.3
30
- cython==3.0.2
31
  insightface==0.7.3
32
- librosa==0.10.1
33
- onnx==1.14.1
34
- onnxruntime==1.15.1
35
  opencv-python
36
  Pillow
37
  protobuf==3.20.3
@@ -45,14 +44,11 @@ pytorch-lightning==2.0.8
45
  timm==0.9.12
46
  safetensors==0.3.3
47
  pycocotools
48
- wget
49
  kornia==0.7.0
50
  open_clip_torch==2.20.0
51
  torchmetrics==1.1.1
52
  invisible-watermark==0.1.5
53
  ftfy==6.1.1
54
- gradio==3.50.2
55
  loguru==0.6.0
56
  markupsafe==2.0.1
57
- cuid
58
- spaces
 
1
+ # Core dependencies
2
+ torch
3
+ torchvision
4
+ torchaudio
5
+ transformers==4.33.1
6
+ accelerate==0.22.0
7
+ gradio>=4.0.0
8
+ spaces
9
+
10
+ # Model dependencies
11
  diffusers @ git+https://github.com/TMElyralab/diffusers.git@tme
12
  ip_adapter @ git+https://github.com/tencent-ailab/IP-Adapter.git@main
13
  clip @ git+https://github.com/openai/CLIP.git@main
14
  controlnet_aux @ git+https://github.com/TMElyralab/controlnet_aux.git@tme
15
  mmcm @ git+https://github.com/TMElyralab/MMCM.git@setup
16
+
17
+ # Additional dependencies
 
18
  ninja==1.11.1
 
19
  bitsandbytes==0.41.1
 
 
20
  xformers==0.0.21
21
  omegaconf
22
  einops
23
  imageio==2.31.1
24
  pandas
 
25
  matplotlib
 
26
  pynvml==11.5.0
27
  moviepy==1.0.3
28
  scikit-learn
29
+ librosa==0.10.1
30
  ffmpeg-python
31
  easydict
 
32
  mediapipe==0.10.3
 
33
  insightface==0.7.3
 
 
 
34
  opencv-python
35
  Pillow
36
  protobuf==3.20.3
 
44
  timm==0.9.12
45
  safetensors==0.3.3
46
  pycocotools
 
47
  kornia==0.7.0
48
  open_clip_torch==2.20.0
49
  torchmetrics==1.1.1
50
  invisible-watermark==0.1.5
51
  ftfy==6.1.1
 
52
  loguru==0.6.0
53
  markupsafe==2.0.1
54
+ cuid
 
scripts/gradio/app_gradio_space.py CHANGED
@@ -21,30 +21,28 @@ sys.path.insert(0, f"{ProjectDir}/diffusers/src")
21
  sys.path.insert(0, f"{ProjectDir}/controlnet_aux/src")
22
  sys.path.insert(0, f"{ProjectDir}/scripts/gradio")
23
 
24
- result = subprocess.run(
25
- ["pip", "install", "--no-cache-dir", "-U", "openmim"],
26
- capture_output=True,
27
- text=True,
28
- )
29
- print(result)
30
-
31
- result = subprocess.run(["mim", "install", "mmengine"], capture_output=True, text=True)
32
- print(result)
33
-
34
- result = subprocess.run(
35
- ["mim", "install", "mmcv>=2.0.1"], capture_output=True, text=True
36
- )
37
- print(result)
 
 
 
 
 
38
 
39
- result = subprocess.run(
40
- ["mim", "install", "mmdet>=3.1.0"], capture_output=True, text=True
41
- )
42
- print(result)
43
 
44
- result = subprocess.run(
45
- ["mim", "install", "mmpose>=1.1.0"], capture_output=True, text=True
46
- )
47
- print(result)
48
  ignore_video2video = True
49
  max_image_edge = 960
50
 
 
21
  sys.path.insert(0, f"{ProjectDir}/controlnet_aux/src")
22
  sys.path.insert(0, f"{ProjectDir}/scripts/gradio")
23
 
24
+ # Install dependencies first
25
+ def install_dependencies():
26
+ dependencies = [
27
+ "openmim",
28
+ "mmengine",
29
+ "mmcv>=2.0.1",
30
+ "mmdet>=3.1.0",
31
+ "mmpose>=1.1.0"
32
+ ]
33
+ for dep in dependencies:
34
+ try:
35
+ subprocess.run(
36
+ ["pip", "install", "--no-cache-dir", "-U", dep],
37
+ check=True,
38
+ capture_output=True,
39
+ text=True
40
+ )
41
+ except subprocess.CalledProcessError as e:
42
+ print(f"Warning: Failed to install {dep}: {e.stderr}")
43
 
44
+ install_dependencies()
 
 
 
45
 
 
 
 
 
46
  ignore_video2video = True
47
  max_image_edge = 960
48