Graduate

Update register method

......@@ -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)
......
[verification_server]
model=models/20200816-080621
threshold=0.8
threshold=0.75
image_size=160
......
......@@ -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>
......