Sakil commited on
Commit
b7393ba
1 Parent(s): 1a20fe2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -30
app.py CHANGED
@@ -1,37 +1,17 @@
1
  import os
2
- os.system('pip install gradio==2.8.0b22')
3
  import gradio as gr
4
-
5
- #fastspeech = gr.Interface.load("huggingface/facebook/fastspeech2-en-ljspeech")
6
  clip = gr.Interface.load("spaces/DrishtiSharma/Text-to-Image-search-using-CLIP")
7
-
8
-
9
- #def text2speech(text):
10
- # return fastspeech(text)
11
-
12
-
13
  def text2image(text):
14
  image = clip(text)[0]
15
  return gr.processing_utils.decode_base64_to_image(image)
16
 
17
-
18
- block = gr.Blocks()
19
-
20
-
21
-
22
- with block:
23
- text = gr.inputs.Textbox(placeholder="Enter the words you want to generate image for::::::")
24
-
25
- with gr.Column():
26
- with gr.Row():
27
- #get_audio = gr.Button("generate audio")
28
- get_image = gr.Button("generate image")
29
- with gr.Row():
30
- #speech = gr.outputs.Audio()
31
- image = gr.outputs.Image()
32
-
33
-
34
- #get_audio.click(text2speech, inputs=text, outputs=speech)
35
- get_image.click(text2image, inputs=text, outputs=image)
36
-
37
- block.launch()
 
1
  import os
2
+ # os.system('pip install gradio==2.8.0b22')
3
  import gradio as gr
 
 
4
  clip = gr.Interface.load("spaces/DrishtiSharma/Text-to-Image-search-using-CLIP")
 
 
 
 
 
 
5
  def text2image(text):
6
  image = clip(text)[0]
7
  return gr.processing_utils.decode_base64_to_image(image)
8
 
9
+ iface = gr.Interface(
10
+ text2image,inputs=gr.inputs.Textbox(lines=2, placeholder="Enter your text here"),
11
+ outputs="image",
12
+ examples=[["cat"],["Lion"],["Nature"],["water"],["house"]],
13
+ theme="seafoam",
14
+ #css="https://www.w3schools.com/cssref/playit.asp?filename=playcss_background-color",
15
+ title='Image Generator',
16
+ description="This application supports in the creation of images from your text.")
17
+ iface.launch(inline=False)