add Gait3D support
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,33 @@
|
||||
# Gait3D
|
||||
This is the pre-processing instructions for the Gait3D dataset. The original dataset can be found [here](https://gait3d.github.io/). The original dataset is not publicly available. You need to request access to the dataset in order to download it. This README explains how to extract the original dataset and convert it to a format suitable for OpenGait.
|
||||
## Data Preparation
|
||||
https://github.com/Gait3D/Gait3D-Benchmark#data-preparation
|
||||
## Data Pretreatment
|
||||
```python
|
||||
python datasets/pretreatment.py --input_path 'Gait3D/2D_Silhouettes' --output_path 'Gait3D-sils-64-64-pkl'
|
||||
python datasets/pretreatment_smpl.py --input_path 'Gait3D/3D_SMPLs' --output_path 'Gait3D-smpls-pkl'
|
||||
|
||||
(optional) python datasets/pretreatment.py --input_path 'Gait3D/2D_Silhouettes' --img_size 128 --output_path 'Gait3D-sils-128-128-pkl'
|
||||
|
||||
python datasets/Gait3D/merge_two_modality.py --sils_path 'Gait3D-sils-64-64-pkl' --smpls_path 'Gait3D-smpls-pkl' --output_path 'Gait3D-merged-pkl' --link 'hard'
|
||||
```
|
||||
|
||||
## Train
|
||||
### Baseline model:
|
||||
`CUDA_VISIBLE_DEVICES=0,1,2,3 python -m torch.distributed.launch --nproc_per_node=4 opengait/main.py --cfgs ./configs/baseline/baseline_Gait3D.yaml --phase train`
|
||||
### SMPLGait model:
|
||||
`CUDA_VISIBLE_DEVICES=0,1,2,3 python -m torch.distributed.launch --nproc_per_node=4 opengait/main.py --cfgs ./configs/smplgait/smplgait.yaml --phase train`
|
||||
|
||||
## Citation
|
||||
If you use this dataset in your research, please cite the following paper:
|
||||
```
|
||||
@inproceedings{zheng2022gait3d,
|
||||
title={Gait Recognition in the Wild with Dense 3D Representations and A Benchmark},
|
||||
author={Jinkai Zheng, Xinchen Liu, Wu Liu, Lingxiao He, Chenggang Yan, Tao Mei},
|
||||
booktitle={IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
|
||||
year={2022}
|
||||
}
|
||||
```
|
||||
|
||||
## Acknowledgements
|
||||
This dataset was collected by the [Zheng at. al.](https://gait3d.github.io/). The pre-processing instructions are based on (https://github.com/Gait3D/Gait3D-Benchmark).
|
||||
@@ -0,0 +1,46 @@
|
||||
import os
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
|
||||
|
||||
def merge(sils_path, smpls_path, output_path, link):
|
||||
if link == 'hard':
|
||||
link_method = os.link
|
||||
elif link == 'soft':
|
||||
link_method = os.symlink
|
||||
else:
|
||||
link_method = shutil.copyfile
|
||||
for _id in os.listdir(sils_path):
|
||||
id_path = os.path.join(sils_path, _id)
|
||||
for _type in os.listdir(id_path):
|
||||
type_path = os.path.join(id_path, _type)
|
||||
for _view in os.listdir(type_path):
|
||||
view_path = os.path.join(type_path, _view)
|
||||
for _seq in os.listdir(view_path):
|
||||
sils_seq_path = os.path.join(view_path, _seq)
|
||||
smpls_seq_path = os.path.join(
|
||||
smpls_path, _id, _type, _view, _seq)
|
||||
output_seq_path = os.path.join(output_path, _id, _type, _view)
|
||||
os.makedirs(output_seq_path, exist_ok=True)
|
||||
link_method(sils_seq_path, os.path.join(
|
||||
output_seq_path, "sils-"+_seq))
|
||||
link_method(smpls_seq_path, os.path.join(
|
||||
output_seq_path, "smpls-"+_seq))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description='Gait3D dataset mergence.')
|
||||
parser.add_argument('--sils_path', default='', type=str,
|
||||
help='Root path of raw silhs dataset.')
|
||||
parser.add_argument('--smpls_path', default='', type=str,
|
||||
help='Root path of raw smpls dataset.')
|
||||
parser.add_argument('-o', '--output_path', default='',
|
||||
type=str, help='Output path of pickled dataset.')
|
||||
parser.add_argument('-l', '--link', default='hard', type=str,
|
||||
choices=['hard', 'soft', 'copy'], help='Link type of output data.')
|
||||
args = parser.parse_args()
|
||||
|
||||
merge(sils_path=Path(args.sils_path), smpls_path=Path(
|
||||
args.smpls_path), output_path=Path(args.output_path), link=args.link)
|
||||
|
||||
Reference in New Issue
Block a user