lidargaitv2 open-source

This commit is contained in:
Noah
2025-06-11 14:43:19 +08:00
parent c42f2f8c07
commit 16a7c3f0bf
11 changed files with 6396 additions and 4 deletions
+48
View File
@@ -0,0 +1,48 @@
# LidarGait++: Learning Local Features and Size Awareness from LiDAR Point Clouds for 3D Gait Recognition
This [paper](https://openaccess.thecvf.com/content/CVPR2025/papers/Shen_LidarGait_Learning_Local_Features_and_Size_Awareness_from_LiDAR_Point_CVPR_2025_paper.pdf) has been accepted by CVPR 2025.
## Prepare dataset
**SUSTech1K**:
- Step 1. Apply for [SUSTech1K](https://lidargait.github.io/).
**FreeGait** (Optional):
- Step 1. Download [FreeGait](https://drive.google.com/drive/folders/1I9zOCmqUuBUcOmvO1cgZtUC6uSfmAq7h) first.
- Then rearrange the folder structure like SUSTech1K/CASIA-B to fit OpenGait framework.
```
python datasets/FreeGait/rearrange_freegait.py --input_path yout_freegait_path
```
## Train
To train on SUSTech1K, run
```
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python -m torch.distributed.launch --nproc_per_node=4 opengait/main.py --cfgs ./configs/lidargaitv2/lidargaitv2_sustech1k.yaml --phase train
```
or train on FreeGait, run
```
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python -m torch.distributed.launch --nproc_per_node=4 opengait/main.py --cfgs ./configs/lidargaitv2/lidargaitv2_freegait.yaml --phase train
```
## Citation
```bibtex
@inproceedings{shen2023lidargait,
title={Lidargait: Benchmarking 3d gait recognition with point clouds},
author={Shen, Chuanfu and Fan, Chao and Wu, Wei and Wang, Rui and Huang, George Q and Yu, Shiqi},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={1054--1063},
year={2023}
}
@inproceedings{shen2025lidargait++,
title={LidarGait++: Learning Local Features and Size Awareness from LiDAR Point Clouds for 3D Gait Recognition},
author={Shen, Chuanfu and Wang, Rui and Duan, Lixin and Yu, Shiqi},
booktitle={Proceedings of the Computer Vision and Pattern Recognition Conference},
pages={6627--6636},
year={2025}
}
```
@@ -0,0 +1,111 @@
data_cfg:
dataset_name: FreeGait
dataset_root: your_path
dataset_partition: ./datasets/FreeGait/FreeGait.json
num_workers: 1
data_in_use: [false, false, true, false, false]
remove_no_gallery: false # Remove probe if no gallery for it
test_dataset_name: FreeGait
evaluator_cfg:
enable_float16: false #true #false #true
restore_ckpt_strict: true
restore_hint: 80000
save_name: lidargaitv2
eval_func: evaluate_FreeGait
sampler:
batch_shuffle: false
points_in_use: # For point-based gait recognition using point clouds
pointcloud_index: 0
points_num: 256 #312 #256 #2048
batch_size: 8
frames_num_fixed: 10 # fixed frames number for training
frames_skip_num: 0
#sample_type: fixed_ordered
sample_type: all_ordered # all indicates whole sequence used to test, while ordered means input sequence by its natural order; Other options: fixed_unordered
frames_all_limit: 720 # limit the number of sampled frames to prevent out of memory
metric: euc # cos
transform:
- type: PointCloudsTransform
xyz_only: true
scale_aware: true
loss_cfg:
- loss_term_weight: 1.0
margin: 0.2
type: TripletLoss
log_prefix: triplet
lazy: False
- loss_term_weight: 0.1
scale: 31 #16
type: CrossEntropyLoss
log_prefix: softmax
log_accuracy: true
model_cfg:
model: LidarGaitPlusPlus
pool: PPP_HAP
sampling: knn
channel: 32
npoints: [256, 192, 128]
nsample: 16
scale_aware: true
normalize_dp: true
SeparateFCs:
in_channels: 256
out_channels: 256
parts_num: 31
SeparateBNNecks:
class_num: 500
in_channels: 256
parts_num: 31
scale:
- 1
- 2
- 4
- 8
- 16
optimizer_cfg:
lr: 0.1
momentum: 0.9
solver: SGD
weight_decay: 0.0005
scheduler_cfg:
T_max: 80000
eta_min: 0.0001
scheduler: CosineAnnealingLR
trainer_cfg:
enable_float16: false #true # half_percesion float for memory reduction and speedup
fix_BN: false
with_test: true
log_iter: 100
restore_ckpt_strict: true
restore_hint: 0
save_iter: 5000
save_name: lidargaitv2
sync_BN: true
total_iter: 80000
sampler:
batch_shuffle: true
batch_size:
- 32 # TripletSampler, batch_size[0] indicates Number of Identity
- 4 # batch_size[1] indicates Samples sequqnce for each Identity
frames_num_fixed: 10 # fixed frames number for training
sample_type: fixed_unordered # fixed control input frames number, unordered for controlling order of input tensor; Other options: unfixed_ordered or all_ordered
type: TripletSampler
points_in_use:
pointcloud_index: 0
points_num: 256
transform:
- type: PointCloudsTransform
xyz_only: true
scale_aware: true
scale_prob: 0.2
flip_prob: 0.1
@@ -0,0 +1,110 @@
data_cfg:
dataset_name: SUSTech1K
dataset_root: your_path # download from https://lidargait.github.io/ if you don't have dataset
dataset_partition: ./datasets/SUSTech1K/SUSTech1K.json
num_workers: 4
data_in_use: [true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false]
remove_no_gallery: false # Remove probe if no gallery for it
test_dataset_name: SUSTech1K
evaluator_cfg:
enable_float16: true
restore_ckpt_strict: true
restore_hint: 40000
save_name: lidargaitv2
eval_func: evaluate_indoor_dataset
sampler:
batch_shuffle: false
points_in_use: # For point-based gait recognition using point clouds
pointcloud_index: 0
points_num: 1024 #2048
batch_size: 4
frames_num_fixed: 10 # fixed frames number for training
frames_skip_num: 0
#sample_type: fixed_ordered
sample_type: all_ordered # all indicates whole sequence used to test, while ordered means input sequence by its natural order; Other options: fixed_unordered
frames_all_limit: 720 # limit the number of sampled frames to prevent out of memory
metric: euc # cos
transform:
- type: PointCloudsTransform
xyz_only: true
scale_aware: true
loss_cfg:
- loss_term_weight: 1.0
margin: 0.2
type: TripletLoss
log_prefix: triplet
lazy: False
- loss_term_weight: 0.1
scale: 31
type: CrossEntropyLoss
log_prefix: softmax
log_accuracy: true
model_cfg:
model: LidarGaitPlusPlus
pool: PPP_HAP
sampling: knn
channel: 16
npoints: [512, 256, 128]
nsample: 32
scale_aware: true
normalize_dp: true
SeparateFCs:
in_channels: 256
out_channels: 256
parts_num: 31
SeparateBNNecks:
class_num: 250
in_channels: 256
parts_num: 31
scale:
- 1
- 2
- 4
- 8
- 16
optimizer_cfg:
lr: 0.1
momentum: 0.9
solver: SGD
weight_decay: 0.0005
scheduler_cfg:
T_max: 40000
eta_min: 0.0001
scheduler: CosineAnnealingLR
trainer_cfg:
enable_float16: false #true # half_percesion float for memory reduction and speedup
fix_BN: false
with_test: true
log_iter: 100
restore_ckpt_strict: true
restore_hint: 0
save_iter: 5000
save_name: lidargaitv2
sync_BN: true
total_iter: 40000
sampler:
batch_shuffle: true
batch_size:
- 32 # TripletSampler, batch_size[0] indicates Number of Identity
- 4 # batch_size[1] indicates Samples sequqnce for each Identity
frames_num_fixed: 10 # fixed frames number for training
sample_type: fixed_unordered # fixed control input frames number, unordered for controlling order of input tensor; Other options: unfixed_ordered or all_ordered
type: TripletSampler
points_in_use:
pointcloud_index: 0
points_num: 1024
transform:
- type: PointCloudsTransform
xyz_only: true
scale_aware: true
scale_prob: 1
flip_prob: 0.15