Example #1
0
        atep_bovw = kernels.compute_ATEP_kernels(feats_path + '/bovwtree/', videonames, traintest_parts, xml_config['features_list'], \
                                                 kernels_path + '/atep-bovw/', kernel_type='intersection', norm='l1', power_norm=False, \
                                                 use_disk=False, nt=args.nt, verbose=args.verbose)

        params = [[[1]], [1], np.linspace(0,1,21), desc_weights_gbl]
        results = classification.classify(atep_bovw, \
                                          class_labels, traintest_parts, params, \
                                          xml_config['features_list'], \
                                          C=C_gbl,
                                          strategy=strategy_gbl,
                                          opt_criterion=opt_criterion,
                                          verbose=args.verbose)
        classification.print_results(results)

    if 'atep-fv' in args.methods:
        tracklet_representation.train_fv_gmms(tracklets_path, videonames, traintest_parts, xml_config['features_list'], intermediates_path, pca_reduction=True, nt=args.nt, verbose=args.verbose)
        tracklet_representation.compute_fv_descriptors_multithread(tracklets_path, intermediates_path, videonames, traintest_parts, xml_config['features_list'], \
                                                                   feats_path + '/fvtree/', \
                                                                   treelike=True, pca_reduction=True, clusters_path=clusters_path, nt=args.nt, verbose=args.verbose)

        atep_fv = kernels.compute_ATEP_kernels(feats_path + '/fvtree/', videonames, traintest_parts, xml_config['features_list'], \
                                               kernels_path + '/atep-fv/', use_disk=False, nt=args.nt, verbose=args.verbose)

        params = [[[1]], [1], np.linspace(0,1,21), desc_weights_gbl]
        results = classification.classify(atep_fv, \
                                          class_labels, traintest_parts, params, \
                                          xml_config['features_list'], \
                                          C=C_gbl,
                                          strategy=strategy_gbl,
                                          opt_criterion=opt_criterion,
                                          verbose=args.verbose)
Example #2
0
        params = [[[1]], [1], np.linspace(0, 1, 21), desc_weights_gbl]
        results = classification.classify(atep_bovw, \
                                          class_labels, traintest_parts, params, \
                                          xml_config['features_list'], \
                                          C=C_gbl,
                                          strategy=strategy_gbl,
                                          opt_criterion=opt_criterion,
                                          verbose=args.verbose)
        classification.print_results(results)

    if 'atep-fv' in args.methods:
        tracklet_representation.train_fv_gmms(tracklets_path,
                                              videonames,
                                              traintest_parts,
                                              xml_config['features_list'],
                                              intermediates_path,
                                              pca_reduction=True,
                                              nt=args.nt,
                                              verbose=args.verbose)
        tracklet_representation.compute_fv_descriptors_multithread(tracklets_path, intermediates_path, videonames, traintest_parts, xml_config['features_list'], \
                                                                   feats_path + '/fvtree/', \
                                                                   treelike=True, pca_reduction=True, clusters_path=clusters_path, nt=args.nt, verbose=args.verbose)

        atep_fv = kernels.compute_ATEP_kernels(feats_path + '/fvtree/', videonames, traintest_parts, xml_config['features_list'], \
                                               kernels_path + '/atep-fv/', use_disk=False, nt=args.nt, verbose=args.verbose)

        params = [[[1]], [1], np.linspace(0, 1, 21), desc_weights_gbl]
        results = classification.classify(atep_fv, \
                                          class_labels, traintest_parts, params, \
                                          xml_config['features_list'], \
                                          C=C_gbl,
Example #3
0
    tracklet_clustering.cluster(tracklets_path,
                                videonames,
                                INSTANCE_ST,
                                INSTANCE_TOTAL,
                                clusters_path,
                                visualize=False)

    tracklet_representation.train_bovw_codebooks(
        tracklets_path,
        videonames,
        traintest_parts,
        INTERNAL_PARAMETERS['feature_types'],
        intermediates_path,
        pca_reduction=False)
    tracklet_representation.train_fv_gmms(tracklets_path, videonames,
                                          traintest_parts,
                                          INTERNAL_PARAMETERS['feature_types'],
                                          intermediates_path)

    tracklet_representation.compute_bovw_descriptors(tracklets_path, intermediates_path, videonames, traintest_parts, \
                                                     INSTANCE_ST, INSTANCE_TOTAL, \
                                                     INTERNAL_PARAMETERS['feature_types'], feats_path + 'bovwtree/', \
                                                     pca_reduction=False, treelike=True, global_repr=True, clusters_path=clusters_path)
    tracklet_representation.compute_fv_descriptors(tracklets_path, intermediates_path, videonames, traintest_parts, \
                                                   INSTANCE_ST, INSTANCE_TOTAL, \
                                                   INTERNAL_PARAMETERS['feature_types'], feats_path + 'fvtree/', \
                                                   treelike=True, global_repr=True, clusters_path=clusters_path)

    c = [
        0.001, 0.01, 0.05, 0.1, 0.5, 1, 5, 10, 50, 100, 500, 1000, 5000, 10000
    ]
Example #4
0
    elif len(sys.argv) < 4:
        INSTANCE_ST = int(sys.argv[1])
        if INSTANCE_ST > len(videonames) - 1:
            INSTANCE_ST = len(videonames) - 1

        INSTANCE_TOTAL = int(sys.argv[2])
        if INSTANCE_ST + int(sys.argv[2]) > len(videonames):
            INSTANCE_TOTAL = len(videonames) - INSTANCE_ST

    print('INSTANCE_ST: %d, INSTANCE_TOTAL: %d' % (INSTANCE_ST, INSTANCE_TOTAL))

    tracklet_extraction.extract(fullvideonames, videonames, INSTANCE_ST, INSTANCE_TOTAL, INTERNAL_PARAMETERS['feature_types'], tracklets_path)
    tracklet_clustering.cluster(tracklets_path, videonames, INSTANCE_ST, INSTANCE_TOTAL, clusters_path, visualize=False)

    tracklet_representation.train_bovw_codebooks(tracklets_path, videonames, traintest_parts, INTERNAL_PARAMETERS['feature_types'], intermediates_path, pca_reduction=False)
    tracklet_representation.train_fv_gmms(tracklets_path, videonames, traintest_parts, INTERNAL_PARAMETERS['feature_types'], intermediates_path)

    tracklet_representation.compute_bovw_descriptors(tracklets_path, intermediates_path, videonames, traintest_parts, \
                                                     INSTANCE_ST, INSTANCE_TOTAL, \
                                                     INTERNAL_PARAMETERS['feature_types'], feats_path + 'bovwtree/', \
                                                     pca_reduction=False, treelike=True, global_repr=True, clusters_path=clusters_path)
    tracklet_representation.compute_fv_descriptors(tracklets_path, intermediates_path, videonames, traintest_parts, \
                                                   INSTANCE_ST, INSTANCE_TOTAL, \
                                                   INTERNAL_PARAMETERS['feature_types'], feats_path + 'fvtree/', \
                                                   treelike=True, global_repr=True, clusters_path=clusters_path)

    c = [0.001, 0.01, 0.05, 0.1, 0.5, 1, 5, 10, 50, 100, 500, 1000, 5000, 10000]

    st_time = time.time()
    results = classification.classify(feats_path + 'bovwtree/', videonames, class_labels, traintest_parts, \
                                      np.linspace(0, 1, 11), INTERNAL_PARAMETERS['feature_types'], \