Spaces:
Running
on
Zero
Running
on
Zero
Update mask_adapter/sam_maskadapter.py
Browse files
mask_adapter/sam_maskadapter.py
CHANGED
@@ -150,7 +150,7 @@ class SAMVisualizationDemo(object):
|
|
150 |
# text_features = self.clip_model.encode_text(text)
|
151 |
# text_features /= text_features.norm(dim=-1, keepdim=True)
|
152 |
|
153 |
-
features = self.extract_features_convnext(image)
|
154 |
|
155 |
clip_feature = features['clip_vis_dense']
|
156 |
|
@@ -311,7 +311,7 @@ class SAMPointVisualizationDemo(object):
|
|
311 |
# text_features /= text_features.norm(dim=-1, keepdim=True)
|
312 |
#np.save("/home/yongkangli/Mask-Adapter/text_embedding/lvis_coco_text_embedding.npy", text_features.cpu().numpy())
|
313 |
text_features = self.text_embedding
|
314 |
-
features = self.extract_features_convnext(image)
|
315 |
clip_feature = features['clip_vis_dense']
|
316 |
|
317 |
clip_vis_dense = self.visual_prediction_forward_convnext_2d(clip_feature)
|
|
|
150 |
# text_features = self.clip_model.encode_text(text)
|
151 |
# text_features /= text_features.norm(dim=-1, keepdim=True)
|
152 |
|
153 |
+
features = self.extract_features_convnext(image.half())
|
154 |
|
155 |
clip_feature = features['clip_vis_dense']
|
156 |
|
|
|
311 |
# text_features /= text_features.norm(dim=-1, keepdim=True)
|
312 |
#np.save("/home/yongkangli/Mask-Adapter/text_embedding/lvis_coco_text_embedding.npy", text_features.cpu().numpy())
|
313 |
text_features = self.text_embedding
|
314 |
+
features = self.extract_features_convnext(image.half())
|
315 |
clip_feature = features['clip_vis_dense']
|
316 |
|
317 |
clip_vis_dense = self.visual_prediction_forward_convnext_2d(clip_feature)
|