yuxin commited on
Commit
4ee7532
1 Parent(s): 2b7366f
Files changed (1) hide show
  1. model_segvol_single.py +4 -1
model_segvol_single.py CHANGED
@@ -69,6 +69,7 @@ class SegVolModel(PreTrainedModel):
69
  if not use_zoom:
70
  return logits_global_single
71
  print(logits_global_single.shape)
 
72
  if point_prompt_map is not None:
73
  binary_points = F.interpolate(
74
  point_prompt_map.float(),
@@ -79,7 +80,9 @@ class SegVolModel(PreTrainedModel):
79
  size=volume_shape, mode='nearest')
80
 
81
  min_d, min_h, min_w, max_d, max_h, max_w = logits2roi_coor(self.config.spatial_size, logits_global_single[0][0])
82
- assert min_d is None, 'Fail to detect foreground!'
 
 
83
 
84
  # Crop roi
85
  image_single_cropped = image[:, :, min_d:max_d+1, min_h:max_h+1, min_w:max_w+1]
 
69
  if not use_zoom:
70
  return logits_global_single
71
  print(logits_global_single.shape)
72
+ print(torch.unique(logits_global_single))
73
  if point_prompt_map is not None:
74
  binary_points = F.interpolate(
75
  point_prompt_map.float(),
 
80
  size=volume_shape, mode='nearest')
81
 
82
  min_d, min_h, min_w, max_d, max_h, max_w = logits2roi_coor(self.config.spatial_size, logits_global_single[0][0])
83
+ if min_d is None:
84
+ print('Fail to detect foreground!')
85
+ return logits_global_single
86
 
87
  # Crop roi
88
  image_single_cropped = image[:, :, min_d:max_d+1, min_h:max_h+1, min_w:max_w+1]