Closed happybear1015 closed 1 year ago
Are you referring to this feature (auto segmentation, Issue #3 )?
cv::Mat maskAuto = sam.autoSegment({10, 10}); // input: number of points each side
Calling function like this can obtain an image where different pixel values belong to different objects.
thanks for your reply before. I tried it.
But,how to get and save each subject's mask picture,rather than show all masks in original picture. And it's too slow to infer a picture,maybe mobile Sam would be a good choice.
Could you please help me, thanks!
The output image of autoSegment has a data type of CV_64FC1, but the actual type information is stored using integers. So you can separate the output image into different layers based on the pixel values.
MobileSAM is indeed much faster and can be directly used in this project by loading its model using Sam::Parameter param("mobile_sam_preprocess.onnx", "mobile_sam.onnx", std::thread::hardware_concurrency());
Are you referring to this feature (auto segmentation, Issue #3 )?
cv::Mat maskAuto = sam.autoSegment({10, 10}); // input: number of points each side
Calling function like this can obtain an image where different pixel values belong to different objects.