From 5f117132d5a3fc06ef26cb1b22b8c106e3381f7d Mon Sep 17 00:00:00 2001 From: SiqiLuo <1587295470@qq.com> Date: Wed, 28 Dec 2022 16:06:02 +0800 Subject: [PATCH] Code review and done Signed-off-by: SiqiLuo <1587295470@qq.com> --- .../unseen_sample_recognition/unseen_sample_detection.py | 2 +- lib/sedna/service/server/knowledgeBase/server.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/sedna/algorithms/unseen_task_detection/unseen_sample_recognition/unseen_sample_detection.py b/lib/sedna/algorithms/unseen_task_detection/unseen_sample_recognition/unseen_sample_detection.py index 7caf7d41..a60288db 100644 --- a/lib/sedna/algorithms/unseen_task_detection/unseen_sample_recognition/unseen_sample_detection.py +++ b/lib/sedna/algorithms/unseen_task_detection/unseen_sample_recognition/unseen_sample_detection.py @@ -41,7 +41,7 @@ class UnseenSampleDetection(threading.Thread): if status_dict["if_fall"] == "False": continue elif status_dict["if_fall"] == "True" and \ - self.current_status == "False": + self.current_status == "False": self.current_status = "True" samples = os.listdir(self.local_image_url) samples.sort(reverse=True) diff --git a/lib/sedna/service/server/knowledgeBase/server.py b/lib/sedna/service/server/knowledgeBase/server.py index 5784ba16..a0590303 100644 --- a/lib/sedna/service/server/knowledgeBase/server.py +++ b/lib/sedna/service/server/knowledgeBase/server.py @@ -46,6 +46,10 @@ class TaskItem(BaseModel): # pylint: disable=too-few-public-methods class KBServer(BaseServer): + """ + As knowledge base stored in sqlite, this class realized creation, + update and query of sqlite. + """ def __init__(self, host: str, http_port: int = 8080, workers: int = 1, save_dir=""): servername = "knowledgebase" @@ -167,7 +171,6 @@ class KBServer(BaseServer): with Session(bind=engine) as session: # TODO: to adapt unseen tasks - # for task_group in upload_info["task_groups"]: for task_group in task_groups: grp, g_create = get_or_create( session=session, model=TaskGrp, name=task_group.entry)