def get_sequence_indices(self) -> List[List[int]]:
        """Split original videos into sequences and build frame indices.

        This method overrides the default one in the base class.
        """
        imgnames = self.ann_data['imgname']
        video_frames = defaultdict(list)
        for idx, imgname in enumerate(imgnames):
            subj, action, camera = self._parse_h36m_imgname(imgname)
            video_frames[(subj, action, camera)].append(idx)

        # build sample indices
        sequence_indices = []
        _len = (self.seq_len - 1) * self.seq_step + 1
        _step = self.seq_step
        for _, _indices in sorted(video_frames.items()):
            n_frame = len(_indices)

            if self.pad_video_seq:
                # Pad the sequence so that every frame in the sequence will be
                # predicted.
                if self.causal:
                    frames_left = self.seq_len - 1
                    frames_right = 0
                else:
                    frames_left = (self.seq_len - 1) // 2
                    frames_right = frames_left
                for i in range(n_frame):
                    pad_left = max(0, frames_left - i // _step)
                    pad_right = max(0,
                                    frames_right - (n_frame - 1 - i) // _step)
                    start = max(i % _step, i - frames_left * _step)
                    end = min(n_frame - (n_frame - 1 - i) % _step,
                              i + frames_right * _step + 1)
                    sequence_indices.append([_indices[0]] * pad_left +
                                            _indices[start:end:_step] +
                                            [_indices[-1]] * pad_right)
            else:
                seqs_from_video = [
                    _indices[i:(i + _len):_step]
                    for i in range(0, n_frame - _len + 1)
                ]
                sequence_indices.extend(seqs_from_video)

        # reduce dataset size if needed
        subset_size = int(len(sequence_indices) * self.subset_frac)
        start = np.random.randint(0, len(sequence_indices) - subset_size + 1)
        end = start + subset_size

        return sequence_indices[start:end]
Split original videos into sequences and build frame indices.

        This method overrides the default one in the base class.
        
mmpose/mmpose/datasets/datasets/body3d/h36m_dataset.py