flamehaze1115 commited on
Commit
95f93f3
·
verified ·
1 Parent(s): a725b60

Update gradio_app.py

Browse files
Files changed (1) hide show
  1. gradio_app.py +2 -1
gradio_app.py CHANGED
@@ -62,7 +62,8 @@ def sam_init():
62
  return model, processor
63
 
64
  def sam_segment(sam_model, sam_processor, input_image, *bbox_coords):
65
- bbox = [bbox_coords]
 
66
  image = np.asarray(input_image)
67
 
68
  start_time = time.time()
 
62
  return model, processor
63
 
64
  def sam_segment(sam_model, sam_processor, input_image, *bbox_coords):
65
+ bbox = torch.tensor(bbox_coords, dtype=torch.float32)
66
+ bbox = box_tensor = box_tensor.unsqueeze(0).unsqueeze(0) # (1, 1, 4)
67
  image = np.asarray(input_image)
68
 
69
  start_time = time.time()