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 05:52:00 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b48136de36a334d0e32f4ba3a2fa97b776e0bdc6
b48136de
1 parent
c80b1ab8
Convert image BGR to RGB
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
1 deletions
flask/app.py
flask/app.py
View file @
b48136d
...
...
@@ -53,7 +53,6 @@ def index():
def
register
():
if
request
.
method
==
'GET'
:
return
render_template
(
'register.html'
)
attendance_db
=
pymysql
.
connect
(
read_default_file
=
"./DB.cnf"
)
cursor
=
attendance_db
.
cursor
(
pymysql
.
cursors
.
DictCursor
)
send
=
{
'form'
:
'json'
}
...
...
@@ -75,6 +74,7 @@ def register():
image
=
base64
.
b64decode
(
request
.
form
[
'image'
])
image_np
=
np
.
frombuffer
(
image
,
dtype
=
np
.
uint8
)
image_np
=
cv2
.
imdecode
(
image_np
,
cv2
.
IMREAD_UNCHANGED
)
image_np
=
cv2
.
cvtColor
(
image_np
,
cv2
.
COLOR_BGR2RGB
)
image_np
=
prewhiten
(
image_np
)
image_np
=
resize
(
image_np
)
image_np
=
image_np
.
reshape
(
-
1
,
image_size
,
image_size
,
3
)
...
...
Please
register
or
login
to post a comment