vobecant
commited on
Commit
·
004843f
1
Parent(s):
e8b1631
Initial commit.
Browse files
app.py
CHANGED
@@ -149,7 +149,7 @@ def get_transformations(input_img):
|
|
149 |
return transforms.Compose(trans_list)
|
150 |
|
151 |
|
152 |
-
def predict(input_img
|
153 |
input_img_pil = Image.open(input_img)
|
154 |
transform = get_transformations(input_img_pil)
|
155 |
input_img = transform(input_img_pil)
|
@@ -168,15 +168,13 @@ def predict(input_img, cs_mapping):
|
|
168 |
drawing_cs = map2cs(segmentation_remap)
|
169 |
print('CS colors done.')
|
170 |
|
171 |
-
|
172 |
-
|
173 |
-
else:
|
174 |
-
drawing = drawing_pseudo
|
175 |
|
176 |
-
|
177 |
-
|
178 |
|
179 |
-
return
|
180 |
|
181 |
|
182 |
title = "Drive&Segment"
|
|
|
149 |
return transforms.Compose(trans_list)
|
150 |
|
151 |
|
152 |
+
def predict(input_img):
|
153 |
input_img_pil = Image.open(input_img)
|
154 |
transform = get_transformations(input_img_pil)
|
155 |
input_img = transform(input_img_pil)
|
|
|
168 |
drawing_cs = map2cs(segmentation_remap)
|
169 |
print('CS colors done.')
|
170 |
|
171 |
+
drawing_cs = transforms.ToPILImage()(drawing_cs).resize(input_img_pil.size)
|
172 |
+
drawing_blend_cs = blend_images(input_img_pil, drawing_cs)
|
|
|
|
|
173 |
|
174 |
+
drawing_pseudo = transforms.ToPILImage()(drawing_pseudo).resize(input_img_pil.size)
|
175 |
+
drawing_blend_pseudo = blend_images(input_img_pil, drawing_pseudo)
|
176 |
|
177 |
+
return drawing_blend_pseudo, drawing_blend_cs
|
178 |
|
179 |
|
180 |
title = "Drive&Segment"
|