Signed-off-by: sairate <sairate@sina.cn>

This commit is contained in:
sairate 2024-08-25 14:27:07 +08:00
parent fbb6c9fe46
commit d89a2c5c7f
18 changed files with 53 additions and 38 deletions

View File

@ -6,8 +6,20 @@
<component name="ChangeListManager">
<list default="true" id="c512d54a-7f5f-4cfb-af24-29d5821a33bf" name="更改" comment="Signed-off-by: sairate &lt;sairate@sina.cn&gt;">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/face_database.db" beforeDir="false" afterPath="$PROJECT_DIR$/face_database.db" afterDir="false" />
<change beforePath="$PROJECT_DIR$/run_programs.py" beforeDir="false" afterPath="$PROJECT_DIR$/run_programs.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/captured_faces/face_1.jpg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/captured_faces/face_10.jpg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/captured_faces/face_2.jpg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/captured_faces/face_3.jpg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/captured_faces/face_4.jpg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/captured_faces/face_5.jpg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/captured_faces/face_6.jpg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/captured_faces/face_7.jpg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/captured_faces/face_8.jpg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/captured_faces/face_9.jpg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/db_image/test.jpg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/db_image/test3.jpg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/face_database.db" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/match_log.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/scanf_face.py" beforeDir="false" afterPath="$PROJECT_DIR$/scanf_face.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@ -49,30 +61,30 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"ASKED_ADD_EXTERNAL_FILES": "true",
"DefaultHtmlFileTemplate": "HTML File",
"JavaScript 调试.index.html.executor": "Run",
"Python.add_face.executor": "Run",
"Python.app.executor": "Run",
"Python.match_face.executor": "Run",
"Python.run_programs.executor": "Run",
"Python.scanf_face.executor": "Run",
"Python.sqlite.executor": "Run",
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
"git-widget-placeholder": "master",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable",
"vue.rearranger.settings.migration": "true"
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;ASKED_ADD_EXTERNAL_FILES&quot;: &quot;true&quot;,
&quot;DefaultHtmlFileTemplate&quot;: &quot;HTML File&quot;,
&quot;JavaScript 调试.index.html.executor&quot;: &quot;Run&quot;,
&quot;Python.add_face.executor&quot;: &quot;Run&quot;,
&quot;Python.app.executor&quot;: &quot;Run&quot;,
&quot;Python.match_face.executor&quot;: &quot;Run&quot;,
&quot;Python.run_programs.executor&quot;: &quot;Run&quot;,
&quot;Python.scanf_face.executor&quot;: &quot;Run&quot;,
&quot;Python.sqlite.executor&quot;: &quot;Run&quot;,
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;,
&quot;git-widget-placeholder&quot;: &quot;master&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}
}]]></component>
}</component>
<component name="RunManager" selected="Python.run_programs">
<configuration name="index.html" type="JavascriptDebugType" temporary="true" nameIsGenerated="true" uri="http://localhost:63342/face/templates/index.html" useBuiltInWebServerPort="true">
<method v="2" />
@ -213,7 +225,8 @@
<workItem from="1724546711749" duration="3708000" />
<workItem from="1724557160088" duration="579000" />
<workItem from="1724557783554" duration="5379000" />
<workItem from="1724564705666" duration="337000" />
<workItem from="1724564705666" duration="1021000" />
<workItem from="1724566889942" duration="100000" />
</task>
<task id="LOCAL-00001" summary="sairate">
<option name="closed" value="true" />
@ -268,7 +281,7 @@
<option name="LAST_COMMIT_MESSAGE" value="Signed-off-by: sairate &lt;sairate@sina.cn&gt;" />
</component>
<component name="com.intellij.coverage.CoverageDataManagerImpl">
<SUITE FILE_PATH="coverage/face$run_programs.coverage" NAME="run_programs 覆盖结果" MODIFIED="1724564971141" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/face$run_programs.coverage" NAME="run_programs 覆盖结果" MODIFIED="1724566942229" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/face$sqlite.coverage" NAME="sqlite 覆盖结果" MODIFIED="1724310603865" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/face$match_face.coverage" NAME="match_face 覆盖结果" MODIFIED="1724314395402" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/face$app.coverage" NAME="app 覆盖结果" MODIFIED="1724563184328" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />

View File

@ -57,6 +57,16 @@ pip install -r requirements.txt
```
### 2. 启动程序
- 一定要向数据库中添加图片在scanf_face.py中
``` python
# 向数据库中添加人脸
add_face_to_database("李四", "快递", "./db_image/test1.jpg")
add_face_to_database("张三", "居民", "./db_image/test2.jpg")
add_face_to_database("王五", "居民", "./db_image/test3.jpg")
```
使用 `run_programs.py` 脚本同时启动 Flask 应用和人脸捕捉脚本:
```bash
python run_programs.py

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

View File

@ -1,8 +0,0 @@
匹配成功: 屈礼 (居民) 在 ./captured_faces\face_4.jpg 时间: 2024-08-25 12:56:06
屈礼,居民,./captured_faces\face_2.jpg
屈礼,居民,./captured_faces\face_1.jpg
屈礼,居民,./captured_faces\face_1.jpg
岳老师,居民,./captured_faces\face_1.jpg
岳老师,居民,./captured_faces\face_1.jpg
岳老师,居民,./captured_faces\face_1.jpg
屈礼,居民,./captured_faces\face_3.jpg

View File

@ -102,9 +102,9 @@ def log_match(name, identity, image_path, db_name, log_file):
create_face_database()
# 向数据库中添加人脸
add_face_to_database("小霖老师", "居民", "./db_image/test2.jpg")
add_face_to_database("屈礼", "外卖员", "./db_image/test.jpg")
add_face_to_database("岳老师", "居民", "./db_image/test3.jpg")
add_face_to_database("李四", "外卖员", "./db_image/test1.jpg")
add_face_to_database("张三", "居民", "./db_image/test2.jpg")
add_face_to_database("王五", "居民", "./db_image/test3.jpg")
# 主程序循环
while True: