一、五官特征检测
Q1 没有调用接口的prepare()方法可以直接使用faceCompare()方法吗?
A 可以的,在faceCompare()方法中会默认启动引擎,如果引擎已经启动则不会再次启动,开发者可以放心使用。
Q2 release()方法是什么时候调用?
A
release()方法会卸载在NPU芯片中已经加载的模型,请在应用不再使用五官特征检测时及时卸载模型,释放资源。如:
FaceComparator faceComparator = new FaceComparator(getApplicationContext());
for(……) {
JSONObject resultObj = lm. detectLandMark (frame, null);
List landMarks = lm.convertResult(resultObj);
//do something
}
lm.release();
二、图像语义分割
Q1 没有调用接口的prepare()方法可以直接使用doSegmentation()方法吗?
A 可以的,在fdoSegmentation()方法中会默认启动引擎,如果引擎已经启动则不会再次启动,开发者可以放心使用。
Q2 release()方法是什么时候调用?
A
release()方法会卸载在NPU芯片中已经加载的模型,请在应用不再使用图像语义分割时及时卸载模型,释放资源。如:
ImageSegmentation is = new ImageSegmentation(this);
for(……) {
ImageResult sr = is. doSegmentation (frame, null);
Bitmap bmp = sr.getBitmap();
//do something
}
is.release();
三、人像分割
Q1 没有调用接口的prepare()方法可以直接使用faceCompare()方法吗?
A 可以的,在faceCompare()方法中会默认启动引擎,如果引擎已经启动则不会再次启动,开发者可以放心使用。
Q2 release()方法是什么时候调用?
A
release()方法会卸载引擎中已经加载的模型,请在应用不再使用人像分割时及时卸载模型,释放资源。如:
FaceComparator faceComparator = new FaceComparator(getApplicationContext());
for(……) {
JSONObject js frame , null);
FaceCompareResult result = faceComparator.convertResult(jsonObject);
//do something
}
faceComparator.release();
四、美学评分
Q1 没有调用接口的prepare()方法可以直接使用detect()方法吗?
A 可以的,在detect()方法中会默认启动引擎,如果引擎已经启动则不会再次启动,开发者可以放心使用。
Q2 release()方法是什么时候调用?
A
release()方法会卸载在NPU芯片中已经加载的模型,请在应用不再使用审美引擎时及时卸载模型,释放资源。如:
AestheticsScoreDetector aestheticsScoreDetector = new AestheticsScoreDetector(this)
for(……) {
JSONObject js>AestheticsScore aestheticsScores = aestheticsScoreDetector.convertResult(json);
float score = aestheticsScores.getScore();
//do something
}
aestheticsScoreDetector.release();





































苏公安网备 32011402010933号