Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
|
|
|
|
|
|
| 3 |
import numpy as np
|
| 4 |
import cv2
|
| 5 |
from matplotlib import gridspec
|
|
@@ -170,6 +172,8 @@ colormap = np.asarray(ade_palette())
|
|
| 170 |
model_path = wget.download(url)
|
| 171 |
sess = ort.InferenceSession(model_path)
|
| 172 |
|
|
|
|
|
|
|
| 173 |
with open(r'labels.txt', 'r') as fp:
|
| 174 |
for line in fp:
|
| 175 |
labels_list.append(line[:-1])
|
|
@@ -237,6 +241,7 @@ def sepia(input_img):
|
|
| 237 |
demo = gr.Interface(sepia,
|
| 238 |
gr.inputs.Image(type="filepath", shape=(640, 640)),
|
| 239 |
outputs=['plot'],
|
|
|
|
| 240 |
allow_flagging='never')
|
| 241 |
|
| 242 |
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
import sys
|
| 4 |
+
import csv
|
| 5 |
import numpy as np
|
| 6 |
import cv2
|
| 7 |
from matplotlib import gridspec
|
|
|
|
| 172 |
model_path = wget.download(url)
|
| 173 |
sess = ort.InferenceSession(model_path)
|
| 174 |
|
| 175 |
+
csv.field_size_limit(sys.maxsize)
|
| 176 |
+
|
| 177 |
with open(r'labels.txt', 'r') as fp:
|
| 178 |
for line in fp:
|
| 179 |
labels_list.append(line[:-1])
|
|
|
|
| 241 |
demo = gr.Interface(sepia,
|
| 242 |
gr.inputs.Image(type="filepath", shape=(640, 640)),
|
| 243 |
outputs=['plot'],
|
| 244 |
+
examples=["ADE_val_00000001.jpeg"],
|
| 245 |
allow_flagging='never')
|
| 246 |
|
| 247 |
demo.launch()
|