diff --git a/client/drivers/ai_bros.py b/client/drivers/ai_bros.py deleted file mode 100644 index 303c162..0000000 --- a/client/drivers/ai_bros.py +++ /dev/null @@ -1,80 +0,0 @@ -## SECTION: Imports - -from typing import Tuple -from PiicoDev_Switch import PiicoDev_Switch -from PiicoDev_SSD1306 import * -import threading -from datetime import datetime -from data.routines import * -# from models.face_rec.routines import get_user_from_face # TODO: Fix this import later... - -#from PiicoDev_Unified import sleep_ms - -from data_structures import ControlledData, HardwareComponents, Picture, Face - - -def ai_bros_face_recogniser(underlying_picture : int) -> Face: # TODO: Refine type signature - """ - Recognise a face, powered by AI. - - Args: - underlying_picture : UNDERLYING_PICTURE - The picture to pass to the face recogniser. This data passing may be handled differently - in the final version. - Returns: - (Face): Failed, matched or unmatched Face - TODO: Convert this into an external API call. Currently returns debug data. - """ - # DEBUG: - print(" ai_bros_face_recogniser()") - DEBUG_failed = False - DEBUG_unmatched = None - DEBUG_user_id = 1 - - # try: - # returned_user = get_user_from_face(underlying_picture) - # except NotImplementedError: - # returned_user = -1 - #returned_user = DEBUG_unmatched - - # :DEBUG - if DEBUG_failed: - return Face.make_failed() - # if returned_user is None: # DEBUG - # return Face.make_unmatched() # DEBUG - return Face.make_matched(DEBUG_user_id) - # return Face.make_matched(returned_user.id_) # DEBUG - -def ai_bros_posture_score(underlying_picture : "UNDERLYING_PICTURE") -> int: # TODO: Refine type signature - """ - Args: - underlying_picture : UNDERLYING_PICTURE - The picture of the person's posture - Returns: - int: score representing how good the posture currently is??? - TODO: Convert this into an external API call. Currently returns debug data. - NOTE: This will eventually be a database lookup. We're running the AI posture peeker - asynchronously to the controller code. - FIXME: This documentation is terrible - """ - return 1 - -def ai_bros_get_posture_data(last_snapshot_time : datetime) -> "POSTURE_DATA": # TODO: Refine type signature - """ - API call to get posture data from the SQLite database. - Gets all data from after last_snapshot_time until the current time. - - Args: - last_snapshot_time : datetime - The last time we read the posture data. - - Returns: - (POSTURE_DATA): Posture data returned from the API call. - - TODO: Actually implement this method. Currently prints a debug method and returns an empty list. - """ - # DEBUG: - print(" ai_bros_get_posture_data()") - DEBUG_return_value = [] - # :DEBUG - return DEBUG_return_value diff --git a/client/drivers/main.py b/client/drivers/main.py index 43112fe..1b9f45d 100644 --- a/client/drivers/main.py +++ b/client/drivers/main.py @@ -21,7 +21,6 @@ from datetime import datetime, timedelta from data_structures import ControlledData, HardwareComponents, Picture, Face -from ai_bros import * from data.routines import * @@ -194,9 +193,7 @@ def attempt_login() -> ControlledData: hardware.display.show() sleep_ms(LOGIN_TAKE_PICTURE_INTERVAL) continue - face = ai_bros_face_recogniser( - picture.underlying_picture - ) # TODO: This should be an external API call. + face = Face.make_matched(1) if face.failed: print(" AI has failed us") # DEBUG hardware.display.fill(0) @@ -418,9 +415,7 @@ def handle_posture_monitoring(auspost: ControlledData) -> bool: if now > auspost.get_last_snapshot_time() + GET_POSTURE_DATA_TIMEOUT: # TODO: The ai_bros_get_posture_data() call might fail once it's implemented properly. # If it does, we need to handle it properly. - auspost.accept_new_posture_data( - ai_bros_get_posture_data(auspost.get_last_snapshot_time()) - ) + auspost.accept_new_posture_data([]) # DEBUG: auspost.accept_new_posture_data([auspost.DEBUG_get_next_posture_graph_value()]) # :DEBUG