From 9ae119416312ce01516362c20928e0f83852e7f3 Mon Sep 17 00:00:00 2001 From: Noah <595311942@qq.com> Date: Sat, 12 Mar 2022 17:53:00 +0800 Subject: [PATCH] fix enviroment.yaml and update readme --- README.md | 5 +++-- docs/0.prepare_dataset.md | 7 +++++-- environment.yml | 22 ---------------------- misc/extractor.py | 10 ++++++---- 4 files changed, 14 insertions(+), 30 deletions(-) delete mode 100644 environment.yml diff --git a/README.md b/README.md index 212ee58..e864236 100644 --- a/README.md +++ b/README.md @@ -58,15 +58,16 @@ The results in the parentheses are mentioned in the papers - tensorboard - opencv-python - tqdm + - py7zr Install dependenices by [Anaconda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html): ``` - conda install tqdm pyyaml tensorboard opencv + conda install tqdm pyyaml tensorboard opencv py7zr conda install pytorch==1.6.0 torchvision -c pytorch ``` Or, Install dependenices by pip: ``` - pip install tqdm pyyaml tensorboard opencv-python + pip install tqdm pyyaml tensorboard opencv-python py7zr pip install torch==1.6.0 torchvision==0.7.0 ``` ### Prepare dataset diff --git a/docs/0.prepare_dataset.md b/docs/0.prepare_dataset.md index a50002a..1dbd62c 100644 --- a/docs/0.prepare_dataset.md +++ b/docs/0.prepare_dataset.md @@ -35,6 +35,9 @@ Download URL: http://www.cbsr.ia.ac.cn/GaitDatasetB-silh.zip Step1: Download URL: http://www.am.sanken.osaka-u.ac.jp/BiometricDB/GaitMVLP.html Step2: Unzip the dataset, you will get a structure directory like: +``` +python misc/extractor.py --input_path Path_of_OUMVLP-base --output_path Path_of_OUMVLP-raw --password Given_Password +``` - Original ``` @@ -67,12 +70,12 @@ Step2: Unzip the dataset, you will get a structure directory like: ``` Step3 : To rearrange directory of OUMVLP dataset, turning to id-type-view structure, Run ``` -python misc/rearrange_OUMVLP.py --input_path OUMVLP-raw --output_path OUMVLP-rearrange +python misc/rearrange_OUMVLP.py --input_path Path_of_OUMVLP-raw --output_path Path_of_OUMVLP-rearranged ``` Step4: Transforming images to pickle file, run ``` -python misc/pretreatment.py --input_path OUMVLP-rearrange --output_path OUMVLP-pkl +python misc/pretreatment.py --input_path Path_of_OUMVLP-rearranged --output_path Path_of_OUMVLP-pkl ``` - Processed diff --git a/environment.yml b/environment.yml deleted file mode 100644 index 3852cc6..0000000 --- a/environment.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: opengait -channels: - - pytorch - - defaults - - anaconda - - conda-forge -dependencies: - - python - - pip - - tqdm - - numpy - - pandas - - matplotlib - - scikit-learn - - pytorch - - torchvision - - cudatoolkit=10.2 - - ipykernel - - pip: - - tensorboard - - seaborn - - py7zr diff --git a/misc/extractor.py b/misc/extractor.py index 9451e34..86562d5 100644 --- a/misc/extractor.py +++ b/misc/extractor.py @@ -6,7 +6,7 @@ import py7zr from tqdm import tqdm -def extractall(base_path: Path, output_path: Path) -> None: +def extractall(base_path: Path, output_path: Path, passwords) -> None: """Extract all archives in base_path to output_path. Args: @@ -18,7 +18,7 @@ def extractall(base_path: Path, output_path: Path) -> None: for file_path in tqdm(list(base_path.rglob('Silhouette_*.7z'))): if output_path.joinpath(file_path.stem).exists(): continue - with py7zr.SevenZipFile(file_path, password='OUMVLP_20180214') as archive: + with py7zr.SevenZipFile(file_path, password=passwords) as archive: total_items = len( [f for f in archive.getnames() if f.endswith('.png')] ) @@ -32,11 +32,13 @@ def extractall(base_path: Path, output_path: Path) -> None: if __name__ == '__main__': parser = argparse.ArgumentParser(description='OUMVLP extractor') - parser.add_argument('-b', '--base_path', type=str, + parser.add_argument('-b', '--input_path', type=str, required=True, help='Base path to OUMVLP .7z files') parser.add_argument('-o', '--output_path', type=str, required=True, help='Output path for extracted files') + parser.add_argument('-p', '--password', type=str, + required=True, help='password for extracted files') args = parser.parse_args() - extractall(Path(args.base_path), Path(args.output_path)) + extractall(Path(args.input_path), Path(args.output_path), args.password)