Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -210,7 +210,8 @@ def draw_plot(pred_img, seg):
|
|
| 210 |
return fig
|
| 211 |
|
| 212 |
def sepia(input_img):
|
| 213 |
-
img = cv2.imread(input_img)
|
|
|
|
| 214 |
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
| 215 |
img_batch = np.expand_dims(img, axis=0)
|
| 216 |
img_batch = np.transpose(img_batch, (0, 3, 1, 2))
|
|
@@ -239,7 +240,7 @@ def sepia(input_img):
|
|
| 239 |
return fig
|
| 240 |
|
| 241 |
demo = gr.Interface(sepia,
|
| 242 |
-
gr.inputs.Image(type="filepath"
|
| 243 |
outputs=['plot'],
|
| 244 |
examples=["ADE_val_00000001.jpeg"],
|
| 245 |
allow_flagging='never')
|
|
|
|
| 210 |
return fig
|
| 211 |
|
| 212 |
def sepia(input_img):
|
| 213 |
+
img = cv2.imread(input_img)
|
| 214 |
+
img = cv2.resize(img, (640, 640)).astype(np.float32)
|
| 215 |
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
| 216 |
img_batch = np.expand_dims(img, axis=0)
|
| 217 |
img_batch = np.transpose(img_batch, (0, 3, 1, 2))
|
|
|
|
| 240 |
return fig
|
| 241 |
|
| 242 |
demo = gr.Interface(sepia,
|
| 243 |
+
gr.inputs.Image(type="filepath"),
|
| 244 |
outputs=['plot'],
|
| 245 |
examples=["ADE_val_00000001.jpeg"],
|
| 246 |
allow_flagging='never')
|