Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions training/app/endpoints/dataset_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
5 changes: 4 additions & 1 deletion training/app/plugins/emotion_recognition/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]):
Expand Down Expand Up @@ -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:
Expand All @@ -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)

Expand Down
1 change: 1 addition & 0 deletions training/app/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading