【HMS Core】机器学习服务热门问题合集

发布时间 2023-10-31 17:40:03作者: Mayism123
 【关键词】

机器学习服务、文本识别、身份证识别

 

【问题描述1】

机器学习服务的文本识别能力,是否支持草书等?

【解决方案】

草书是不支持的,目前建议使用较为规范的字体测试。

 

【问题描述2】

机器学习服务是否支持训练模型?

【解决方案】

目前不支持该能力。

 

【问题描述3】

身份证识别服务,返回bitmap被压缩

cke_1088.png

【解决方案】

身份证识别返回图片固定分辨率为:640*640

处理建议:通过下列代码对图片缩放可将图片纠正:目测传参长600宽360效果较好,具体可自行调整。

public Bitmap setImgSize(Bitmap bm, int newWidth ,int newHeight){

// 获得图片宽高.

int width = bm.getWidth();

int height = bm.getHeight();

// 计算缩放比例.

float scaleWidth = ((float) newWidth) / width;

float scaleHeight = ((float) newHeight) / height;

// 取得想要缩放的matrix参数.

Matrix matrix = new Matrix();

matrix.postScale(scaleWidth, scaleHeight);

// 得到新的图片.

Bitmap newbm = Bitmap.createBitmap(bm, 0, 0, width, height, matrix, true);

return newbm;

}