Files changed (3) hide show
  1. README.md +1 -2
  2. requirements.txt +6 -5
  3. run/gradio_ootd.py +0 -46
README.md CHANGED
@@ -4,8 +4,7 @@ emoji: 🥼👖👗
4
  colorFrom: yellow
5
  colorTo: pink
6
  sdk: gradio
7
- sdk_version: 6.20.0
8
- python_version: '3.10'
9
  app_file: ./run/gradio_ootd.py
10
  pinned: false
11
  license: cc-by-nc-sa-4.0
 
4
  colorFrom: yellow
5
  colorTo: pink
6
  sdk: gradio
7
+ sdk_version: 4.36.1
 
8
  app_file: ./run/gradio_ootd.py
9
  pinned: false
10
  license: cc-by-nc-sa-4.0
requirements.txt CHANGED
@@ -1,17 +1,18 @@
1
- torch==2.8.0
2
- torchvision==0.23.0
3
- torchaudio==2.8.0
4
  numpy==1.24.4
5
  scipy==1.10.1
6
  scikit-image==0.21.0
7
  opencv-python==4.7.0.72
8
  pillow==9.4.0
9
  diffusers==0.24.0
10
- transformers
11
  accelerate==0.26.1
12
  matplotlib==3.7.4
13
  tqdm==4.64.1
 
14
  config==0.5.1
15
  einops==0.7.0
16
  onnxruntime==1.16.2
17
- basicsr
 
1
+ torch==2.0.1
2
+ torchvision==0.15.2
3
+ torchaudio==2.0.2
4
  numpy==1.24.4
5
  scipy==1.10.1
6
  scikit-image==0.21.0
7
  opencv-python==4.7.0.72
8
  pillow==9.4.0
9
  diffusers==0.24.0
10
+ transformers==4.36.2
11
  accelerate==0.26.1
12
  matplotlib==3.7.4
13
  tqdm==4.64.1
14
+ gradio==4.16.0
15
  config==0.5.1
16
  einops==0.7.0
17
  onnxruntime==1.16.2
18
+ basicsr
run/gradio_ootd.py CHANGED
@@ -1,50 +1,4 @@
1
  import spaces
2
- # --- compat shim: torchvision >=0.17 removed torchvision.transforms.functional_tensor,
3
- # which basicsr/gfpgan/facexlib still import from. Re-create it as an alias module
4
- # pointing at torchvision.transforms.functional (which has the same tensor-capable fns).
5
- import sys as _sys, types as _types
6
- try:
7
- import torchvision.transforms.functional as _tv_functional
8
- if "torchvision.transforms.functional_tensor" not in _sys.modules:
9
- _functional_tensor_shim = _types.ModuleType("torchvision.transforms.functional_tensor")
10
- for _name in ("rgb_to_grayscale", "adjust_brightness", "adjust_contrast",
11
- "adjust_hue", "adjust_saturation", "normalize"):
12
- if hasattr(_tv_functional, _name):
13
- setattr(_functional_tensor_shim, _name, getattr(_tv_functional, _name))
14
- _sys.modules["torchvision.transforms.functional_tensor"] = _functional_tensor_shim
15
- except Exception:
16
- pass
17
- # --- end compat shim ---
18
-
19
-
20
- # --- compat shim: huggingface_hub >=1.0 removed cached_download and HfFolder,
21
- # which diffusers==0.24.0 (and old transformers) still import. Re-inject them
22
- # BEFORE importing diffusers / transformers / the model.
23
- import huggingface_hub as _hub
24
- import huggingface_hub.constants as _hc
25
- if not hasattr(_hub, "cached_download"):
26
- _hub.cached_download = _hub.hf_hub_download
27
- if not hasattr(_hub, "HfFolder"):
28
- class _HfFolder:
29
- @staticmethod
30
- def get_token():
31
- return _hub.get_token()
32
- _hub.HfFolder = _HfFolder
33
- if not hasattr(_hc, "hf_cache_home"):
34
- _hc.hf_cache_home = _hc.HF_HOME
35
- if not hasattr(_hub, "is_offline_mode"):
36
- _hub.is_offline_mode = lambda: _hc.HF_HUB_OFFLINE
37
- # --- end hub compat shim ---
38
-
39
-
40
- # --- compat shim: transformers >=5.0 removed the Flax weight-name constant that
41
- # diffusers==0.24.0 (pipeline_utils) still imports. Re-inject it BEFORE the
42
- # diffusers/transformers import chain triggered by the model imports below.
43
- import transformers.utils as _tu
44
- if not hasattr(_tu, "FLAX_WEIGHTS_NAME"):
45
- _tu.FLAX_WEIGHTS_NAME = "flax_model.msgpack"
46
- # --- end transformers compat shim ---
47
-
48
 
49
  import gradio as gr
50
  import os
 
1
  import spaces
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  import gradio as gr
4
  import os