niulx commited on
Commit
8ea9dc3
1 Parent(s): d4bd7a0

Update segment.py

Browse files
Files changed (1) hide show
  1. segment.py +0 -3
segment.py CHANGED
@@ -54,7 +54,6 @@ def draw_panoptic_segmentation(segmentation, segments_info,save_folder=None, nos
54
  mask = segmentation==0
55
  mask = mask.cpu().detach().numpy() # [512,512] bool
56
  print(mask.shape)
57
- mask = cv2.resize(mask,(512,512))
58
  segment_label = "rest"
59
  color = viridis(0)
60
  label = f"{segment_label}-{0}"
@@ -69,7 +68,6 @@ def draw_panoptic_segmentation(segmentation, segments_info,save_folder=None, nos
69
  segment_id -= 1
70
  mask = mask.cpu().detach().numpy() # [512,512] bool
71
  print(mask.shape)
72
- mask = cv2.resize(mask,(512,512))
73
  mask_np_list.append(mask)
74
  segment_label = model.config.id2label[segment['label_id']]
75
  instances_counter[segment['label_id']] += 1
@@ -82,7 +80,6 @@ def draw_panoptic_segmentation(segmentation, segments_info,save_folder=None, nos
82
  else:
83
  mask = np.full(segmentation.shape, True)
84
  print(mask.shape)
85
- mask = cv2.resize(mask,(512,512))
86
 
87
  segment_label = "all"
88
  mask_np_list.append(mask)
 
54
  mask = segmentation==0
55
  mask = mask.cpu().detach().numpy() # [512,512] bool
56
  print(mask.shape)
 
57
  segment_label = "rest"
58
  color = viridis(0)
59
  label = f"{segment_label}-{0}"
 
68
  segment_id -= 1
69
  mask = mask.cpu().detach().numpy() # [512,512] bool
70
  print(mask.shape)
 
71
  mask_np_list.append(mask)
72
  segment_label = model.config.id2label[segment['label_id']]
73
  instances_counter[segment['label_id']] += 1
 
80
  else:
81
  mask = np.full(segmentation.shape, True)
82
  print(mask.shape)
 
83
 
84
  segment_label = "all"
85
  mask_np_list.append(mask)