Commit 31297500 authored by Kyle Anderson's avatar Kyle Anderson

Small improvements

Made several small improvements all around.
parent 1fe84069
......@@ -166,9 +166,11 @@ def recognize_user_from_database(database_loc: str = common.DATABASE_LOC, encodi
Lower quality means faster but less reliable recognition.
:return: The recognized user's id, or None if no user was recognized.
"""
return recognize_user(data_handler.load_database(database_loc), encoding_model=encoding_model,
image_flip=image_flip,
draw_rectangles=draw_rectangles, camera=camera, image_width=image_width)
database = data_handler.load_database(database_loc)
if len(database) > 0:
return recognize_user(database, encoding_model=encoding_model,
image_flip=image_flip,
draw_rectangles=draw_rectangles, camera=camera, image_width=image_width)
# If this program is the main program, authenticate the user.
......
......@@ -51,5 +51,7 @@ if __name__ == "__main__":
register_user(**{arg_name: arg for (arg_name, arg)
in kwargs.items() if args is not None})
elif args.authenticate:
print(authenticate_user(
**{arg_name: arg for (arg_name, arg) in kwargs.items() if arg is not None}))
user_id: str = authenticate_user(
**{arg_name: arg for (arg_name, arg) in kwargs.items() if arg is not None})
if user_id:
print(user_id)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment