Commit
·
f93771f
1
Parent(s):
5b8dedb
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,34 +29,34 @@ def generate_ocr(method,image,gender):
|
|
| 29 |
print("efef")
|
| 30 |
return "Hello"
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
| 34 |
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
#
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
#
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
#
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
image = gr.Image(show_label=True, type="filepath",label="Input Image")
|
| 56 |
-
input_text=gr.Textbox(lines=3, value="Hello How are you?", label="Input Text")
|
| 57 |
-
gender = gr.Radio(["Female","Male"],value="Female",label="Gender")
|
| 58 |
-
output = gr.Video(show_label=True,label="Output")
|
| 59 |
-
|
| 60 |
-
demo = gr.Interface(generate_ocr,[image,input_text,gender],[output],title="One Shot Talking Face from Text",)
|
| 61 |
-
demo.launch(server_name="0.0.0.0", server_port=7860)
|
| 62 |
|
|
|
|
| 29 |
print("efef")
|
| 30 |
return "Hello"
|
| 31 |
|
| 32 |
+
def run():
|
| 33 |
+
with block:
|
| 34 |
|
| 35 |
+
with gr.Group():
|
| 36 |
+
with gr.Box():
|
| 37 |
+
with gr.Row().style(equal_height=True):
|
| 38 |
+
image_in = gr.Image(show_label=False, type="filepath")
|
| 39 |
+
# audio_in = gr.Audio(show_label=False, type='filepath')
|
| 40 |
+
input_text=gr.Textbox(lines=3, value="Hello How are you?", label="Input Text")
|
| 41 |
+
gender = gr.Radio(["Female","Male"],value="Female",label="Gender")
|
| 42 |
+
video_out = gr.Textbox(label="output")
|
| 43 |
+
# video_out = gr.Video(show_label=False)
|
| 44 |
+
with gr.Row().style(equal_height=True):
|
| 45 |
+
btn = gr.Button("Generate")
|
| 46 |
+
|
| 47 |
+
btn.click(generate_ocr, inputs=[image_in, input_text,gender], outputs=[video_out])
|
| 48 |
+
# block.queue()
|
| 49 |
+
block.launch(server_name="0.0.0.0", server_port=7860)
|
| 50 |
+
|
| 51 |
+
if __name__ == "__main__":
|
| 52 |
+
run()
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
# image = gr.Image(show_label=True, type="filepath",label="Input Image")
|
| 56 |
+
# input_text=gr.Textbox(lines=3, value="Hello How are you?", label="Input Text")
|
| 57 |
+
# gender = gr.Radio(["Female","Male"],value="Female",label="Gender")
|
| 58 |
+
# output = gr.Video(show_label=True,label="Output")
|
| 59 |
+
|
| 60 |
+
# demo = gr.Interface(generate_ocr,[image,input_text,gender],[output],title="One Shot Talking Face from Text",)
|
| 61 |
+
# demo.launch(server_name="0.0.0.0", server_port=7860)
|
| 62 |
|