Closed sctrueew closed 5 days ago
Thanks for writing the issue.
We added getMaskBatch() so that you can input multiple boxes and obtain the mask result.
cv::Rect rect1 = cv::Rect(1215 * inputSize.width / imageSize.width,
125 * inputSize.height / imageSize.height,
508 * inputSize.width / imageSize.width,
436 * inputSize.height / imageSize.height);
cv::Rect rect2 = cv::Rect(890 * inputSize.width / imageSize.width,
85 * inputSize.height / imageSize.height,
315 * inputSize.width / imageSize.width,
460 * inputSize.height / imageSize.height);
rects.push_back(rect1);
rects.push_back(rect2);
sam.setRectsLabels(rects, &inputPointValues, &inputLabelValues);
int batchNum = (int)rects.size();
mask = sam.getMaskBatch(inputPointValues, inputLabelValues, batchNum, imageSize);
cv::imwrite("mask_box_batch.png", mask);
inputPointValues.resize(0);
inputLabelValues.resize(0);
rects.resize(0);
Hi, thank you for the response.
Hi, thank you for your support. When I use multiple boxes, I get unexpected results. However, when using a single box, everything works fine. Could you please help me identify and resolve this issue?
multi boxes:
a box: