wondervictor commited on
Commit
b82061c
·
verified ·
1 Parent(s): c76ca4e

Update mask_adapter/sam_maskadapter.py

Browse files
Files changed (1) hide show
  1. mask_adapter/sam_maskadapter.py +2 -2
mask_adapter/sam_maskadapter.py CHANGED
@@ -188,7 +188,7 @@ class SAMVisualizationDemo(object):
188
  select_mask.extend(locs[0].tolist())
189
  for idx in select_mask:
190
  select_cls[idx] = class_preds[idx]
191
- semseg = torch.einsum("qc,qhw->chw", select_cls.float(), pred_masks.tensor.float().cuda())
192
 
193
  r = semseg
194
  blank_area = (r[0] == 0)
@@ -239,7 +239,7 @@ class SAMPointVisualizationDemo(object):
239
  lvis_classes = [x[x.find(':')+1:] for x in lvis_classes]
240
 
241
  self.class_names = thing_classes + stuff_classes + lvis_classes
242
- self.text_embedding = torch.from_numpy(np.load("./text_embedding/lvis_coco_text_embedding.npy")).to("cuda")
243
 
244
  self.class_names = self._load_class_names()
245
 
 
188
  select_mask.extend(locs[0].tolist())
189
  for idx in select_mask:
190
  select_cls[idx] = class_preds[idx]
191
+ semseg = torch.einsum("qc,qhw->chw", select_cls.float(), pred_masks.tensor.float().cpu())
192
 
193
  r = semseg
194
  blank_area = (r[0] == 0)
 
239
  lvis_classes = [x[x.find(':')+1:] for x in lvis_classes]
240
 
241
  self.class_names = thing_classes + stuff_classes + lvis_classes
242
+ self.text_embedding = torch.from_numpy(np.load("./text_embedding/lvis_coco_text_embedding.npy")).to("cpu")
243
 
244
  self.class_names = self._load_class_names()
245