Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
import numpy as np
|
4 |
-
|
5 |
from matplotlib import gridspec
|
6 |
import matplotlib.pyplot as plt
|
7 |
import onnxruntime as ort
|
@@ -206,9 +206,9 @@ def draw_plot(pred_img, seg):
|
|
206 |
return fig
|
207 |
|
208 |
def sepia(input_img):
|
209 |
-
img =
|
|
|
210 |
img_batch = np.expand_dims(img, axis=0)
|
211 |
-
img_batch = img_batch.astype(float)
|
212 |
|
213 |
outputs = sess.run(None, {"pixel_values": img_batch})[0]
|
214 |
logits = outputs.logits
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
import numpy as np
|
4 |
+
import cv2
|
5 |
from matplotlib import gridspec
|
6 |
import matplotlib.pyplot as plt
|
7 |
import onnxruntime as ort
|
|
|
206 |
return fig
|
207 |
|
208 |
def sepia(input_img):
|
209 |
+
img = cv2.imread(input_img)
|
210 |
+
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
211 |
img_batch = np.expand_dims(img, axis=0)
|
|
|
212 |
|
213 |
outputs = sess.run(None, {"pixel_values": img_batch})[0]
|
214 |
logits = outputs.logits
|