提交 902a9825 authored 作者: yangqi's avatar yangqi

1

上级 d67919a6
......@@ -22,6 +22,8 @@ public interface FaceService {
*/
void createFaceDb(String dbName) throws Exception;
void createAliFaceDb(String dbName) throws Exception;
/**
* 添加人脸样本
*/
......
......@@ -48,6 +48,12 @@ public class FaceServiceImpl implements FaceService{
sdk.createFaceDb(dbName);
}
@Override
public void createAliFaceDb(String dbName) throws Exception {
Utils.checkParamsNotEmpty(dbName, "dbName");
sdk.createFaceDb(dbName);
}
@Override
public void addFace(String dbName, String entityId, String labels) throws Exception {
Utils.checkParamsNotEmpty(dbName, "dbName");
......
......@@ -84,8 +84,7 @@ public class EquipmentServiceImpl implements EquipmentService {
return "entity_" + entityId;
}
private int getFaceDbId(int apartmentId)
{
private int getFaceDbId(int apartmentId) throws Exception {
CameraApartmentDb camera = apartmentDbMapper.getDb(apartmentId);
if(camera == null){
String dbName = this.getFaceDbName(apartmentId);
......@@ -95,6 +94,7 @@ public class EquipmentServiceImpl implements EquipmentService {
AliFaceDb faceDb = new AliFaceDb();
faceDb.setDbName(dbName);
aliFaceDbMapper.addDb(faceDb);
faceService.createAliFaceDb(dbName);
faceId = faceDb.getAliFaceDbId();
}else{
faceId = face.getAliFaceDbId();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论