aestheticsScoreDetector = new AestheticsScoreDetector(MainActivity.this);
AEModelConfiguration aeModelConfiguration = new AEModelConfiguration();
aeModelConfiguration.getSummerizationConf().setSummerizationMaxLen(10);
aestheticsScoreDetector.setAEModelConfiguration(aeModelConfiguration);
Video[] videos = new Video[videoPaths.length];
for (String path: videoPaths) {
Video video = new Video();
video.setPath(path);
videos[position++] = video;
}
JSONObject jsonObject;
jsonObject = aestheticsScoreDetector.getVideoSummerization(videos, null);
AEVideoResult aeVideoResult = aestheticsScoreDetector.convertVideoSummaryResult(jsonObject);
{
"resultCode": 0,
"videoSummerization": "[{\"endFrameTimeStamp\":5060000,
\
"srcVideo\":\"\/storage\/emulated\/0\/DCIM\/Camera\/VID_20180828_190427.mp4\",
\
"startFrameTimeStamp\":0},
{\
"endFrameTimeStamp\":14031000,
\
"srcVideo\":\"\/storage\/emulated\/0\/DCIM\/Camera\/VID_20180828_190427.mp4\",
\
"startFrameTimeStamp\":9091000}]"
}
可以的,在faceCompare()方法中会默认启动引擎,如果引擎已经启动则不会再次启动,开发者可以放心使用。
release()方法会卸载在NPU芯片中已经加载的模型,请在应用不再使用审美引擎时及时卸载模型,释放资源。