def _get_features(self, batch):
    unique_ids = pandas.Series(batch['idx']).drop_duplicates().index.tolist()
    filenames = [batch['filename'][idx] for idx in unique_ids]
    ids = [batch['idx'][idx] for idx in unique_ids]
    shard_names = [batch['shard_name'][idx] for idx in unique_ids]
    metas = [{'id': idx, 'filename': filename, 'shard_name': shard_name} for (idx, filename, shard_name) in zip(ids, filenames, shard_names)]
    video_features = batch['SLOWFAST_8x8_R50/kinetics-400']['layer_4']
    audio_features = batch['VGGish/YouTube-8M']['layer_4']
    unique_ids = torch.Tensor(unique_ids).long()
    video_features = video_features.index_select(dim=0, index=unique_ids)
    audio_features = audio_features.index_select(dim=0, index=unique_ids)
    return (metas, [video_features, audio_features])
def _get_features(self, batch):
    unique_ids = pandas.Series(batch['idx']).drop_duplicates().index.tolist()
    filenames = [batch['filename'][idx] for idx in unique_ids]
    ids = [batch['idx'][idx] for idx in unique_ids]
    shard_names = [batch['shard_name'][idx] for idx in unique_ids]
    metas = [{'id': idx, 'filename': filename, 'shard_name': shard_name} for (idx, filename, shard_name) in zip(ids, filenames, shard_names)]
    video_features = batch['SLOWFAST_8x8_R50/kinetics-400']['layer_4']
    audio_features = batch['VGGish/YouTube-8M']['layer_4']
    unique_ids = torch.Tensor(unique_ids).long()
    video_features = video_features.index_select(dim=0, index=unique_ids)
    audio_features = audio_features.index_select(dim=0, index=unique_ids)
    return (metas, [video_features, audio_features])