HMS-MLKit / HUAWEI-HMS-MLKit-Sample

HUAWEI HMS meachine learning services demo apk download.
https://developer.huawei.com/consumer/en/doc/development/HMS-Examples/ml-samplecode-4
Apache License 2.0
69 stars 36 forks source link

人像分割的问题 #44

Open luodongwen opened 4 years ago

luodongwen commented 4 years ago

在示例代码中,你们使用了自定义View的方式来显示分割的图像,我在换成OpenGl ES的时候,发现你们返回的标志mark数据不能直接使用,能具体说明一下mark的标志的大小和标记吗

HMS-MLKit commented 4 years ago

1.0.3.300版本的图像分割,分割结果中包含masks数组,用于标记被检测图片的分类信息,返回的masks数组尺寸为输入SDK检测的图像的宽高乘积。mask数组中标记了每个像素具体属于哪个分类,对应关系可参考:https://developer.huawei.com/consumer/cn/doc/development/HMS-References/MLImageSegmentationClassification-4, 您需要根据标记,按像素截取图片中需要的元素。 我们将在5月17号左右发布1.0.4.300版本,这个版本的图像分割服务在做人像分割时,会返回背景透明的人像图(foreground bitmap),您可以通过图像分割结果类(MLImageSegmentation)中的getForeground()接口获取,直接对获取到的人像图做操作,不必使用masks。