Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,12 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
with gr.Blocks() as demo:
|
4 |
t = gr.Textbox()
|
|
|
1 |
import gradio as gr
|
2 |
+
from PIL import Image
|
3 |
+
|
4 |
+
def fake():
|
5 |
+
image = Image.new("RGB", (512, 512))
|
6 |
+
with tempfile.NamedTemporaryFile(suffix=".jpg", delete=False) as tmpfile:
|
7 |
+
image.save(tmpfile, "JPEG", quality=80, optimize=True, progressive=True)
|
8 |
+
return Path(tmpfile.name)
|
9 |
+
|
10 |
|
11 |
with gr.Blocks() as demo:
|
12 |
t = gr.Textbox()
|