jiang commited on
Commit
6bd1b64
1 Parent(s): cbe5e70
Files changed (1) hide show
  1. demo.py +8 -8
demo.py CHANGED
@@ -265,14 +265,14 @@ def visual_grounding(image, text):
265
  attn_masks = []
266
  while i < max_len and unfinish_flag.any():
267
  # print(i)
268
- prev_output_tokens_11_tensor = torch.tensor(np.array(prev_output_token_11)).to(img.device).long()
269
- prev_output_tokens_12_tensor = torch.tensor(np.array(prev_output_token_12)).to(img.device).long()
270
- prev_output_tokens_21_tensor = torch.tensor(np.array(prev_output_token_21)).to(img.device).long()
271
- prev_output_tokens_22_tensor = torch.tensor(np.array(prev_output_token_22)).to(img.device).long()
272
- delta_x1_tensor = torch.tensor(np.array(delta_x1)).to(img.device)
273
- delta_x2_tensor = torch.tensor(np.array(delta_x2)).to(img.device)
274
- delta_y1_tensor = torch.tensor(np.array(delta_y1)).to(img.device)
275
- delta_y2_tensor = torch.tensor(np.array(delta_y2)).to(img.device)
276
 
277
  net_output = model.decoder(
278
  prev_output_tokens_11_tensor,
 
265
  attn_masks = []
266
  while i < max_len and unfinish_flag.any():
267
  # print(i)
268
+ prev_output_tokens_11_tensor = torch.tensor(np.array(prev_output_token_11)).long()
269
+ prev_output_tokens_12_tensor = torch.tensor(np.array(prev_output_token_12)).long()
270
+ prev_output_tokens_21_tensor = torch.tensor(np.array(prev_output_token_21)).long()
271
+ prev_output_tokens_22_tensor = torch.tensor(np.array(prev_output_token_22)).long()
272
+ delta_x1_tensor = torch.tensor(np.array(delta_x1)).float()
273
+ delta_x2_tensor = torch.tensor(np.array(delta_x2)).float()
274
+ delta_y1_tensor = torch.tensor(np.array(delta_y1)).float()
275
+ delta_y2_tensor = torch.tensor(np.array(delta_y2)).float()
276
 
277
  net_output = model.decoder(
278
  prev_output_tokens_11_tensor,