def METHOD_NAME(label_info, out_dir):
    print('save feature ...')
    fps = label_info['fps']
    out_feature_dir = out_dir + '/feature'
    out_feature_dir = os.path.abspath(out_feature_dir)
    if not os.path.exists(out_feature_dir):
        os.mkdir(out_feature_dir)
    fid_train = open(out_dir + '/train.txt', 'w')
    fid_val = open(out_dir + '/val.txt', 'w')
    for res in label_info['results']:
        basename = os.path.basename(res['url']).split('.')[0]
        print(basename, res['num_proposals'])
        mode = res['mode']
        fid = fid_train if mode == 'train' else fid_val
        feature_path = os.path.join(feat_dir, basename + '.pkl')
        feature_data = pickle.load(open(feature_path, 'rb'))
        image_feature = feature_data['image_feature']
        audio_feature = feature_data['audio_feature']
        max_len_audio = len(audio_feature)
        for proposal in res['proposal_actions']:
            label = proposal['label']
            start_id = proposal['proposal']['start']
            end_id = proposal['proposal']['end']
            # get hit feature
            image_feature_hit = image_feature[start_id * fps:end_id * fps]
            audio_feature_hit = audio_feature[min(start_id, max_len_audio
                                                  ):min(end_id, max_len_audio)]
            # save
            anno_info = {
                'image_feature': np.array(image_feature_hit, dtype=np.float32),
                'audio_feature': np.array(audio_feature_hit, dtype=np.float32),
                'feature_fps': fps,
                'label_info': proposal,
                'video_name': basename
            }
            save_name = '{}/{}_{}_{}.pkl'.format(out_feature_dir, basename,
                                                 start_id, end_id)
            with open(save_name, 'wb') as f:
                pickle.dump(anno_info, f, protocol=pickle.HIGHEST_PROTOCOL)
            fid.write('{} {}\n'.format(save_name, label))
    fid_train.close()
    fid_val.close()
    print('done!')