def dump_analysis(allres): print('[rr2] dump analysis') greater1_cxs = allres.greater1_cxs #qcx = greater5_cxs[0] for qcx in greater1_cxs: viz.show_chip(allres, qcx, 'analysis', 'analysis') viz.show_chip(allres, qcx, 'analysis', 'analysis', annotations=False, title_aug=' noanote')
def dump_all_queries(allres): test_cxs = allres.hs.test_sample_cx print('[rr2] dumping all %r queries' % len(test_cxs)) for qcx in test_cxs: viz.show_chip(allres, qcx, 'analysis', subdir='allqueries', annotations=False, title_aug=' noanote') viz.show_chip(allres, qcx, 'analysis', subdir='allqueries')
def dump_missed_top5(allres): #print('\n---DUMPING MISSED TOP 5---') 'Displays the top5 matches for all queries' greater5_cxs = allres.greater5_cxs #qcx = greater5_cxs[0] for qcx in greater5_cxs: viz.show_chip(allres, qcx, 'top5', 'missed_top5') viz.show_chip(allres, qcx, 'gt_matches', 'missed_top5')
def show_chip(back, cx, **kwargs): fnum = FNUMS['chip'] did_exist = df2.plt.fignum_exists(fnum) df2.figure(fnum=fnum, docla=True, doclf=True) INTERACTIVE_CHIPS = True # This should always be True if INTERACTIVE_CHIPS: interact_fn = interact.interact_chip interact_fn(back.hs, cx, fnum=fnum, figtitle='Chip View') else: viz.show_chip(back.hs, cx, fnum=fnum, figtitle='Chip View') if not did_exist: back.layout_figures()
def dump_gt_matches(allres): #print('\n---DUMPING GT MATCHES ---') 'Displays the matches to ground truth for all queries' qcx2_res = allres.qcx2_res for qcx in xrange(0, len(qcx2_res)): viz.show_chip(allres, qcx, 'gt_matches')
nTop = 2 for tx in xrange(nTop): cx2 = res.topN_cxs(hs)[tx] dstimg1, dstimg2, args_, kwargs_ = test_result_coverage( hs, res, cx2, scale_factor) test_find_coverage_score(hs, res) res.show_chipres(hs, cx2, fnum=fnum) df2.set_figtitle('matching viz' + str(tx), incanvas=False) fnum += 1 df2.show_chipmatch2(dstimg1, dstimg2, *args_, fnum=fnum, **kwargs_) df2.set_figtitle('matching coverage' + str(tx)) fnum += 1 df2.imshow(srcimg, fnum=fnum, heatmap=True) df2.set_figtitle('gaussian weights') fnum += 1 df2.imshow(dstimg, fnum=fnum, heatmap=True) df2.set_figtitle('chip coverage map') fnum += 1 df2.imshow(dstimg_thresh, fnum=fnum, heatmap=True) df2.set_figtitle('thresholded chip coverage map') fnum += 1 viz.show_chip(hs, cx, fnum=fnum) df2.set_figtitle('chip', incanvas=False) fnum += 1 exec(viz.df2.present())
def show_query(res, hs, **kwargs): from hsviz import viz print('[res] show_query') viz.show_chip(hs, res=res, **kwargs)
from hscom import helpers from hscom import helpers as util from hsviz import viz import multiprocessing import numpy as np # NOQA if __name__ == '__main__': multiprocessing.freeze_support() # Debugging vars chip_cfg = None #l')=103.7900s cx_list = None kwargs = {} # --- LOAD TABLES --- # args = argparse2.parse_arguments(defaultdb='NAUTS') hs = api.HotSpotter(args) hs.load_tables() hs.update_samples() # --- LOAD CHIPS --- # force_compute = helpers.get_flag('--force', default=False) cc2.load_chips(hs, force_compute=force_compute) cx = helpers.get_arg('--cx', type_=int) if not cx is None: #tau = np.pi * 2 #hs.change_theta(cx, tau / 8) viz.show_chip(hs, cx, draw_kpts=False, fnum=1) viz.show_image(hs, hs.cx2_gx(cx), fnum=2) else: print('usage: feature_compute.py --cx [cx]') exec(viz.df2.present())
multiprocessing.freeze_support() print('[fc2] __main__ = feature_compute2.py') # Read Args cx = helpers.get_arg('--cx', type_=int) delete_features = helpers.get_flag('--delete-features', default=False) nRandKpts = helpers.get_arg('--nRandKpts', type_=int) # Debugging vars feat_cfg = None cx_list = None kwargs = {} # --- LOAD TABLES --- # args = argparse2.parse_arguments(db='NAUTS') hs = api.HotSpotter(args) hs.load_tables() # --- LOAD CHIPS --- # hs.update_samples() hs.load_chips() # Delete features if needed if delete_features: fc2.clear_feature_cache(hs) # --- LOAD FEATURES --- # fc2.load_features(hs) if not cx is None: viz.show_chip(hs, cx, nRandKpts=nRandKpts) else: print( 'usage: feature_compute.py --cx [cx] --nRandKpts [num] [--delete-features]' ) exec(viz.df2.present())