Browse Source

Code review and done

Signed-off-by: SiqiLuo <1587295470@qq.com>
tags/v0.6.0
SiqiLuo 2 years ago
parent
commit
5f117132d5
2 changed files with 5 additions and 2 deletions
  1. +1
    -1
      lib/sedna/algorithms/unseen_task_detection/unseen_sample_recognition/unseen_sample_detection.py
  2. +4
    -1
      lib/sedna/service/server/knowledgeBase/server.py

+ 1
- 1
lib/sedna/algorithms/unseen_task_detection/unseen_sample_recognition/unseen_sample_detection.py View File

@@ -41,7 +41,7 @@ class UnseenSampleDetection(threading.Thread):
if status_dict["if_fall"] == "False": if status_dict["if_fall"] == "False":
continue continue
elif status_dict["if_fall"] == "True" and \ elif status_dict["if_fall"] == "True" and \
self.current_status == "False":
self.current_status == "False":
self.current_status = "True" self.current_status = "True"
samples = os.listdir(self.local_image_url) samples = os.listdir(self.local_image_url)
samples.sort(reverse=True) samples.sort(reverse=True)


+ 4
- 1
lib/sedna/service/server/knowledgeBase/server.py View File

@@ -46,6 +46,10 @@ class TaskItem(BaseModel): # pylint: disable=too-few-public-methods




class KBServer(BaseServer): 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, def __init__(self, host: str, http_port: int = 8080,
workers: int = 1, save_dir=""): workers: int = 1, save_dir=""):
servername = "knowledgebase" servername = "knowledgebase"
@@ -167,7 +171,6 @@ class KBServer(BaseServer):


with Session(bind=engine) as session: with Session(bind=engine) as session:
# TODO: to adapt unseen tasks # TODO: to adapt unseen tasks
# for task_group in upload_info["task_groups"]:
for task_group in task_groups: for task_group in task_groups:
grp, g_create = get_or_create( grp, g_create = get_or_create(
session=session, model=TaskGrp, name=task_group.entry) session=session, model=TaskGrp, name=task_group.entry)


Loading…
Cancel
Save