qingshan777 commited on
Commit
6d665cb
·
verified ·
1 Parent(s): 0d8ab84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -68,7 +68,7 @@ def Get_Densefeature(image, candidate_labels):
68
 
69
  with torch.no_grad():
70
  dense_image_feature = model.get_image_dense_features(image_input)
71
- captions = candidate_labels
72
  caption_input = torch.tensor(tokenizer(captions, max_length=77, padding="max_length", truncation=True).input_ids, dtype=torch.long, device=device)
73
  text_feature = model.get_text_features(caption_input,walk_short_pos=True)
74
  text_feature = text_feature / text_feature.norm(p=2, dim=-1, keepdim=True)
 
68
 
69
  with torch.no_grad():
70
  dense_image_feature = model.get_image_dense_features(image_input)
71
+ captions = [candidate_labels[0]]
72
  caption_input = torch.tensor(tokenizer(captions, max_length=77, padding="max_length", truncation=True).input_ids, dtype=torch.long, device=device)
73
  text_feature = model.get_text_features(caption_input,walk_short_pos=True)
74
  text_feature = text_feature / text_feature.norm(p=2, dim=-1, keepdim=True)