zhangtao-whu commited on
Commit
6684864
·
verified ·
1 Parent(s): 980eab6

Upload /app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -185,7 +185,6 @@ def get_visual_prompts_embeddings(
185
  boxes_prompts[:, [0, 2]] = boxes_prompts[:, [0, 2]] / max(height, width) * 1024
186
  boxes_prompts[:, [1, 3]] = boxes_prompts[:, [1, 3]] / max(height, width) * 1024
187
  boxes_prompts = torch.from_numpy(boxes_prompts)
188
- boxes_prompts = torch.from_numpy(boxes_prompts)
189
  boxes_prompts = boxes_prompts.cuda()
190
  # using <region> token
191
  region_token_id = omg_llava.region_token_idx
@@ -193,7 +192,7 @@ def get_visual_prompts_embeddings(
193
  boxes_mark_embedding = get_points_embeddings(
194
  boxes_prompts, input_ids,
195
  1024, 1024,
196
- region_token_id)
197
  return points_mark_embedding, boxes_mark_embedding
198
 
199
  def inference(input_str, all_inputs, follow_up):
 
185
  boxes_prompts[:, [0, 2]] = boxes_prompts[:, [0, 2]] / max(height, width) * 1024
186
  boxes_prompts[:, [1, 3]] = boxes_prompts[:, [1, 3]] / max(height, width) * 1024
187
  boxes_prompts = torch.from_numpy(boxes_prompts)
 
188
  boxes_prompts = boxes_prompts.cuda()
189
  # using <region> token
190
  region_token_id = omg_llava.region_token_idx
 
192
  boxes_mark_embedding = get_points_embeddings(
193
  boxes_prompts, input_ids,
194
  1024, 1024,
195
+ region_token_id, mode='point')
196
  return points_mark_embedding, boxes_mark_embedding
197
 
198
  def inference(input_str, all_inputs, follow_up):