Skip to content

Commit

Permalink
增加清除人脸库方法
Browse files Browse the repository at this point in the history
  • Loading branch information
xikuqi committed Apr 26, 2019
1 parent 5ddb400 commit 6a3deb0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/com/cnsugar/ai/face/FaceHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,13 @@ public static void removeRegister(String... keys) {
FaceDao.deleteFaceImg(keys);//删除数据库的人脸
SeetafaceBuilder.buildIndex();//重新建立索引
}

/**
* 清除人脸库数据
*/
public static void clear() {
FaceDao.clearImg();
FaceDao.clearIndex();
seeta.clear();
}
}
10 changes: 10 additions & 0 deletions src/main/java/com/cnsugar/ai/face/dao/FaceDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,14 @@ public static boolean deleteFaceImg(String... keys) {
}
return false;
}

public static boolean clearImg() {
try {
SqliteUtils.executeUpdate("DELETE FROM face_img");
return true;
} catch (SQLException e) {
e.printStackTrace();
}
return false;
}
}

0 comments on commit 6a3deb0

Please sign in to comment.