diff --git a/training/app/endpoints/dataset_endpoints.py b/training/app/endpoints/dataset_endpoints.py index 644623e..b923a68 100644 --- a/training/app/endpoints/dataset_endpoints.py +++ b/training/app/endpoints/dataset_endpoints.py @@ -271,6 +271,7 @@ def upload_dataset(passed_request: Request = None): @bp.route("/labeling_tasks", methods=["GET"]) def get_labeling_tasks(): + ## TODO MV: do not use postgress access directly here, but make use of the connectors and datastore interfaces. DB_CONFIG = { "dbname": os.getenv("DATABASE_NAME", "chimp_database"), "user": os.getenv("DATABASE_USER", "chimp_user"), diff --git a/training/app/plugins/emotion_recognition/__init__.py b/training/app/plugins/emotion_recognition/__init__.py index 18200c7..2a26f70 100644 --- a/training/app/plugins/emotion_recognition/__init__.py +++ b/training/app/plugins/emotion_recognition/__init__.py @@ -87,7 +87,7 @@ def run(self, *args, **kwargs) -> Optional[str]: print("KWARGS DEBUG:", kwargs) - + ##TODO MV: do not access prostgress direclty here, but use the connector and datastore interfaces #MV TODO: #36 built logic based on plugin info # 1) New Model Personal Data if kwargs["trainnew"] & kwargs["personaldata"] & (not kwargs["basedata"]) & (not kwargs["newdata"]): @@ -176,6 +176,8 @@ def run(self, *args, **kwargs) -> Optional[str]: artifacts= {'keras' : tf_path}, #save the tensorflow version as well, ) + + ##TODO MV: do not access prostgress direclty here, but use the connector and datastore interfaces with self._datastore._db_conn.cursor() as cursor: insert_data = [] for row in rows: @@ -197,6 +199,7 @@ def load_data(self, select_query): label_idx = {category : class_ for class_, category in enumerate(self.config["categories"])} self.data = {"image_data": [], "class_": [], "category": []} + ##TODO MV: do not access prostgress direclty here, but use the connector and datastore interfaces with self._datastore._db_conn.cursor() as cursor: cursor.execute(select_query) diff --git a/training/app/scheduler.py b/training/app/scheduler.py index 06ed60e..dcefa6d 100644 --- a/training/app/scheduler.py +++ b/training/app/scheduler.py @@ -114,6 +114,7 @@ def upload_curated_dataset(dataset_name, items): with zipfile.ZipFile(zip_buffer, "w") as zip_file: for item in items: try: + ##TODO MV: do we want direct access to postgress here, or hide it behind the connectors interface? datapoint_id = item["datapoint_id"] cursor.execute("SELECT x, y, metadata FROM datapoints WHERE id = %s", (datapoint_id,)) result = cursor.fetchone()