You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
For certain input image sizes the subject segmentation routine (16.0.0-beta1) returns mask buffer of a different size (a few pixels bigger in both dimensions), other image sizes work fine.
To Reproduce
The following code snippet and below some sample log outputs:
privateval segmenter =SubjectSegmentation.getClient(SubjectSegmenterOptions.Builder()
.enableForegroundConfidenceMask()
.build())
suspendfungetMask(image:InputImage): Bitmap? {
val result = segmenter.process(image).await()
val buffer = result.foregroundConfidenceMask ?:returnnullLog.d(TAG, "Image size: ${image.width}x${image.height}=${image.width * image.height} Mask buffer size: ${buffer.position()}${buffer.remaining()}")
...
}
// Image size: 320x240=76800 Mask buffer size: 0 79704// 79704 = 324 x 246 WHY?!?!?!// Image size: 1280x960=1228800 Mask buffer size: 0 1273654// 1273654 = 1297 x 982 WHY?!?!?!// Image size: 385x512=197120 Mask buffer size: 0 197120// The above log is as expected
Thanks for coming back to me, attached is the image (creating InputImage with rotation of 90 degrees), also attaching the mask buffer that we've gotten from the subject segmenter.
Describe the bug
For certain input image sizes the subject segmentation routine (16.0.0-beta1) returns mask buffer of a different size (a few pixels bigger in both dimensions), other image sizes work fine.
To Reproduce
The following code snippet and below some sample log outputs:
Expected behavior
As the documentation states (https://developers.google.com/ml-kit/vision/subject-segmentation):
the foreground mask and foreground bitmap are the same size as the input image
SDK Info:
play-services-mlkit-subject-segmentation:16.0.0-beta1
Smartphone:
Pixel 8 (Android SDK 35)
The text was updated successfully, but these errors were encountered: