Exemplo n.º 1
0
def run_dataset(data):
    """ Link matches pair-wise matches into tracks. """

    start = timer()
    features, colors, segmentations, instances = tracking.load_features(
        data, data.images())
    features_end = timer()
    matches = tracking.load_matches(data, data.images())
    matches_end = timer()
    tracks_manager = tracking.create_tracks_manager(
        features,
        colors,
        segmentations,
        instances,
        matches,
        data.config,
    )
    tracks_end = timer()
    data.save_tracks_manager(tracks_manager)
    write_report(
        data,
        tracks_manager,
        features_end - start,
        matches_end - features_end,
        tracks_end - matches_end,
    )
Exemplo n.º 2
0
    def run(self, args):
        data = dataset.DataSet(args.dataset)
        queryImages = None
        if (args.localize):
            localizeDir = os.path.join(args.dataset, "localize")
            print("Localization - creating tracks: ")
            queryImages = [x for x in os.listdir(localizeDir)]
            [print(os.path.join(localizeDir, str(x))) for x in queryImages]

        else:
            queryImages = data.images()

        start = timer()
        features, colors = tracking.load_features(data, data.images(
        ))  #TODO: Just get those images for which matches have been computed.
        features_end = timer()
        matches = tracking.load_matches(data, data.images(
        ))  #TODO: Just get those images for which matches have been computed.
        matches_end = timer()
        tracks_manager = tracking.create_tracks_manager(
            features, colors, matches, data.config)
        tracks_end = timer()
        data.save_tracks_manager(tracks_manager)
        end = timer()

        with open(data.profile_log(), 'a') as fout:
            fout.write('create_tracks: {0}\n'.format(end - start))

        self.write_report(data, tracks_manager, features_end - start,
                          matches_end - features_end, tracks_end - matches_end)
Exemplo n.º 3
0
    def run(self, args):
        data = dataset.DataSet(args.dataset)

        start = timer()
        features, colors = tracking.load_features(data, data.images())

        if data.config['feature_use_superpoint']:
            for im in features:
                p_s, f_s, c_s = superpoint.load_features(im)
                if p_s is not None:
                    features[im] = np.concatenate((features[im], p_s), axis=0)
                    colors[im] = np.concatenate((colors[im], c_s), axis=0)

        features_end = timer()
        matches = tracking.load_matches(data, data.images())
        matches_end = timer()
        pairs = filtering.load_pairwise_transforms(data, data.images())
        matches = filtering.triplet_filter(data, data.images(), matches, pairs)
        matches = filtering.loop_filter(data, data.images(), features, matches, pairs)
        filter_end = timer()

        '''
        # debugging
        edges = defaultdict(list)
        for i in data.images():
            for (im1, im2) in matches:
                if i == im1:
                    edges[i].append(im2)
                elif i == im2:
                    edges[i].append(im1)
        for i in sorted(edges.keys()):
            logger.debug("{} has edges with {}".format(i, sorted(edges[i])))
        '''

        graph = tracking.create_tracks_graph(features, colors, matches,
                                             data.config)
        tracks_end = timer()
        data.save_tracks_graph(graph)
        end = timer()

        with open(data.profile_log(), 'a') as fout:
            fout.write('create_tracks: {0}\n'.format(end - start))

        self.write_report(data,
                          graph,
                          features_end - start,
                          matches_end - features_end,
                          filter_end - matches_end,
                          tracks_end - filter_end)
Exemplo n.º 4
0
    def run(self, args):
        data = dataset.DataSet(args.dataset)

        start = timer()
        features, colors = tracking.load_features(data, data.images())
        features_end = timer()
        matches = tracking.load_matches(data, data.images())
        matches_end = timer()
        graph = tracking.create_tracks_graph(features, colors, matches,
                                             data.config)
        tracks_end = timer()
        data.save_tracks_graph(graph)
        end = timer()

        with open(data.profile_log(), 'a') as fout:
            fout.write('create_tracks: {0}\n'.format(end - start))

        self.write_report(data, graph, features_end - start,
                          matches_end - features_end, tracks_end - matches_end)