Required changes to train the skeleton action recognition model with custom data #277
-
Hello opendr-team, For the last step I need to train the models with the custom dataset. Therefore, I was wondering if someone can enlighten me on what changes need to be made to train one of the provided models with either the spatio_temporal_gcn_learner or the progressive_spatio_temporal_gcn_learner. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi, Thank you for your interest in OpenDR project. In order to train the models on a custom-skeleton dataset, you need first to employ light-weight openpose method to extract body poses from the videos. I have a code for that in this directory: After extracting body skeletons, you need to do some preprocessing as well. The models receive a sequence of 300 skeletons for each sample. Therefore, if you have less than 300 frames in each video, you need to do padding to fulfill this. Also, we assumed that in each frame we have two skeletons (because NTU-RGBD and Kinetics datasets had some actions taken place by two-person interaction like "shaking hand"). So you need to check each frame and in case there are less than 2 skeletons in each frame, you need padding and if there are more than 2 skeletons in each frame you need to choose 2 of them (this is included in the code). So the first step to prepare a custom dataset is to follow the preprocessing steps to make sure each input video will be modeled as a tensor of size CxTxV (2x300x18). |
Beta Was this translation helpful? Give feedback.
Yes, if you have extracted skeletons and the corresponding labels ready, all you need to do is to make an object of
SpatioTemporalGCNLearner
class and feed the parameters according to your dataset (ex. num_points, num_classes, graph_type, etc).Then you can call the
fit()
function and train a model.