Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaminyou committed Jan 19, 2024
1 parent 02140db commit da4fdcd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
13 changes: 1 addition & 12 deletions backend/inference/config.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
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,
}

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,
}


Expand Down
4 changes: 1 addition & 3 deletions backend/inference/tasks.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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(
Expand All @@ -62,4 +61,3 @@ def inference_gait_task(self, submitUUID: str):
return True

return True

2 changes: 1 addition & 1 deletion backend/models/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
11 changes: 11 additions & 0 deletions backend/test.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit da4fdcd

Please sign in to comment.