Attention: All commands are excuted under the root of the porject.
Download ntu60_hrnet.pkl
and ntu120_hrnet.pkl
to data/action/.
- We use the data from 2D, but corresponding channel number is 3, the 3rd channel is the confidence of coordination. It has been metioned by MotionBERT Issue.
| manual1 | manual2 | |
|---|---|---|
| X-Sub | 89.87 | |
| X-View | ||
| X-Sub (finetuning) | 91.31 | |
| X-View (finetuning) |
| manual1 | manual2 | |
|---|---|---|
| X-Sub | ||
| X-View | ||
| X-Sub (finetuning) | ||
| X-View (finetuning) |
From scratch
# Corss-subject
python train_action.py \
--config configs/action/train_NTU60_xsub_small.yaml \
--checkpoint checkpoint/action/train_NTU60_xsub_small \
--hyper_cfg hyper_config/method2/manual_joint_label<1 or 2>.yaml \
--hyper_relation_bias uniform \
--version 2 \
<-r your_checkpoint_path_that_need_resume_for_resume_train>
# Cross-view
python train_action.py \
--config configs/action/train_NTU60_xview_small.yaml \
--checkpoint checkpoint/action/train_NTU60_xview_small\
--hyper_cfg hyper_config/method2/manual_joint_label<1 or 2>.yaml \
--hyper_relation_bias uniform \
--version 2 \
<-r your_checkpoint_path_that_need_resume_for_resume_train>
# Corss-subject
python train_action.py \
--config configs/action/train_NTU120_xsub_small.yaml \
--checkpoint checkpoint/action/train_NTU120_xsub_small \
--hyper_cfg hyper_config/method2/manual_joint_label<1 or 2>.yaml \
--hyper_relation_bias uniform \
--version 2 \
<-r your_checkpoint_path_that_need_resume_for_resume_train>
# Cross-view
python train_action.py \
--config configs/action/train_NTU120_xview_small.yaml \
--checkpoint checkpoint/action/train_NTU120_xview_small\
--hyper_cfg hyper_config/method2/manual_joint_label<1 or 2>.yaml \
--hyper_relation_bias uniform \
--version 2 \
<-r your_checkpoint_path_that_need_resume_for_resume_train>
Finetune from pertrained checkpoint
# Cross-subject
python train_action.py \
--config configs/action/ft_NTU60_xsub_small.yaml \
--hyper_cfg hyper_config/method2/manual_joint_label<1 or 2>.yaml \
--hyper_relation_bias uniform \
--version 2 \
--checkpoint checkpoint/action/ft_NTU60_xsub
# Cross-view
python train_action.py \
--config configs/action/ft_NTU60_xview_small.yaml \
--hyper_cfg hyper_config/method2/manual_joint_label<1 or 2>.yaml \
--hyper_relation_bias uniform \
--version 2 \
--checkpoint checkpoint/action/ft_NTU60_xviewThen, you should go into in config file named ft_xxx under certain directory, and modify
their backbone_ckpt's value for concrete checkpoint path.
# Cross-subject
python evaluate_action.py \
--config configs/action/train_NTU60_xsub_small.yaml \
--hyper_cfg hyper_config/method2/manual_joint_label<1 or 2>.yaml \
--hyper_relation_bias uniform \
--version 2 \
--evaluate <Your complete checkpoint path for total network>
# Cross-view
python evaluate_action.py \
--config configs/action/train_NTU60_xview_small.yaml \
--hyper_cfg hyper_config/method2/manual_joint_label<1 or 2>.yaml \
--hyper_relation_bias uniform \
--version 2 \
--evaluate <Your complete checkpoint path for total network>python vis_action_attn.py \
--config configs/action/train_NTU60_xsub_small.yaml \
--hyper_cfg hyper_config/method2/manual_joint_label<1 or 2>.yaml \
--hyper_relation_bias uniform \
--version 2 \
--evaluate <your complete checkpoint path,example here is : checkpoint/action/ntu_60/xsub/best_epoch_small.bin>python vis_action_attn.py \
--config configs/action/train_NTU120_xsub_small.yaml \
--hyper_cfg hyper_config/method2/manual_joint_label<1 or 2>.yaml \
--hyper_relation_bias uniform \
--version 2 \
--evaluate <your complete checkpoint path,example here is : checkpoint/action/ntu_60/xsub/best_epoch_small.bin>And the final heatmap result will be saved under certain directory
Here we only take .onnx file for simple deployment on CPU device:
# Cross-subject
python deployment/deployment_action.py \
--config configs/action/train_NTU60_xsub_small.yaml \
--hyper_cfg hyper_config/method2/manual_joint_label<1 or 2>.yaml \
--hyper_relation_bias uniform \
--version 2 \
--evaluate <Your complete checkpoint path for total network> \
--deployment <Your complete output path for *.onnx file result>
# Cross-view
python deployment/deployment_action.py \
--config configs/action/train_NTU60_xview_small.yaml \
--hyper_cfg hyper_config/method2/manual_joint_label<1 or 2>.yaml \
--hyper_relation_bias uniform \
--version 2 \
--evaluate <Your complete checkpoint path for total network> \
--deployment <Your complete output path for *.onnx file result>
Then, you can use exported *.onnx file under certain directory, and you can use it to visualize for wild video. Details see in inference document.
The final *.onnx file information about input and output shapes are:
input: {
pose2d: [N,T,V,C],
},
output{
action_label: [N,num_action_class],
}