Spaces:
Runtime error
Runtime error
finish
Browse files
app.py
CHANGED
@@ -105,7 +105,7 @@ def sepia(input_img):
|
|
105 |
return fig
|
106 |
|
107 |
|
108 |
-
def
|
109 |
input_img = Image.fromarray(input_img)
|
110 |
|
111 |
inputs = feature_extractor(images=input_img, return_tensors="tf")
|
@@ -127,12 +127,12 @@ def compare_images(input_img):
|
|
127 |
pred_img = np.array(input_img) * 0.5 + color_seg * 0.5
|
128 |
pred_img = pred_img.astype(np.uint8)
|
129 |
|
130 |
-
return input_img, pred_img
|
131 |
|
132 |
|
133 |
-
demo = gr.Interface(fn=
|
134 |
inputs=gr.Image(shape=(1024, 1024)),
|
135 |
-
outputs=["image", "image"],
|
136 |
examples=["city-1.jpg", "city-2.jpg", "city-3.jpg", "city-4.jpg", "city-5.jpg"],
|
137 |
allow_flagging='never')
|
138 |
|
|
|
105 |
return fig
|
106 |
|
107 |
|
108 |
+
def with_labels(input_img):
|
109 |
input_img = Image.fromarray(input_img)
|
110 |
|
111 |
inputs = feature_extractor(images=input_img, return_tensors="tf")
|
|
|
127 |
pred_img = np.array(input_img) * 0.5 + color_seg * 0.5
|
128 |
pred_img = pred_img.astype(np.uint8)
|
129 |
|
130 |
+
return input_img, pred_img, labels_list
|
131 |
|
132 |
|
133 |
+
demo = gr.Interface(fn=with_labels,
|
134 |
inputs=gr.Image(shape=(1024, 1024)),
|
135 |
+
outputs=["image", "image", "text"],
|
136 |
examples=["city-1.jpg", "city-2.jpg", "city-3.jpg", "city-4.jpg", "city-5.jpg"],
|
137 |
allow_flagging='never')
|
138 |
|