pragnakalp commited on
Commit
3c501a8
1 Parent(s): 0471778

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -118,7 +118,7 @@ def merge_frames():
118
  filenames.sort() # this iteration technique has no built in order, so sort the frames
119
  print(filenames)
120
  images = list(map(lambda filename: imageio.imread("/content/video_results/restored_imgs/"+filename), filenames))
121
- os.system(f"rm -rf /content/video_output.mp4")
122
  imageio.mimsave('/content/video_output.mp4', images, fps=25.0) # modify the frame duration as needed
123
  return "/content/video_output.mp4"
124
 
@@ -127,7 +127,7 @@ def audio_video():
127
  input_video = ffmpeg.input('/content/video_output.mp4')
128
 
129
  input_audio = ffmpeg.input('/content/audio.wav')
130
- os.system(f"rm -rf /content/final_output.mp4")
131
  ffmpeg.concat(input_video, input_audio, v=1, a=1).output('/content/final_output.mp4').run()
132
 
133
  return "/content/final_output.mp4"
@@ -155,7 +155,7 @@ def one_shot_talking(image_in,audio_in):
155
 
156
  #2. Improve image quality using GFPGAN on each frames
157
  os.system(f"rm -rf /content/extracted_frames/image_audio_frames")
158
- os.system(f"rm -rf /content/video_results/")
159
  os.system(f"python /content/GFPGAN/inference_gfpgan.py --upscale 2 -i /content/extracted_frames/image_audio_frames -o /content/video_results --bg_upsampler realesrgan")
160
 
161
  #3. Merge all the frames to a one video using imageio
 
118
  filenames.sort() # this iteration technique has no built in order, so sort the frames
119
  print(filenames)
120
  images = list(map(lambda filename: imageio.imread("/content/video_results/restored_imgs/"+filename), filenames))
121
+ # os.system(f"rm -rf /content/video_output.mp4")
122
  imageio.mimsave('/content/video_output.mp4', images, fps=25.0) # modify the frame duration as needed
123
  return "/content/video_output.mp4"
124
 
 
127
  input_video = ffmpeg.input('/content/video_output.mp4')
128
 
129
  input_audio = ffmpeg.input('/content/audio.wav')
130
+ # os.system(f"rm -rf /content/final_output.mp4")
131
  ffmpeg.concat(input_video, input_audio, v=1, a=1).output('/content/final_output.mp4').run()
132
 
133
  return "/content/final_output.mp4"
 
155
 
156
  #2. Improve image quality using GFPGAN on each frames
157
  os.system(f"rm -rf /content/extracted_frames/image_audio_frames")
158
+ # os.system(f"rm -rf /content/video_results/")
159
  os.system(f"python /content/GFPGAN/inference_gfpgan.py --upscale 2 -i /content/extracted_frames/image_audio_frames -o /content/video_results --bg_upsampler realesrgan")
160
 
161
  #3. Merge all the frames to a one video using imageio