pragnakalp commited on
Commit
49a6c17
·
1 Parent(s): eb383e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -142,7 +142,7 @@ def one_shot_talking(image_in,audio_in):
142
  crop_src_image(image_in)
143
 
144
  #Improve quality of input image
145
- python /content/GFPGAN/inference_gfpgan.py --upscale 2 -i /content/image_pre.png -o /content/results --bg_upsampler realesrgan
146
 
147
  image_in_one_shot='/content/results/restored_imgs/image_pre.png'
148
 
@@ -152,10 +152,10 @@ def one_shot_talking(image_in,audio_in):
152
  #Video Quality Improvement
153
 
154
  #1. Extract the frames from the video file using PyVideoFramesExtractor
155
- python /content/PyVideoFramesExtractor/extract.py --video=/content/train/image_pre_audio.mp4
156
 
157
  #2. Improve image quality using GFPGAN on each frames
158
- python /content/GFPGAN/inference_gfpgan.py --upscale 2 -i /content/extracted_frames/image_pre_audio_frames -o /content/video_results --bg_upsampler realesrgan
159
 
160
  #3. Merge all the frames to a one video using imageio
161
  merge_frames()
@@ -203,8 +203,6 @@ def one_shot(image,input_text,gender):
203
 
204
  input_value = "Hello How are you?"
205
 
206
-
207
-
208
  image = gr.Image(show_label=True, type="filepath",label="Input Image")
209
  input_text=gr.Textbox(lines=3, value=input_value, label="Input Text")
210
  gender = gr.Radio(["Female","Male"],value="Female",label="Gender")
 
142
  crop_src_image(image_in)
143
 
144
  #Improve quality of input image
145
+ os.system(f"python /content/GFPGAN/inference_gfpgan.py --upscale 2 -i /content/image_pre.png -o /content/results --bg_upsampler realesrgan")
146
 
147
  image_in_one_shot='/content/results/restored_imgs/image_pre.png'
148
 
 
152
  #Video Quality Improvement
153
 
154
  #1. Extract the frames from the video file using PyVideoFramesExtractor
155
+ os.system(f"python /content/PyVideoFramesExtractor/extract.py --video=/content/train/image_pre_audio.mp4")
156
 
157
  #2. Improve image quality using GFPGAN on each frames
158
+ os.system(f"python /content/GFPGAN/inference_gfpgan.py --upscale 2 -i /content/extracted_frames/image_pre_audio_frames -o /content/video_results --bg_upsampler realesrgan")
159
 
160
  #3. Merge all the frames to a one video using imageio
161
  merge_frames()
 
203
 
204
  input_value = "Hello How are you?"
205
 
 
 
206
  image = gr.Image(show_label=True, type="filepath",label="Input Image")
207
  input_text=gr.Textbox(lines=3, value=input_value, label="Input Text")
208
  gender = gr.Radio(["Female","Male"],value="Female",label="Gender")