Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-2-capstone-design2
/
2014104149
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Graduate
2020-11-28 10:37:57 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ba1b367755f609d7e9d7b6ede0e46d914b690763
ba1b3677
1 parent
22c204d1
Update register method
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
10 deletions
flask/app.py
flask/config.cnf
flask/templates/index.html
flask/app.py
View file @
ba1b367
...
...
@@ -65,14 +65,16 @@ def register():
print
(
msg
)
sql
=
"SELECT student_id FROM student WHERE student_id =
%
s;"
cursor
.
execute
(
sql
,
(
student_id
))
if
cursor
.
rowcount
==
0
:
sql
=
"INSERT INTO student(student_id, student_name) VALUES (
%
s,
%
s)"
cursor
.
execute
(
sql
,
(
student_id
,
student_name
))
sql
=
"INSERT INTO lecture_students(lecture_id, student_id) VALUES (
%
s,
%
s)"
# temp: student in lecture 0
cursor
.
execute
(
sql
,
(
'0'
,
student_id
))
msg
=
'[{id}] is registered'
.
format
(
id
=
student_id
)
print
(
msg
)
if
cursor
.
rowcount
>
0
:
send
=
jsonify
({
'status'
:
'already'
,
'student_id'
:
student_id
})
return
send
sql
=
"INSERT INTO student(student_id, student_name) VALUES (
%
s,
%
s)"
cursor
.
execute
(
sql
,
(
student_id
,
student_name
))
sql
=
"INSERT INTO lecture_students(lecture_id, student_id) VALUES (
%
s,
%
s)"
# temp: student in lecture 0
cursor
.
execute
(
sql
,
(
'0'
,
student_id
))
msg
=
'[{id}] is registered'
.
format
(
id
=
student_id
)
print
(
msg
)
# image to input tensor
image
=
base64
.
b64decode
(
request
.
form
[
'image'
])
image_np
=
np
.
frombuffer
(
image
,
dtype
=
np
.
uint8
)
...
...
flask/config.cnf
View file @
ba1b367
[verification_server]
model=models/20200816-080621
threshold=0.
8
threshold=0.
75
image_size=160
...
...
flask/templates/index.html
View file @
ba1b367
...
...
@@ -216,7 +216,7 @@ function main()
<div>
<!-- Header -->
<header
class=
"w3-container w3-center w3-padding-32"
>
<h1><b>
얼굴
등록
</b></h1>
<h1><b>
얼굴
인식 출석 시스템
</b></h1>
<p>
Made by
<span
class=
"w3-tag"
>
정해갑
</span></p>
</header>
</div>
...
...
Please
register
or
login
to post a comment