sleepyml commited on
Commit
e8fadb7
·
1 Parent(s): 7ef6899

still need to figure out how to to url or drag and drop

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -29,8 +29,8 @@ unnormalize = transforms.Compose([
29
 
30
 
31
  # inference script for huggingface space (assumes model is already loaded)
32
- def inference(url=None, pil_img=None):
33
- assert url is not None and pil_img is not None
34
  if url:
35
  response = requests.get(url)
36
  original_img = Image.open(BytesIO(response.content))
@@ -76,7 +76,8 @@ model = model.eval()
76
  # gradio interface : i think it can take either a url or a drag and drop by setting one or the other to None
77
  iface = gr.Interface(
78
  fn=inference,
79
- inputs=["text", gr.Image(type='pil')],
 
80
  outputs=['image', 'image', 'image'],
81
  title='Paste a URL or drag an drop an image (but not both) :)'
82
  )
 
29
 
30
 
31
  # inference script for huggingface space (assumes model is already loaded)
32
+ def inference(url=None):
33
+ # assert url is not None and pil_img is not None
34
  if url:
35
  response = requests.get(url)
36
  original_img = Image.open(BytesIO(response.content))
 
76
  # gradio interface : i think it can take either a url or a drag and drop by setting one or the other to None
77
  iface = gr.Interface(
78
  fn=inference,
79
+ # inputs=["text", gr.Image(type='pil')],
80
+ inputs='text',
81
  outputs=['image', 'image', 'image'],
82
  title='Paste a URL or drag an drop an image (but not both) :)'
83
  )