Commit
·
97d2ab4
1
Parent(s):
5a09824
Update app.py
Browse files
app.py
CHANGED
@@ -105,7 +105,7 @@ def crop_src_image(src_img, detector=None):
|
|
105 |
else:
|
106 |
img = cv2.resize(img,(256,256))
|
107 |
cv2.imwrite(save_img, img)
|
108 |
-
|
109 |
|
110 |
|
111 |
def pad_image(image):
|
@@ -141,6 +141,7 @@ def one_shot_talking(image_in,audio_in):
|
|
141 |
#Pre-processing of image
|
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 |
|
@@ -161,7 +162,7 @@ def one_shot_talking(image_in,audio_in):
|
|
161 |
merge_frames()
|
162 |
|
163 |
audio_video()
|
164 |
-
|
165 |
|
166 |
|
167 |
def one_shot(image,input_text,gender):
|
@@ -214,7 +215,7 @@ def run():
|
|
214 |
# audio_in = gr.Audio(show_label=False, type='filepath')
|
215 |
input_text=gr.Textbox(lines=3, value="Hello How are you?", label="Input Text")
|
216 |
gender = gr.Radio(["Female","Male"],value="Female",label="Gender")
|
217 |
-
video_out = gr.
|
218 |
# video_out = gr.Video(show_label=False)
|
219 |
with gr.Row().style(equal_height=True):
|
220 |
btn = gr.Button("Generate")
|
|
|
105 |
else:
|
106 |
img = cv2.resize(img,(256,256))
|
107 |
cv2.imwrite(save_img, img)
|
108 |
+
return save_img
|
109 |
|
110 |
|
111 |
def pad_image(image):
|
|
|
141 |
#Pre-processing of image
|
142 |
crop_src_image(image_in)
|
143 |
|
144 |
+
exit()
|
145 |
#Improve quality of input image
|
146 |
os.system(f"python /content/GFPGAN/inference_gfpgan.py --upscale 2 -i /content/image_pre.png -o /content/results --bg_upsampler realesrgan")
|
147 |
|
|
|
162 |
merge_frames()
|
163 |
|
164 |
audio_video()
|
165 |
+
|
166 |
|
167 |
|
168 |
def one_shot(image,input_text,gender):
|
|
|
215 |
# audio_in = gr.Audio(show_label=False, type='filepath')
|
216 |
input_text=gr.Textbox(lines=3, value="Hello How are you?", label="Input Text")
|
217 |
gender = gr.Radio(["Female","Male"],value="Female",label="Gender")
|
218 |
+
video_out = gr.Image(label="output")
|
219 |
# video_out = gr.Video(show_label=False)
|
220 |
with gr.Row().style(equal_height=True):
|
221 |
btn = gr.Button("Generate")
|