File size: 889 Bytes
97ed3c1
 
 
92f0123
97ed3c1
 
92f0123
69dc66b
97ed3c1
3ef5f9b
97ed3c1
 
 
 
047725b
97ed3c1
 
 
 
 
 
 
69dc66b
97ed3c1
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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)