pragnakalp commited on
Commit
ef7cfb3
Β·
1 Parent(s): 20200de

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -20
app.py CHANGED
@@ -201,27 +201,37 @@ def one_shot(image,input_text,gender):
201
 
202
  def generate_ocr(method,image):
203
  return "Hello"
204
- """
205
- Create user interface for OCR demo
206
- """
207
-
208
- image = gr.Image(shape=(300, 300))
209
- method = gr.Radio(["PaddleOCR","EasyOCR", "KerasOCR"],value="PaddleOCR")
210
- output = gr.Textbox(label="Output")
211
-
212
- demo = gr.Interface(
213
- generate_ocr,
214
- [method,image],
215
- output,
216
- title="Optical Character Recognition",
217
- css=".gradio-container {background-color: lightgray} #radio_div {background-color: #FFD8B4; font-size: 40px;}",
218
- article = """<p style='text-align: center;'>Feel free to give us your thoughts on this demo and please contact us at
219
- <a href="mailto:[email protected]" target="_blank">[email protected]</a>
220
- <p style='text-align: center;'>Developed by: <a href="https://www.pragnakalp.com" target="_blank">Pragnakalp Techlabs</a></p>"""
221
 
222
-
223
- )
224
- demo.launch(enable_queue = False)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
 
226
 
227
  # image = gr.Image(show_label=True, type="filepath",label="Input Image")
 
201
 
202
  def generate_ocr(method,image):
203
  return "Hello"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
 
205
+ def run():
206
+ with block:
207
+ gr.Markdown(
208
+ """
209
+ <style> body { text-align: right} </style>
210
+ map: πŸ“„ [arxiv](https://arxiv.org/abs/2112.02749) &nbsp; ⇨ πŸ‘©β€πŸ’» [github](https://github.com/FuxiVirtualHuman/AAAI22-one-shot-talking-face) &nbsp; ⇨ πŸ¦’ [colab](https://github.com/camenduru/one-shot-talking-face-colab) &nbsp; ⇨ πŸ€— [huggingface](https://huggingface.co/spaces/camenduru/one-shot-talking-face) &nbsp; | &nbsp; tools: πŸŒ€ [duplicate this space](https://huggingface.co/spaces/camenduru/sandbox?duplicate=true) &nbsp; | 🐒 [tortoise tts](https://huggingface.co/spaces/mdnestor/tortoise) &nbsp; | πŸ“Ί [video upscaler](https://huggingface.co/spaces/kadirnar/Anime4k) &nbsp; | 🎨 [text-to-image](https://huggingface.co/models?pipeline_tag=text-to-image&sort=downloads) &nbsp; | 🐣 [twitter](https://twitter.com/camenduru) &nbsp; | β˜• [buy-a-coffee](https://ko-fi.com/camenduru) &nbsp;
211
+ """)
212
+ with gr.Group():
213
+ with gr.Box():
214
+ with gr.Row().style(equal_height=True):
215
+ image_in = gr.Image(show_label=False, type="filepath")
216
+ audio_in = gr.Audio(show_label=False, type='filepath')
217
+ video_out = gr.Video(show_label=False)
218
+ with gr.Row().style(equal_height=True):
219
+ btn = gr.Button("Generate")
220
+
221
+ # examples = gr.Examples(examples=[
222
+ # ["./examples/monalisa.jpg", "./examples/obama2.wav"],
223
+ # ["./examples/monalisa.jpg", "./examples/trump.wav"],
224
+ # ["./examples/o2.jpg", "./examples/obama2.wav"],
225
+ # ["./examples/o2.jpg", "./examples/trump.wav" ],
226
+ # ["./examples/image.png", "./examples/audio.wav"],
227
+ # ], fn=calculate, inputs=[image_in, audio_in], outputs=[video_out], cache_examples=True)
228
+
229
+ btn.click(generate_ocr, inputs=[image_in, audio_in], outputs=[video_out])
230
+ block.queue()
231
+ block.launch(server_name="0.0.0.0", server_port=7860)
232
+
233
+ if __name__ == "__main__":
234
+ run()
235
 
236
 
237
  # image = gr.Image(show_label=True, type="filepath",label="Input Image")