Thanks for your work to providing example code to use use multi-box prompt inputs. But it requires to change the onnx model settings every time wants to test another different bounding box number. Is there a flexible way to do like following
if len(bbox_array) > 1:
input_box = torch.tensor(bbox_array, device=predictor.device)
_box = predictor.transform.apply_boxes_torch(input_box, image.shape[:2])
else:
_box = torch.tensor(bbox_array, device=predictor.device)
masks, scores, logits = predictor.predict_torch(
point_coords=input_point,
point_labels=input_label,
boxes=_box,
multimask_output=False,
hq_token_only=hq_token_only,
)
Do not need to change the model settings while can fit for different bounding box numbers.
Thanks for your work to providing example code to use use multi-box prompt inputs. But it requires to change the onnx model settings every time wants to test another different bounding box number. Is there a flexible way to do like following if len(bbox_array) > 1: input_box = torch.tensor(bbox_array, device=predictor.device) _box = predictor.transform.apply_boxes_torch(input_box, image.shape[:2]) else: _box = torch.tensor(bbox_array, device=predictor.device) masks, scores, logits = predictor.predict_torch( point_coords=input_point, point_labels=input_label, boxes=_box, multimask_output=False, hq_token_only=hq_token_only, ) Do not need to change the model settings while can fit for different bounding box numbers.
Thanks.