Spaces:
Runtime error
Runtime error
Commit
·
9c87c9c
1
Parent(s):
aed8175
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,13 +23,13 @@ headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit
|
|
| 23 |
"Upgrade-Insecure-Requests": "1",}
|
| 24 |
|
| 25 |
def greet():
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
f.write(session.get(url,headers = headers).content)
|
| 30 |
|
| 31 |
with gr.Blocks() as iface:
|
| 32 |
btn = gr.Button("Run")
|
| 33 |
-
|
|
|
|
| 34 |
|
| 35 |
iface.launch()
|
|
|
|
| 23 |
"Upgrade-Insecure-Requests": "1",}
|
| 24 |
|
| 25 |
def greet():
|
| 26 |
+
img = requests.get(url,headers = headers).content
|
| 27 |
+
print(img.decode("ascii"))
|
| 28 |
+
return Image.open(BytesIO(binascii.unhexlify(img)))
|
|
|
|
| 29 |
|
| 30 |
with gr.Blocks() as iface:
|
| 31 |
btn = gr.Button("Run")
|
| 32 |
+
img = gr.Image(type = "PIL")
|
| 33 |
+
btn.click(fn=greet,outputs = [img])
|
| 34 |
|
| 35 |
iface.launch()
|