Update app.py
Browse files
app.py
CHANGED
|
@@ -163,7 +163,7 @@ def image_mod(image):
|
|
| 163 |
return(output1)
|
| 164 |
#return image.rotate(45)
|
| 165 |
|
| 166 |
-
|
| 167 |
demo = gr.Interface(
|
| 168 |
image_mod,
|
| 169 |
|
|
@@ -178,6 +178,7 @@ demo = gr.Interface(
|
|
| 178 |
],
|
| 179 |
|
| 180 |
)
|
|
|
|
| 181 |
#demo.load(update_state_info, inputs=state_info, outputs=state_info, every=0.5, show_progress=False)
|
| 182 |
|
| 183 |
|
|
@@ -206,6 +207,25 @@ def is_google_colab():
|
|
| 206 |
|
| 207 |
is_colab=is_google_colab()
|
| 208 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
def emb():
|
| 210 |
with gr.Blocks(css="cake.css") as myface:
|
| 211 |
gr.HTML("""<head><meta http-equiv="refresh" content="180"></head>""")
|
|
@@ -239,3 +259,4 @@ def emb():
|
|
| 239 |
#(inline=True,show_api=False)
|
| 240 |
##############################################
|
| 241 |
emb()
|
|
|
|
|
|
| 163 |
return(output1)
|
| 164 |
#return image.rotate(45)
|
| 165 |
|
| 166 |
+
"""
|
| 167 |
demo = gr.Interface(
|
| 168 |
image_mod,
|
| 169 |
|
|
|
|
| 178 |
],
|
| 179 |
|
| 180 |
)
|
| 181 |
+
"""
|
| 182 |
#demo.load(update_state_info, inputs=state_info, outputs=state_info, every=0.5, show_progress=False)
|
| 183 |
|
| 184 |
|
|
|
|
| 207 |
|
| 208 |
is_colab=is_google_colab()
|
| 209 |
|
| 210 |
+
|
| 211 |
+
def sesh_start():
|
| 212 |
+
img = Image.open("nsfw.PNG")
|
| 213 |
+
img2=image_mod(img)
|
| 214 |
+
return img2
|
| 215 |
+
with gr.Blocks() as demo:
|
| 216 |
+
with gr.Row():
|
| 217 |
+
with gr.Column():
|
| 218 |
+
english = gr.Textbox(label="English text")
|
| 219 |
+
translate_btn = gr.Button(value="Translate")
|
| 220 |
+
with gr.Column():
|
| 221 |
+
german = gr.Textbox(label="German Text")
|
| 222 |
+
|
| 223 |
+
translate_btn.click(sesh_start,gr.Image(type="pil"),"image")
|
| 224 |
+
|
| 225 |
+
|
| 226 |
+
demo.launch(debug=is_colab, share=is_colab)
|
| 227 |
+
|
| 228 |
+
"""
|
| 229 |
def emb():
|
| 230 |
with gr.Blocks(css="cake.css") as myface:
|
| 231 |
gr.HTML("""<head><meta http-equiv="refresh" content="180"></head>""")
|
|
|
|
| 259 |
#(inline=True,show_api=False)
|
| 260 |
##############################################
|
| 261 |
emb()
|
| 262 |
+
"""
|