artificialguybr commited on
Commit
7b3eb41
1 Parent(s): ef63608

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +41 -0
app.py ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import wget
3
+ import zipfile
4
+
5
+
6
+ # Clone necessary repositories
7
+ os.system("git clone https://github.com/vinthony/video-retalking.git")
8
+ os.system("git clone https://github.com/davisking/dlib.git")
9
+ os.system("git clone https://github.com/openai/whisper.git")
10
+
11
+ # Install dlib
12
+ os.system("cd dlib && python setup.py install")
13
+
14
+ # Create checkpoints directory in video-retalking
15
+ os.makedirs("./video-retalking/checkpoints", exist_ok=True)
16
+
17
+ # Download model checkpoints and other files
18
+ model_urls = [
19
+ "https://github.com/vinthony/video-retalking/releases/download/v0.0.1/30_net_gen.pth",
20
+ "https://github.com/vinthony/video-retalking/releases/download/v0.0.1/BFM.zip",
21
+ "https://github.com/vinthony/video-retalking/releases/download/v0.0.1/DNet.pt",
22
+ "https://github.com/vinthony/video-retalking/releases/download/v0.0.1/ENet.pth",
23
+ "https://github.com/vinthony/video-retalking/releases/download/v0.0.1/expression.mat",
24
+ "https://github.com/vinthony/video-retalking/releases/download/v0.0.1/face3d_pretrain_epoch_20.pth",
25
+ "https://github.com/vinthony/video-retalking/releases/download/v0.0.1/GFPGANv1.3.pth",
26
+ "https://github.com/vinthony/video-retalking/releases/download/v0.0.1/GPEN-BFR-512.pth",
27
+ "https://github.com/vinthony/video-retalking/releases/download/v0.0.1/LNet.pth",
28
+ "https://github.com/vinthony/video-retalking/releases/download/v0.0.1/ParseNet-latest.pth",
29
+ "https://github.com/vinthony/video-retalking/releases/download/v0.0.1/shape_predictor_68_face_landmarks.dat"
30
+ ]
31
+
32
+ for url in model_urls:
33
+ wget.download(url, out="./video-retalking/checkpoints")
34
+
35
+ # Unzip files
36
+ with zipfile.ZipFile("./video-retalking/checkpoints/BFM.zip", 'r') as zip_ref:
37
+ zip_ref.extractall("./video-retalking/checkpoints")
38
+
39
+ # Install Python packages
40
+ #os.system("pip install basicsr==1.4.2 face-alignment==1.3.4 kornia==0.5.1 ninja==1.10.2.3 einops==0.4.1 facexlib==0.2.5 librosa==0.9.2 build")
41
+