new_mask_image = torch.zeros([inst_map.shape[0],inst_map.shape[1],inst_map.shape[2],inst_map.shape[3]], dtype=torch.float32,device=inst_map.device)
for i in range(inst_map.shape[0]):            
            f_mask = inst_map [i,:,:,:]
            zero = torch.zeros_like(f_mask)
            one  = torch.ones_like(f_mask)
            f_mask= torch.where(f_mask> -1.0, one, zero)
            new_mask_image[i,:,:,:] = f_mask

 

相关文章:

  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-15
  • 2022-01-26
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-04-18
  • 2022-12-23
  • 2022-12-23
  • 2022-01-22
  • 2022-12-23
相关资源
相似解决方案