Akbartus commited on
Commit
a2860c0
·
1 Parent(s): 16da7b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -8,7 +8,7 @@ import onnxruntime
8
 
9
  from PIL import Image
10
 
11
- import gradio
12
 
13
  def run_inference(onnx_session, input_size, image):
14
  # リサイズ
@@ -60,7 +60,9 @@ def create_rgba(mode, image):
60
  rgba_image.putalpha(mask)
61
 
62
  return rgba_image
 
 
 
 
63
 
64
- inputs = [gradio.inputs.Radio(["binary", "smooth"]), gradio.inputs.Image()]
65
- outputs = gradio.outputs.Image(type="pil")
66
- gradio.Interface(fn=create_rgba, inputs=inputs, outputs=outputs, api_name="addition").launch()
 
8
 
9
  from PIL import Image
10
 
11
+ import gradio as gr
12
 
13
  def run_inference(onnx_session, input_size, image):
14
  # リサイズ
 
60
  rgba_image.putalpha(mask)
61
 
62
  return rgba_image
63
+ with gr.Blocks() as demo:
64
+ inputs = [gr.inputs.Radio(["binary", "smooth"]), gr.inputs.Image()]
65
+ outputs = gr.outputs.Image(type="pil")
66
+ gr.Interface(fn=create_rgba, inputs=inputs, outputs=outputs, api_name="addition")
67
 
68
+ demo.launch()