Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -96,7 +96,8 @@ def test(gpu_id, net, img_list, group_size, img_size):
|
|
| 96 |
# print(img_list[i].shape,pred_mask[i].shape)
|
| 97 |
#pred_mask=[crf_refine(img_list[i],pred_mask[i]) for i in range(5)]
|
| 98 |
print(pred_mask[0].shape)
|
| 99 |
-
|
|
|
|
| 100 |
#w, h = 224,224#Image.open(image_list[i][j]).size
|
| 101 |
#result = result.resize((w, h), Image.BILINEAR)
|
| 102 |
#result.convert('L').save('0.png')
|
|
|
|
| 96 |
# print(img_list[i].shape,pred_mask[i].shape)
|
| 97 |
#pred_mask=[crf_refine(img_list[i],pred_mask[i]) for i in range(5)]
|
| 98 |
print(pred_mask[0].shape)
|
| 99 |
+
white=(torch.ones(2,pred_mask[0].shape[1],3)*255)
|
| 100 |
+
result = [torch.cat([torch.from_numpy(img_resize[i]),white,torch.from_numpy(pred_mask[i]).unsqueeze(2).repeat(1,1,3)],dim=0).numpy() for i in range(5)]
|
| 101 |
#w, h = 224,224#Image.open(image_list[i][j]).size
|
| 102 |
#result = result.resize((w, h), Image.BILINEAR)
|
| 103 |
#result.convert('L').save('0.png')
|