From da4fdcdbb83e44dd72e90d35591cf6ba14043206 Mon Sep 17 00:00:00 2001 From: Kaminyou Date: Fri, 19 Jan 2024 23:44:39 +0800 Subject: [PATCH] linting --- backend/inference/config.py | 13 +------------ backend/inference/tasks.py | 4 +--- backend/models/request.py | 2 +- backend/test.py | 11 +++++++++++ 4 files changed, 14 insertions(+), 16 deletions(-) create mode 100644 backend/test.py diff --git a/backend/inference/config.py b/backend/inference/config.py index c44b122..cae247c 100644 --- a/backend/inference/config.py +++ b/backend/inference/config.py @@ -1,17 +1,8 @@ import typing as t from algorithms._analyzer import Analyzer -from algorithms.gait_basic.main import BasicGaitAnalyzer, SVOGaitAnalyzer +from algorithms.gait_basic.main import SVOGaitAnalyzer -# GAIT_PRECOMPUTED_CSV_AND_MP4_MODELS = { -# 'gait_basic::v1': BasicGaitAnalyzer, -# 'gait_basic::v2': BasicGaitAnalyzer, -# } - -# GAIT_PRECOMPUTED_CSV_AND_MP4_MODELS_SIMPLE = { -# 'gait_basic::v3': BasicGaitAnalyzer, -# 'gait_basic::v4': BasicGaitAnalyzer, -# } GAIT_PRECOMPUTED_CSV_AND_MP4_MODELS_SIMPLE = { 'gait_svo::v1': SVOGaitAnalyzer, @@ -19,8 +10,6 @@ MAPPING = { 'gait_svo_and_txt': GAIT_PRECOMPUTED_CSV_AND_MP4_MODELS_SIMPLE, - # 'gait_precomputed_csv_and_mp4': GAIT_PRECOMPUTED_CSV_AND_MP4_MODELS, - # 'gait_precomputed_csv_and_mp4_simple': GAIT_PRECOMPUTED_CSV_AND_MP4_MODELS_SIMPLE, } diff --git a/backend/inference/tasks.py b/backend/inference/tasks.py index 34ec926..fcb61af 100644 --- a/backend/inference/tasks.py +++ b/backend/inference/tasks.py @@ -1,7 +1,6 @@ import os from celery import Celery -from celery.exceptions import MaxRetriesExceededError from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker @@ -36,7 +35,7 @@ def inference_gait_task(self, submitUUID: str): dataType = request_instance.dataType modelName = request_instance.modelName - trialID = request_instance.trialID + trialID = request_instance.trialID try: inference_gait( @@ -62,4 +61,3 @@ def inference_gait_task(self, submitUUID: str): return True return True - diff --git a/backend/models/request.py b/backend/models/request.py index a9b8a38..8f102c9 100644 --- a/backend/models/request.py +++ b/backend/models/request.py @@ -27,7 +27,7 @@ class RequestModel(db.Model): @classmethod def find_by_account(cls, account: str) -> t.List['RequestModel']: return cls.query.filter_by(account=account).order_by(RequestModel.dateUpload.desc()).all() - + @classmethod def find_by_account_and_sort_by_exp_date(cls, account: str) -> t.List['RequestModel']: return cls.query.filter_by(account=account).order_by(RequestModel.date.desc()).all() diff --git a/backend/test.py b/backend/test.py new file mode 100644 index 0000000..e73e814 --- /dev/null +++ b/backend/test.py @@ -0,0 +1,11 @@ +from algorithms.gait_basic.main import SVOGaitAnalyzer + +if __name__ == '__main__': + analyzer = SVOGaitAnalyzer() + result = analyzer.run( + data_root_dir='/root/backend/data/test', + file_id='2021-04-01-1-4', + # data_root_dir='/root/backend/data/87559608-0c9d-4431-9131-18c770be22bf/', + # file_id='uploaded', + ) + print(result)