def main():
    centers = __load_cnnv_centers__()
    cnnvfa = CNNVFeatureAggregation(centers)
    video_lists = get_video_id()
    cnnvfa.start(video_lists)
    cnnvfa.stop()
    cnnvfa.get_results()
    logger.info('all done')
def main():
    video_lists = get_video_id(dtype='labeled-data')
    pos_video_lists = None
    cfs = CNNLVFrameSampler(pos_video_lists)
    cfs.start(video_lists)
    cfs.stop()
    features, mean_feature = cfs.get_results()
    filepath = os.path.join(opt['featurepath'], 'cnnlv-sampling-features.h5')
    fp = h5py.File(filepath, mode='w')
    fp.create_dataset(name='features', data=features)
    fp.create_dataset(name='mean_features', data=mean_feature)
    fp.close()
    logger.info('all done')
Beispiel #3
0
def main():
    unlabeled_keys = get_video_id(dtype='unlabeled-data')

    gt_file = os.path.join(opt['metadatapath'], 'test_groundtruth')
    gnds = load_groundtruth(gt_file)

    featurepath = os.path.join(opt['featurepath'], 'cnnv-agg-features.h5')
    all_features, _ = load_features(featurepath)
    logger.info('load features done')

    map = calc_euclidean_search(all_features, unlabeled_keys, gnds)
    logger.info('map: {:.4f}'.format(map))
    logger.info('all done')
Beispiel #4
0
def main():
    # load features
    features = load_features()
    logger.info('loading features done. #videos: {}'.format(len(features)))

    # load groundtruth and unlabeled-keys
    gnds = load_groundtruth('test_groundtruth')
    unlabeled_keys = get_video_id('unlabeled-data')
    logger.info('load gnds and unlabeled keys done. #query: {}'.format(len(gnds)))

    # calculate map
    map = calc_euclidean_search(features, unlabeled_keys, gnds)
    logger.info('map: {:.4f}'.format(map))

    logger.info('all done')