EUNSEO56 commited on
Commit
1165da4
·
1 Parent(s): 782fe69

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -18
app.py CHANGED
@@ -117,26 +117,14 @@ def sepia(input_img):
117
 
118
  fig = draw_plot(pred_img, seg)
119
 
120
- tf.keras.backend.clear_session()
121
 
122
  return fig
123
 
124
-
125
- class TensorFlowImageInput(gr.Component):
126
- def __init__(self, shape=(400, 600)):
127
- super().__init__()
128
- self.image = None
129
- self.shape = shape
130
-
131
- def render(self):
132
- return gr.File(label="이미지", accept=".jpg,.png", capture_file=True)
133
-
134
- def update(self, value):
135
- self.image = tf.image.decode_jpeg(value)
136
-
137
- def get_value(self):
138
- return self.image
139
 
140
- demo = gr.Interface(fn=sepia, inputs=[TensorFlowImageInput(shape=(400, 600))], outputs=["plot"])
141
- demo.launch()
142
 
 
 
117
 
118
  fig = draw_plot(pred_img, seg)
119
 
 
120
 
121
  return fig
122
 
123
+ demo = gr.Interface(fn=sepia,
124
+ inputs=gr.Image(shape=(400, 600)),
125
+ outputs=['plot'],
126
+ examples=["side-1.jpg", "side-2.jpg", "side-3.jpg", "side-4.jpg"],
127
+ allow_flagging='never')
 
 
 
 
 
 
 
 
 
 
128
 
 
 
129
 
130
+ demo.launch()