Exemplo n.º 1
0
 def show_matches(qres, ibs, aid, qreq_=None, *args, **kwargs):
     from ibeis.viz import viz_matches
     try:
         return viz_matches.show_matches(ibs, qres, aid, *args, qreq_=qreq_, **kwargs)
     except Exception as ex:
         ut.printex(ex, 'failed in qres.show_matches', keys=['aid', 'qreq_'])
         raise
Exemplo n.º 2
0
 def show_matches(qres, ibs, aid, qreq_=None, *args, **kwargs):
     from ibeis.viz import viz_matches
     try:
         return viz_matches.show_matches(ibs, qres, aid, *args, qreq_=qreq_, **kwargs)
     except Exception as ex:
         ut.printex(ex, 'failed in qres.show_matches', keys=['aid', 'qreq_'])
         raise
Exemplo n.º 3
0
    def examine(self, aid, event=None):
        print(' examining aid %r against the query result' % aid)
        figtitle = 'Examine a specific image against the query'

        #fnum = 510
        fnum = pt.next_fnum()
        fig = pt.figure(fnum=fnum, pnum=(1, 1, 1), doclf=True, docla=True)
        # can cause freezes should be False
        INTERACT_EXAMINE = False
        if INTERACT_EXAMINE:
            #fig = interact_matches.ishow_matches(self.ibs, self.cm, aid, figtitle=figtitle, fnum=fnum)
            fig = self.cm.ishow_matches(self.ibs, aid, figtitle=figtitle, fnum=fnum)
            print('Finished interact')
            # this is only relevant to matplotlib.__version__ < 1.4.2
            #raise Exception(
            #    'BLACK MAGIC: error intentionally included as a workaround that seems'
            #    'to fix a gui hang on certain computers.')
        else:
            viz_matches.show_matches(self.ibs, self.cm, aid, figtitle=figtitle)
            fig.show()
Exemplo n.º 4
0
    def examine(self, aid, event=None):
        print(' examining aid %r against the query result' % aid)
        figtitle = 'Examine a specific image against the query'

        #fnum = 510
        fnum = pt.next_fnum()
        fig = pt.figure(fnum=fnum, pnum=(1, 1, 1), doclf=True, docla=True)
        # can cause freezes should be False
        INTERACT_EXAMINE = False
        if INTERACT_EXAMINE:
            # from ibeis.viz.interact import interact_matches
            #fig = interact_matches.ishow_matches(self.ibs, self.cm, aid, figtitle=figtitle, fnum=fnum)
            fig = self.cm.ishow_matches(self.ibs, aid, figtitle=figtitle, fnum=fnum)
            print('Finished interact')
            # this is only relevant to matplotlib.__version__ < 1.4.2
            #raise Exception(
            #    'BLACK MAGIC: error intentionally included as a workaround that seems'
            #    'to fix a gui hang on certain computers.')
        else:
            viz_matches.show_matches(self.ibs, self.cm, aid, figtitle=figtitle)
            fig.show()
Exemplo n.º 5
0
    def plot_annotationmatch(self, index, draw=True, make_buttons=True):
        self.select_candidate_match(index)
        # Get index relative to the page
        px = index - self.start_index
        pnum = self.pnum_(px)
        # Setup figure
        fnum = self.fnum
        fig = df2.figure(fnum=fnum, pnum=pnum, docla=True, doclf=False)
        fig
        #self.ax = ax = df2.gca()
        # Get viz params
        qres = self.current_qres
        aid1, aid2 = self.current_match_aids
        ibs = self.ibs
        kwargs = self.interactkw
        # Vizualize
        ax = viz_matches.show_matches(ibs,
                                      qres,
                                      aid2,
                                      self_fm=[],
                                      fnum=fnum,
                                      pnum=pnum,
                                      **kwargs)[0]

        divider = df2.ensure_divider(ax)

        name1, name2 = ibs.get_annot_names([aid1, aid2])
        #truth = self.ibs.get_match_truth(aid1, aid2)

        if make_buttons:
            butkw = {
                'divider': divider,
                'callback': self.match_reviewed,
                'index': index,
            }
            if name1 == name2 and not name1.startswith('____'):
                self.append_button(BREAK_MATCH_PREF, **butkw)
            else:
                if not name1.startswith('____'):
                    self.append_button(RENAME2_PREF + name1, **butkw)
                if not name2.startswith('____'):
                    self.append_button(RENAME1_PREF + name2, **butkw)
                if name1.startswith('____') and name2.startswith('____'):
                    self.append_button(NEW_MATCH_PREF, **butkw)

        if draw:
            vh.draw()
Exemplo n.º 6
0
    def plot_annotationmatch(self, index, draw=True, make_buttons=True):
        printDBG('[ishow_qres] starting interaction')
        self.select_candidate_match(index)
        # Get index relative to the page
        px = index - self.start_index
        pnum = self.pnum_(px)
        #fnum = df2.kwargs_fnum(kwargs)
        #printDBG('[inter] starting %s interaction' % type_)
        # Setup figure
        fnum = self.fnum
        printDBG('\n<<<<  BEGIN %s INTERACTION >>>>' % (str('qres').upper()))
        fig = df2.figure(fnum=fnum, pnum=pnum, docla=True, doclf=False)
        printDBG(fig)
        #self.ax = ax = df2.gca()
        # Get viz params
        qres = self.current_qres
        aid1, aid2 = self.current_match_aids
        ibs = self.ibs
        kwargs = self.interactkw
        # Vizualize
        ax = viz_matches.show_matches(ibs, qres, aid2, self_fm=[], fnum=fnum,
                                      pnum=pnum, **kwargs)[0]

        divider = df2.ensure_divider(ax)

        name1, name2 = ibs.get_annot_names([aid1, aid2])
        #truth = self.ibs.get_match_truth(aid1, aid2)

        if make_buttons:
            butkw = {
                'divider': divider,
                'callback': self.match_reviewed,
                'index': index,
            }
            if name1 == name2 and not name1.startswith('____'):
                self.append_button(BREAK_MATCH_PREF, **butkw)
            else:
                if not name1.startswith('____'):
                    self.append_button(RENAME2_PREF + name1, **butkw)
                if not name2.startswith('____'):
                    self.append_button(RENAME1_PREF + name2, **butkw)
                if name1.startswith('____') and name2.startswith('____'):
                    self.append_button(NEW_MATCH_PREF, **butkw)

        if draw:
            vh.draw()