gyrus2 commited on
Commit
5d20d3d
·
verified ·
1 Parent(s): 37a8d5e

Fix model download URLs and update requirements

Browse files
Files changed (2) hide show
  1. app.py +14 -1
  2. requirements.txt +18 -8
app.py CHANGED
@@ -35,9 +35,22 @@ FACE_SEG_MODEL = "face_segmentation.pth"
35
  # Direct download links for model weights. These links point to publicly
36
  # accessible mirrors. If they stop working, you can upload the files into
37
  # the checkpoints folder manually and the app will skip downloading.
 
 
 
 
 
 
 
 
 
 
 
38
  MODEL_URLS = {
 
39
  WAV2LIP_MODEL: "https://huggingface.co/Non-playing-Character/Wave2lip/resolve/main/wav2lip_gan.pth",
40
- FACE_SEG_MODEL: "https://huggingface.co/Non-playing-Character/Wave2lip/resolve/main/face_segmentation.pth",
 
41
  }
42
 
43
 
 
35
  # Direct download links for model weights. These links point to publicly
36
  # accessible mirrors. If they stop working, you can upload the files into
37
  # the checkpoints folder manually and the app will skip downloading.
38
+ # Public mirrors for the required model weights.
39
+ #
40
+ # The original Wav2Lip checkpoint (``wav2lip_gan.pth``) and face segmentation
41
+ # model are large binary files hosted on Hugging Face. During development we
42
+ # discovered that the URLs previously used in this script pointed at the wrong
43
+ # repository (``Wave2lip`` vs ``Wave2Lip``) and returned 404 errors. The
44
+ # corrected links below refer to the official ``Wave2lip`` repository for the
45
+ # GAN checkpoint and to a Wav2Lip‑HD repository for the face segmentation
46
+ # model. Note that these files are large (hundreds of megabytes) and may
47
+ # require you to upload them manually into the ``checkpoints`` directory of
48
+ # your Space if the automated download fails due to network restrictions.
49
  MODEL_URLS = {
50
+ # 436 MB GAN checkpoint hosted by Non‑playing‑Character
51
  WAV2LIP_MODEL: "https://huggingface.co/Non-playing-Character/Wave2lip/resolve/main/wav2lip_gan.pth",
52
+ # 53 MB face segmentation model hosted by commanderx (Wav2Lip‑HD project)
53
+ FACE_SEG_MODEL: "https://huggingface.co/commanderx/Wav2Lip-HD/resolve/main/checkpoints/face_segmentation.pth",
54
  }
55
 
56
 
requirements.txt CHANGED
@@ -1,15 +1,25 @@
 
1
  gradio==4.43.0
 
 
2
  numpy
3
- opencv-python
4
- scipy
5
  pydub
 
 
6
  moviepy
 
 
7
  torch
8
  torchvision
9
- gitpython
10
- ffmpeg-python
11
- tqdm
12
  requests
13
- gfpgan
14
- realesrgan
15
- basicsr
 
 
 
 
 
1
+ # Pin gradio version for consistent API behaviour
2
  gradio==4.43.0
3
+
4
+ # Core numerical libraries
5
  numpy
6
+
7
+ # Audio processing
8
  pydub
9
+
10
+ # Video and audio I/O helpers
11
  moviepy
12
+
13
+ # Deep learning frameworks required by Wav2Lip
14
  torch
15
  torchvision
16
+
17
+ # Utility libraries
 
18
  requests
19
+ tqdm
20
+
21
+ # FFmpeg bindings (used by moviepy/pydub). Note: the FFmpeg binary is provided by the Spaces environment.
22
+ ffmpeg-python
23
+
24
+ # Optional: OpenCV for future enhancements (not strictly required by the current app but lightweight)
25
+ opencv-python