I was successful in loading the model with your guidance but using this
def image_segmentation(path):
  image = Image.open(path)
  trans_image = trans(image)
  model.eval()
  dim_added_image = trans_image.unsqueeze(0)
  segment = model(dim_added_image)
  segmented_image_tensor = segment.argmax(1).float()
  segmented_image = trans_2_img(segmented_image_tensor)
  return segmented_image

as well I am not able to segment the image that I feed to it.