djl234 commited on
Commit
602b01b
1 Parent(s): 2f9fb41

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -87,10 +87,10 @@ def test(gpu_id, net, img_list, group_size, img_size):
87
  group_img[i]=img_transform(Image.fromarray(img_list[i]))
88
  _,pred_mask=net(group_img*1)
89
  pred_mask=(pred_mask.detach().squeeze()*255)#.numpy().astype(np.uint8)
90
- pred_mask=[F.interpolate(pred_mask[i].reshape(1,1,pred_mask[i].shape[-2],pred_mask[i].shape[-1]),size=(wl[i],hl[i]),mode='bilinear').squeeze().numpy().astype(np.uint8) for i in range(5)]
91
  #pred_mask=[crf_refine(((group_img[i]-group_img[i].min())/(group_img[i].max()-group_img[i].min())*255).permute(1,2,0).contiguous().numpy().astype(np.uint8),pred_mask[i]) for i in range(5)]
92
- for i in range(5):
93
- print(img_list[i].shape,pred_mask[i].shape)
94
  pred_mask=[crf_refine(img_list[i],pred_mask[i]) for i in range(5)]
95
  print(pred_mask[0].shape)
96
  result = [((torch.from_numpy(pred_mask[i]).unsqueeze(2).repeat(1,1,3)).numpy()) for i in range(5)]
 
87
  group_img[i]=img_transform(Image.fromarray(img_list[i]))
88
  _,pred_mask=net(group_img*1)
89
  pred_mask=(pred_mask.detach().squeeze()*255)#.numpy().astype(np.uint8)
90
+ pred_mask=[F.interpolate(pred_mask[i].reshape(1,1,pred_mask[i].shape[-2],pred_mask[i].shape[-1]),size=(hl[i],wl[i]),mode='bilinear').squeeze().numpy().astype(np.uint8) for i in range(5)]
91
  #pred_mask=[crf_refine(((group_img[i]-group_img[i].min())/(group_img[i].max()-group_img[i].min())*255).permute(1,2,0).contiguous().numpy().astype(np.uint8),pred_mask[i]) for i in range(5)]
92
+ #for i in range(5):
93
+ # print(img_list[i].shape,pred_mask[i].shape)
94
  pred_mask=[crf_refine(img_list[i],pred_mask[i]) for i in range(5)]
95
  print(pred_mask[0].shape)
96
  result = [((torch.from_numpy(pred_mask[i]).unsqueeze(2).repeat(1,1,3)).numpy()) for i in range(5)]