From bb61874e90c9b51773ccb11642334031acdd3137 Mon Sep 17 00:00:00 2001 From: Qianyu Wang Date: Wed, 19 Oct 2022 16:31:21 +0800 Subject: [PATCH] fix python3.10 error (#84) Signed-off-by: Qianyu Wang Signed-off-by: Qianyu Wang --- datasets/OUMVLP/rearrange_OUMVLP.py | 3 ++- opengait/modeling/backbones/__init__.py | 4 ++-- opengait/modeling/losses/__init__.py | 4 ++-- opengait/modeling/models/__init__.py | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/datasets/OUMVLP/rearrange_OUMVLP.py b/datasets/OUMVLP/rearrange_OUMVLP.py index 7844479..3f68cec 100644 --- a/datasets/OUMVLP/rearrange_OUMVLP.py +++ b/datasets/OUMVLP/rearrange_OUMVLP.py @@ -2,6 +2,7 @@ import argparse import os import shutil from pathlib import Path +from typing import Tuple from tqdm import tqdm @@ -9,7 +10,7 @@ from tqdm import tqdm TOTAL_SUBJECTS = 10307 -def sanitize(name: str) -> (str, str): +def sanitize(name: str) -> Tuple[str, str]: return name.split('_')[1].split('-') diff --git a/opengait/modeling/backbones/__init__.py b/opengait/modeling/backbones/__init__.py index 7c99e5e..ac21357 100644 --- a/opengait/modeling/backbones/__init__.py +++ b/opengait/modeling/backbones/__init__.py @@ -5,13 +5,13 @@ from importlib import import_module # iterate through the modules in the current package package_dir = Path(__file__).resolve().parent -for (_, module_name, _) in iter_modules([package_dir]): +for (_, module_name, _) in iter_modules([str(package_dir)]): # import the module and iterate through its attributes module = import_module(f"{__name__}.{module_name}") for attribute_name in dir(module): attribute = getattr(module, attribute_name) - if isclass(attribute): + if isclass(attribute): # Add the class to this package's variables globals()[attribute_name] = attribute \ No newline at end of file diff --git a/opengait/modeling/losses/__init__.py b/opengait/modeling/losses/__init__.py index 7c99e5e..ac21357 100644 --- a/opengait/modeling/losses/__init__.py +++ b/opengait/modeling/losses/__init__.py @@ -5,13 +5,13 @@ from importlib import import_module # iterate through the modules in the current package package_dir = Path(__file__).resolve().parent -for (_, module_name, _) in iter_modules([package_dir]): +for (_, module_name, _) in iter_modules([str(package_dir)]): # import the module and iterate through its attributes module = import_module(f"{__name__}.{module_name}") for attribute_name in dir(module): attribute = getattr(module, attribute_name) - if isclass(attribute): + if isclass(attribute): # Add the class to this package's variables globals()[attribute_name] = attribute \ No newline at end of file diff --git a/opengait/modeling/models/__init__.py b/opengait/modeling/models/__init__.py index 7c99e5e..ac21357 100644 --- a/opengait/modeling/models/__init__.py +++ b/opengait/modeling/models/__init__.py @@ -5,13 +5,13 @@ from importlib import import_module # iterate through the modules in the current package package_dir = Path(__file__).resolve().parent -for (_, module_name, _) in iter_modules([package_dir]): +for (_, module_name, _) in iter_modules([str(package_dir)]): # import the module and iterate through its attributes module = import_module(f"{__name__}.{module_name}") for attribute_name in dir(module): attribute = getattr(module, attribute_name) - if isclass(attribute): + if isclass(attribute): # Add the class to this package's variables globals()[attribute_name] = attribute \ No newline at end of file