def init_candidates(self, qaid2_qres): self.qaid2_qres = qaid2_qres from ibeis.gui import inspect_gui self.cand_match_list = inspect_gui.get_automatch_candidates( self.qaid2_qres, ranks_lt=self.ranks_lt, directed=False) (qaids, aids, scores, ranks) = self.cand_match_list self.qaids = qaids self.aids = aids self.nCands = len(self.qaids) self.nPages = vt.iceil(self.nCands / self.nPerPage)
def init_candidates(self, qaid2_qres): self.qaid2_qres = qaid2_qres from ibeis.gui import inspect_gui self.cand_match_list = inspect_gui.get_automatch_candidates(self.qaid2_qres, ranks_lt=self.ranks_lt, directed=False) (qaids, aids, scores, ranks) = self.cand_match_list self.qaids = qaids self.aids = aids self.nCands = len(self.qaids) self.nPages = vt.iceil(self.nCands / self.nPerPage)
def __init__( self, gpath_list, nPerPage=4, bboxes_list=None, thetas_list=None, verts_list=None, gid_list=None, nImgs=None, fnum=None, context_option_funcs=None, xlabel_list=None, vizkw=None, **kwargs, ): # TODO: overlay function or draw function using a metadata object print('Creating multi-image interaction') # def __init__(self, img_list, nImgs=None, gid_list=None, aids_list=None, # bboxes_list=None, nPerPage=10,fnum=None): print('[pt] maX ', nPerPage) self.context_option_funcs = context_option_funcs if nImgs is None: nImgs = len(gpath_list) if bboxes_list is None: bboxes_list = [[]] * nImgs if thetas_list is None: thetas_list = [[0] * len(bboxes) for bboxes in bboxes_list] # How many images we are showing and per page self.thetas_list = thetas_list self.bboxes_list = bboxes_list self.xlabel_list = xlabel_list if gid_list is None: self.gid_list = None else: self.gid_list = gid_list self.vizkw = vizkw self.nImgs = nImgs self.nPerPage = min(nPerPage, nImgs) self.current_index = 0 self.page_number = -1 # Initialize iterator over the image paths self.gpath_list = gpath_list # Display the first page self.first_load = True self.scope = [] self.current_pagenum = 0 self.nPages = vt.iceil(self.nImgs / nPerPage) # self.show_page() super(MultiImageInteraction, self).__init__(fnum=fnum, **kwargs)
def testdata_coverage(fname=None): """ testing function """ import vtool as vt # build test data kpts, vecs = vt.dummy.get_testdata_kpts(fname, with_vecs=True) # HACK IN DISTINCTIVENESS if fname is not None: from ibeis.algo.hots import distinctiveness_normalizer cachedir = ut.get_app_resource_dir('ibeis', 'distinctiveness_model') species = 'zebra_plains' dstcnvs_normer = distinctiveness_normalizer.DistinctivnessNormalizer(species, cachedir=cachedir) dstcnvs_normer.load(cachedir) weights = dstcnvs_normer.get_distinctiveness(vecs) else: kpts = np.vstack((kpts, [0, 0, 1, 1, 1, 0])) kpts = np.vstack((kpts, [0.01, 10, 1, 1, 1, 0])) kpts = np.vstack((kpts, [0.94, 11.5, 1, 1, 1, 0])) weights = np.ones(len(kpts)) chipsize = tuple(vt.iceil(vt.get_kpts_image_extent(kpts)).tolist()) return kpts, chipsize, weights
def __init__(self, gpath_list, nPerPage=4, bboxes_list=None, thetas_list=None, verts_list=None, gid_list=None, nImgs=None, fnum=None, context_option_funcs=None, xlabel_list=None, vizkw=None, **kwargs): # TODO: overlay function or draw function using a metadata object print('Creating multi-image interaction') #def __init__(self, img_list, nImgs=None, gid_list=None, aids_list=None, #bboxes_list=None, nPerPage=10,fnum=None): print('[pt] maX ', nPerPage) self.context_option_funcs = context_option_funcs if nImgs is None: nImgs = len(gpath_list) if bboxes_list is None: bboxes_list = [[]] * nImgs if thetas_list is None: thetas_list = [[0] * len(bboxes) for bboxes in bboxes_list] # How many images we are showing and per page self.thetas_list = thetas_list self.bboxes_list = bboxes_list self.xlabel_list = xlabel_list if gid_list is None: self.gid_list = None else: self.gid_list = gid_list self.vizkw = vizkw self.nImgs = nImgs self.nPerPage = min(nPerPage, nImgs) self.current_index = 0 self.page_number = -1 # Initialize iterator over the image paths self.gpath_list = gpath_list # Display the first page self.first_load = True self.scope = [] self.current_pagenum = 0 self.nPages = vt.iceil(self.nImgs / nPerPage) #self.show_page() super(MultiImageInteraction, self).__init__(fnum=fnum, **kwargs)
def testdata_coverage(fname=None): """ testing function """ import vtool as vt # build test data kpts, vecs = vt.dummy.get_testdata_kpts(fname, with_vecs=True) # HACK IN DISTINCTIVENESS if fname is not None: from ibeis.algo.hots import distinctiveness_normalizer cachedir = ut.get_app_resource_dir('ibeis', 'distinctiveness_model') species = 'zebra_plains' dstcnvs_normer = distinctiveness_normalizer.DistinctivnessNormalizer( species, cachedir=cachedir) dstcnvs_normer.load(cachedir) weights = dstcnvs_normer.get_distinctiveness(vecs) else: kpts = np.vstack((kpts, [0, 0, 1, 1, 1, 0])) kpts = np.vstack((kpts, [0.01, 10, 1, 1, 1, 0])) kpts = np.vstack((kpts, [0.94, 11.5, 1, 1, 1, 0])) weights = np.ones(len(kpts)) chipsize = tuple(vt.iceil(vt.get_kpts_image_extent(kpts)).tolist()) return kpts, chipsize, weights