Spaces:
Runtime error
Runtime error
| import requests | |
| import gradio as gr | |
| #import torch | |
| #def down2(url='http://images.cocodataset.org/val2017/000000039769.jpg'): | |
| # torch.hub.download_url_to_file(url, 'cats.jpg') | |
| def down(url): | |
| r = requests.get(url, stream = True) | |
| with open("d.jpg", "wb") as Pypdf: | |
| for chunk in r.iter_content(chunk_size = 1024): # 1024 bytes | |
| if chunk: | |
| Pypdf.write(chunk) | |
| down('http://images.cocodataset.org/val2017/000000039769.jpg') | |
| title = "Demo: T" | |
| description = "Deas semantic segmentation and depth estimation." | |
| examples =[["d.zip"]] | |
| iface = gr.Interface(fn=down, | |
| inputs=gr.File(type="file"), | |
| outputs=gr.File(type="file"), | |
| title=title, | |
| description=description, | |
| examples=examples, | |
| enable_queue=True) | |
| iface.launch(debug=True) | |