maduvantha commited on
Commit
1fd7cd3
·
1 Parent(s): ea457b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -8,6 +8,8 @@ import matplotlib.pyplot as plt
8
  import matplotlib.animation as animation
9
  from skimage.transform import resize
10
  import warnings
 
 
11
  from demo import load_checkpoints
12
 
13
  warnings.filterwarnings("ignore")
@@ -46,4 +48,9 @@ st.write("Hello, World!")
46
  # display Markdown
47
  st.write("# Hello, World!")
48
 
49
- generator, kp_detector = load_checkpoints(config_path='config/vox-256.yaml',checkpoint_path='vox-cpk.pth.tar')
 
 
 
 
 
 
8
  import matplotlib.animation as animation
9
  from skimage.transform import resize
10
  import warnings
11
+ from demo import make_animation
12
+ from skimage import img_as_ubyte
13
  from demo import load_checkpoints
14
 
15
  warnings.filterwarnings("ignore")
 
48
  # display Markdown
49
  st.write("# Hello, World!")
50
 
51
+ generator, kp_detector = load_checkpoints(config_path='config/vox-256.yaml',checkpoint_path='vox-cpk.pth.tar')
52
+
53
+ predictions = make_animation(source_image, driving_video, generator, kp_detector, relative=True)
54
+
55
+ #save resulting video
56
+ imageio.mimsave('generated.mp4', [img_as_ubyte(frame) for frame in predictions])