Spaces:
Runtime error
Runtime error
JeffLiang
commited on
Commit
·
adca407
1
Parent(s):
0e5e403
bug fix
Browse files
open_vocab_seg/utils/predictor.py
CHANGED
@@ -190,8 +190,8 @@ class SAMVisualizationDemo(object):
|
|
190 |
text = open_clip.tokenize(txts)
|
191 |
|
192 |
with torch.no_grad(), torch.cuda.amp.autocast():
|
193 |
-
image_features = self.clip_model.encode_image(imgs.half())
|
194 |
-
text_features = self.clip_model.encode_text(text.half())
|
195 |
image_features /= image_features.norm(dim=-1, keepdim=True)
|
196 |
text_features /= text_features.norm(dim=-1, keepdim=True)
|
197 |
|
|
|
190 |
text = open_clip.tokenize(txts)
|
191 |
|
192 |
with torch.no_grad(), torch.cuda.amp.autocast():
|
193 |
+
image_features = self.clip_model.encode_image(imgs.cuda().half())
|
194 |
+
text_features = self.clip_model.encode_text(text.cuda().half())
|
195 |
image_features /= image_features.norm(dim=-1, keepdim=True)
|
196 |
text_features /= text_features.norm(dim=-1, keepdim=True)
|
197 |
|