ibeis.viz package

Submodules

ibeis.viz._grave module

ibeis.viz._grave.make_ibeis_matching_graph(ibs, qaid_list, daids_list, scores_list)[source]
ibeis.viz._grave.make_name_graph_interaction(ibs, nids=None, aids=None, selected_aids=[], with_all=True, invis_edges=None, ensure_edges=None, use_image=True, split_check=None, temp_nids=None, **kwargs)[source]

CommandLine:

python -m ibeis --tf make_name_graph_interaction --db PZ_MTEST             --aids=1,2,3,4,5,6,7,8,9 --show

python -m ibeis --tf make_name_graph_interaction --db LEWA_splits --nids=1 --show --split

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.viz.viz_graph import *  # NOQA
>>> import ibeis
>>> import plottool as pt
>>> exec(ut.execstr_funckw(make_name_graph_interaction), globals())
>>> defaultdb='testdb1'
>>> ibs = ibeis.opendb(defaultdb=defaultdb)
>>> aids = ut.get_argval('--aids', type_=list, default=None)
>>> nids = ut.get_argval('--nids', type_=list, default=ibs.get_valid_nids()[0:5])
>>> nids = None if aids is not None else nids
>>> with_all = not ut.get_argflag('--no-with-all')
>>> make_name_graph_interaction(ibs, nids, aids, with_all=with_all)
>>> #pt.zoom_factory()
>>> ut.show_if_requested()

ibeis.viz.viz_chip module

ibeis.viz.viz_chip.show_chip(ibs, aid, in_image=False, annote=True, title_suffix=u'', weight_label=None, weights=None, config2_=None, **kwargs)[source]

Driver function to show chips

Parameters:
  • ibs (ibeis.IBEISController) –
  • aid (int) – annotation rowid
  • in_image (bool) – displays annotation with the context of its source image
  • annote (bool) – enables overlay annoations
  • title_suffix (str) –
  • weight_label (None) – (default = None)
  • weights (None) – (default = None)
  • config2 (dict) – (default = None)
Kwargs:
enable_chip_title_prefix, nokpts, kpts_subset, kpts, text_color, notitle, draw_lbls, show_aidstr, show_gname, show_name, show_nid, show_exemplar, show_num_gt, show_quality_text, show_yawtext, fnum, title, figtitle, pnum, interpolation, cmap, heatmap, data_colorbar, darken, update, xlabel, redraw_image, ax, alpha, docla, doclf, projection, use_gridspec, pts, ell color (3/4-tuple, ndarray, or str): colors for keypoints

CommandLine:

python -m ibeis.viz.viz_chip --test-show_chip --show --ecc
python -c "import utool as ut; ut.print_auto_docstr('ibeis.viz.viz_chip', 'show_chip')"
python -m ibeis.viz.viz_chip --test-show_chip --show --db NNP_Master3 --aids 14047 --no-annote
python -m ibeis.viz.viz_chip --test-show_chip --show --db NNP_Master3 --aids 14047 --no-annote

python -m ibeis.viz.viz_chip --test-show_chip --show --db PZ_MTEST --aid 1 --bgmethod=cnn
python -m ibeis.viz.viz_chip --test-show_chip --show --db PZ_MTEST --aid 1 --bgmethod=cnn --scale_max=30

Example

>>> # VIZ_TEST
>>> from ibeis.viz.viz_chip import *  # NOQA
>>> import numpy as np
>>> import vtool as vt
>>> in_image = False
>>> ibs, aid_list, kwargs, config2_ = testdata_showchip()
>>> aid = aid_list[0]
>>> if ut.get_argflag('--ecc'):
>>>     kpts = ibs.get_annot_kpts(aid, config2_=config2_)
>>>     weights = ibs.get_annot_fgweights([aid], ensure=True, config2_=config2_)[0]
>>>     kpts = ut.random_sample(kpts[weights > .9], 200, seed=0)
>>>     ecc = vt.get_kpts_eccentricity(kpts)
>>>     scale = 1 / vt.get_scales(kpts)
>>>     s = ecc if config2_.affine_invariance else scale
>>>     colors = pt.scores_to_color(s, cmap_='jet')
>>>     kwargs['color'] = colors
>>>     kwargs['kpts'] = kpts
>>> show_chip(ibs, aid, in_image=in_image, config2_=config2_, **kwargs)
>>> pt.show_if_requested()
ibeis.viz.viz_chip.show_many_chips(ibs, aid_list, config2_=None)[source]

CommandLine:

python -m ibeis.viz.viz_chip --test-show_many_chips
python -m ibeis.viz.viz_chip --test-show_many_chips --show --db NNP_Master3 --aids=13276,14047,14489,14906,10194,10201,12656,10150,11002,15315,7191,13127,15591,12838,13970,14123,14167 --no-annote --dpath figures --save ~/latex/crall-candidacy-2015/figures/challengechips.jpg '--caption=challenging images'

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.viz.viz_chip import *  # NOQA
>>> import numpy as np
>>> in_image = False
>>> ibs, aid_list, kwargs, config2_ = testdata_showchip()
>>> # execute function
>>> show_many_chips(ibs, aid_list, config2_)
>>> ut.show_if_requested()
ibeis.viz.viz_chip.testdata_showchip()[source]

ibeis.viz.viz_graph module

Displays the matching graph of individuals

WindowsDepends:
pip install networkx wget http://www.graphviz.org/pub/graphviz/stable/windows/graphviz-2.38.msi graphviz-2.38.msi
ibeis.viz.viz_graph.augment_graph_mst(ibs, graph)[source]
ibeis.viz.viz_graph.color_by_nids(graph, unique_nids=None, ibs=None, nid2_color_=None)[source]

Colors edges and nodes by nid

ibeis.viz.viz_graph.ensure_graph_nid_labels(graph, unique_nids=None, ibs=None)[source]
ibeis.viz.viz_graph.ensure_names_are_connected(graph, aids_list)[source]
ibeis.viz.viz_graph.ensure_node_images(ibs, graph)[source]
ibeis.viz.viz_graph.get_name_rowid_edges_from_aids(ibs, aid_list)[source]
ibeis.viz.viz_graph.get_name_rowid_edges_from_nids(ibs, nids)[source]
ibeis.viz.viz_graph.make_name_graph_interaction(ibs, nids=None, aids=None, selected_aids=[], with_all=True, invis_edges=None, ensure_edges=None, use_image=True, split_check=None, temp_nids=None, **kwargs)[source]

CommandLine:

python -m ibeis --tf make_name_graph_interaction --db PZ_MTEST             --aids=1,2,3,4,5,6,7,8,9 --show

python -m ibeis --tf make_name_graph_interaction --db LEWA_splits --nids=1 --show --split

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.viz.viz_graph import *  # NOQA
>>> import ibeis
>>> import plottool as pt
>>> exec(ut.execstr_funckw(make_name_graph_interaction), globals())
>>> defaultdb='testdb1'
>>> ibs = ibeis.opendb(defaultdb=defaultdb)
>>> aids = ut.get_argval('--aids', type_=list, default=None)
>>> nids = ut.get_argval('--nids', type_=list, default=ibs.get_valid_nids()[0:5])
>>> nids = None if aids is not None else nids
>>> with_all = not ut.get_argflag('--no-with-all')
>>> make_name_graph_interaction(ibs, nids, aids, with_all=with_all)
>>> #pt.zoom_factory()
>>> ut.show_if_requested()
ibeis.viz.viz_graph.make_netx_graph_from_aid_groups(ibs, aids_list, only_reviewed_matches=True, invis_edges=None, ensure_edges=None, temp_nids=None, allow_directed=False)[source]
Parameters:
  • ibs (ibeis.IBEISController) – image analysis api
  • aids_list (list) –

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.viz.viz_graph import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='testdb1')
>>> aids_list = [[1, 2, 3, 4], [5, 6, 7]]
>>> invis_edges = [(1, 5)]
>>> only_reviewed_matches = True
>>> graph = make_netx_graph_from_aid_groups(ibs, aids_list,
>>>                                         only_reviewed_matches,
>>>                                         invis_edges)
>>> list(nx.connected_components(graph.to_undirected()))
ibeis.viz.viz_graph.make_netx_graph_from_aidpairs(ibs, aids1, aids2, unique_aids=None)[source]
ibeis.viz.viz_graph.viz_netx_chipgraph(ibs, graph, fnum=None, use_image=False, layout=None, zoom=None, prog=u'neato', as_directed=False, augment_graph=True, layoutkw=None, framewidth=3.0, **kwargs)[source]

DEPRICATE or improve

Parameters:
  • ibs (IBEISController) – ibeis controller object
  • graph (nx.DiGraph) –
  • fnum (int) – figure number(default = None)
  • use_image (bool) – (default = False)
  • zoom (float) – (default = 0.4)
Returns:

pos

Return type:

?

CommandLine:

python -m ibeis --tf viz_netx_chipgraph --show
Cand:
ibeis review_tagged_joins –save figures4/mergecase.png –figsize=15,15
–clipwhite –diskshow
ibeis compute_occurrence_groups –save figures4/occurgraph.png
–figsize=40,40 –clipwhite –diskshow

~/code/ibeis/ibeis/algo/preproc/preproc_occurrence.py

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.viz.viz_graph import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='PZ_MTEST')
>>> nid_list = ibs.get_valid_nids()[0:10]
>>> fnum = None
>>> use_image = True
>>> zoom = 0.4
>>> make_name_graph_interaction(ibs, nid_list, prog='neato')
>>> ut.show_if_requested()

ibeis.viz.viz_helpers module

ibeis.viz.viz_helpers.get_aidstrs(aid_list, **kwargs)[source]
ibeis.viz.viz_helpers.get_annot_kpts_in_imgspace(ibs, aid_list, config2_=None, ensure=True)[source]

Transforms keypoints so they are plotable in imagespace

ibeis.viz.viz_helpers.get_annot_text(ibs, aid_list, draw_lbls)[source]
ibeis.viz.viz_helpers.get_annot_texts(ibs, aid_list, **kwargs)[source]

Add each type of text_list to the strings list

Parameters:
  • ibs (IBEISController) – ibeis controller object
  • aid_list (int) – list of annotation ids
Returns:

annotation_text_list

Return type:

list

CommandLine:

python -m ibeis.viz.viz_helpers --test-get_annot_texts

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.viz.viz_helpers import *  # NOQA
>>> import ibeis
>>> import collections
>>> ibs = ibeis.opendb('testdb1')
>>> # Default all kwargs to true
>>> class KwargsProxy(object):
...    def get(self, a, b):
...        return True
>>> kwargs_proxy = KwargsProxy()
>>> aid_list = ibs.get_valid_aids()[::3]
>>> # execute function
>>> annotation_text_list = get_annot_texts(ibs, aid_list, kwargs_proxy=kwargs_proxy)
>>> # verify results
>>> result = ut.list_str(annotation_text_list)
>>> print(result)
[
    'aid1, gname=easy1.JPG, name=____, nid=-1, , nGt=0, quality=UNKNOWN, yaw=None',
    'aid4, gname=hard1.JPG, name=____, nid=-4, , nGt=0, quality=UNKNOWN, yaw=None',
    'aid7, gname=jeff.png, name=jeff, nid=3, EX, nGt=0, quality=UNKNOWN, yaw=None',
    'aid10, gname=occl2.JPG, name=occl, nid=5, EX, nGt=0, quality=UNKNOWN, yaw=None',
    'aid13, gname=zebra.jpg, name=zebra, nid=7, EX, nGt=0, quality=UNKNOWN, yaw=None',
]
ibeis.viz.viz_helpers.get_bbox_centers(bbox_list)[source]
ibeis.viz.viz_helpers.get_bboxes(ibs, aid_list, offset_list=None)[source]
ibeis.viz.viz_helpers.get_chips(ibs, aid_list, in_image=False, config2_=None)[source]
ibeis.viz.viz_helpers.get_image_titles(ibs, gid_list)[source]
ibeis.viz.viz_helpers.get_kpts(ibs, aid_list, in_image=False, config2_=None, ensure=True, kpts_subset=None, kpts=None)[source]
ibeis.viz.viz_helpers.get_nidstrs(nid_list, **kwargs)[source]
ibeis.viz.viz_helpers.get_query_text(ibs, cm, aid2, truth, **kwargs)[source]

returns title based on the query chip and result

Parameters:
  • ibs (IBEISController) – ibeis controller object
  • cm (ChipMatch) – object of feature correspondences and scores
  • aid2 (int) – annotation id
  • truth (int) – 0, 1, 2
Kwargs:
qaid, score, rawscore, aid2_raw_rank, show_truth, name_score, name_rank, show_name_score, show_name_rank, show_timedelta
Returns:query_text
Return type:str

CommandLine:

python -m ibeis.viz.viz_helpers --exec-get_query_text

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.viz.viz_helpers import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='testdb1')
>>> cm = ibs.query_chips([1], [2, 3, 4, 5], cfgdict=dict())[0]
>>> aid2 = '?'
>>> truth = '?'
>>> query_text = get_query_text(ibs, cm, aid2, truth)
>>> result = ('query_text = %s' % (str(query_text),))
>>> print(result)
ibeis.viz.viz_helpers.get_timedelta_str(ibs, aid1, aid2)[source]
Parameters:
  • ibs (IBEISController) – ibeis controller object
  • aid1 (int) – annotation id
  • aid2 (int) – annotation id
Returns:

timedelta_str

Return type:

str

CommandLine:

python -m ibeis.viz.viz_helpers --test-get_timedelta_str

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.viz.viz_helpers import *  # NOQA
>>> import ibeis
>>> # build test data
>>> ibs = ibeis.opendb('testdb1')
>>> aid1 = 1
>>> aid2 = 8
>>> # execute function
>>> timedelta_str = get_timedelta_str(ibs, aid1, aid2)
>>> # verify results
>>> result = str(timedelta_str)
>>> print(result)
td(+2:28:22)

td(02:28:22)

ibeis.viz.viz_helpers.get_truth_color(truth, base255=False, lighten_amount=None)[source]
ibeis.viz.viz_helpers.get_truth_text(ibs, truth)[source]
ibeis.viz.viz_helpers.get_vsstr(qaid, aid)[source]
ibeis.viz.viz_helpers.is_unknown(ibs, nid_list)[source]
ibeis.viz.viz_helpers.kp_info(kp)[source]
ibeis.viz.viz_helpers.register_FNUMS(FNUMS_)[source]
ibeis.viz.viz_helpers.show_keypoint_gradient_orientations(ibs, aid, fx, fnum=None, pnum=None, config2_=None)[source]

ibeis.viz.viz_hough module

ibeis.viz.viz_hough.show_hough_image(ibs, gid, species=None, fnum=None, **kwargs)[source]
ibeis.viz.viz_hough.show_probability_chip(ibs, aid, species=None, fnum=None, config2_=None, blend=False, **kwargs)[source]

TODO: allow species override in controller

CommandLine:

python -m ibeis.viz.viz_hough --exec-show_probability_chip --cnn --show
python -m ibeis.viz.viz_hough --exec-show_probability_chip --cnn --show --db PZ_Master1
python -m ibeis.viz.viz_hough --exec-show_probability_chip --cnn --show --db PZ_Master1 --aid 9970

Example

>>> # SCRIPT
>>> from ibeis.viz.viz_hough import *  # NOQA
>>> import ibeis
>>> from ibeis.viz import viz_chip
>>> ibs, aid_list, kwargs, config2_ = viz_chip.testdata_showchip()
>>> fnum = 1
>>> species = None
>>> aid = aid_list[0]
>>> fig, ax = show_probability_chip(ibs, aid, species, fnum, blend=True, **kwargs)
>>> ut.show_if_requested()

ibeis.viz.viz_image module

ibeis.viz.viz_image.draw_image_overlay(ibs, ax, gid, sel_aids, draw_lbls=True, annote=True)[source]
ibeis.viz.viz_image.drive_test_script(ibs)[source]

Test script where we drive around and take pictures of animals both in a given database and not in a given databse to make sure the system works.

CommandLine:

python -m ibeis.viz.viz_image --test-drive_test_script
python -m ibeis.viz.viz_image --test-drive_test_script --db PZ_MTEST --show
python -m ibeis.viz.viz_image --test-drive_test_script --db GIR_Tanya --show
python -m ibeis.viz.viz_image --test-drive_test_script --db GIR_Master0 --show
python -m ibeis.viz.viz_image --test-drive_test_script --db PZ_Master0 --show
python -m ibeis.viz.viz_image --test-drive_test_script --db PZ_FlankHack --show

python -m ibeis.viz.viz_image --test-drive_test_script --db PZ_FlankHack --show
python -m ibeis.viz.viz_image --test-drive_test_script --dbdir /raid/work2/Turk/GIR_Master --show

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.viz.viz_image import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb()
>>> drive_test_script(ibs)
ibeis.viz.viz_image.get_annot_annotations(ibs, aid_list, sel_aids=[], draw_lbls=True)[source]
ibeis.viz.viz_image.show_image(ibs, gid, sel_aids=[], fnum=None, annote=True, draw_lbls=True, notitle=False, rich_title=False, pnum=(1, 1, 1), **kwargs)[source]

Driver function to show images

Parameters:
  • ibs (IBEISController) – ibeis controller object
  • gid (int) – image row id
  • sel_aids (list) –
  • fnum (int) – figure number
  • annote (bool) –
  • draw_lbls (bool) –
Returns:

(fig, ax)

Return type:

tuple

CommandLine:

python -m ibeis.viz.viz_image --test-show_image --show
python -m ibeis.viz.viz_image --test-show_image --show --db GZ_ALL
python -m ibeis.viz.viz_image --test-show_image --show --db GZ_ALL --gid 100
python -m ibeis.viz.viz_image --test-show_image --show --db PZ_MTEST --aid 10

python -m ibeis.viz.viz_image --test-show_image --show --db PZ_MTEST --aid 91 --no-annot --rich-title
python -m ibeis.viz.viz_image --test-show_image --show --db GIR_Tanya --aid 1 --no-annot --rich-title

Example

>>> # SLOW_DOCTEST
>>> # VIZ_TEST
>>> from ibeis.viz.viz_image import *  # NOQA
>>> import ibeis
>>> # build test data
>>> ibs = ibeis.opendb(ut.get_argval('--db', str, 'testdb1'))
>>> #gid = ibs.get_valid_gids()[0]
>>> gid = ut.get_argval('--gid', int, 1)
>>> aid = ut.get_argval('--aid', int, None)
>>> if aid is not None:
>>>    gid = ibs.get_annot_gids(aid)
>>> sel_aids = []
>>> fnum = None
>>> annote = not ut.get_argflag('--no-annot')
>>> rich_title = ut.get_argflag('--rich-title')
>>> draw_lbls = True
>>> # execute function
>>> (fig, ax) = show_image(ibs, gid, sel_aids, fnum, annote, draw_lbls, rich_title)
>>> pt.show_if_requested()
ibeis.viz.viz_image.show_multi_images(ibs, gid_list, fnum=None, **kwargs)[source]
Parameters:
  • ibs (IBEISController) – ibeis controller object
  • gid_list (list) –
  • fnum (int) – figure number(default = None)

CommandLine:

python -m ibeis.viz.viz_image --test-show_multi_images --db NNP_Master3 --gids=7409,7448,4670,7497,7496,7464,7446,7442 --show
python -m ibeis.viz.viz_image --test-show_multi_images --db NNP_Master3 --gids=1,2,3 --show

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.viz.viz_image import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='testdb1')
>>> gid_list = ut.get_argval('--gids', list, default=[1, 2])
>>> fnum = None
>>> result = show_multi_images(ibs, gid_list, fnum, draw_lbls=False, notitle=True, sel_aids='all')
>>> print(result)
>>> ut.show_if_requested()

ibeis.viz.viz_matches module

ibeis.viz.viz_matches.annotate_matches2(ibs, aid1, aid2, fm, fs, offset1=(0, 0), offset2=(0, 0), xywh2=None, xywh1=None, qreq_=None, **kwargs)[source]

TODO: use this as the main function.

ibeis.viz.viz_matches.annotate_matches3(ibs, aid_list, bbox_list, offset_list, name_fm_list, name_fs_list, qreq_=None, **kwargs)[source]

TODO: use this as the main function.

ibeis.viz.viz_matches.get_data_annot_pair_info(ibs, aid_list, qreq_, draw_fmatches, scale_down=False, kpts2_list=None)[source]
ibeis.viz.viz_matches.get_multitruth(ibs, aid_list)[source]
ibeis.viz.viz_matches.get_query_annot_pair_info(ibs, qaid, qreq_, draw_fmatches, kpts1=None)[source]
ibeis.viz.viz_matches.show_matches(ibs, cm, aid2, sel_fm=[], qreq_=None, **kwargs)[source]

DEPRICATE

shows single annotated match result.

Parameters:
  • ibs (IBEISController) –
  • cm (ChipMatch) – object of feature correspondences and scores
  • aid2 (int) – result annotation id
  • sel_fm (list) – selected features match indices
Kwargs:
vert (bool)
Returns:(ax, xywh1, xywh2)
Return type:tuple
ibeis.viz.viz_matches.show_matches2(ibs, aid1, aid2, fm=None, fs=None, fm_norm=None, sel_fm=[], H1=None, H2=None, qreq_=None, **kwargs)[source]

TODO: DEPRICATE and use special case of show_name_matches Integrate ChipMatch

Used in:
Found 1 line(s) in ‘/home/joncrall/code/ibeis_cnn/ibeis_cnn/ingest_ibeis.py’: ingest_ibeis.py : 827 | >>> ibeis.viz.viz_matches.show_matches2(ibs, aid1, aid2, fm=None, kpts1=kpts1, kpts2=kpts2) ———————- Found 4 line(s) in ‘/home/joncrall/code/ibeis/ibeis/viz/viz_matches.py’: viz_matches.py : 423 |def show_matches2(ibs, aid1, aid2, fm=None, fs=None, fm_norm=None, sel_fm=[], viz_matches.py : 430 | python -m ibeis.viz.viz_matches –exec-show_matches2 –show viz_matches.py : 431 | python -m ibeis –tf ChipMatch.ishow_single_annotmatch show_matches2 –show viz_matches.py : 515 | return show_matches2(ibs, aid1, aid2, fm, fs, qreq_=qreq_, **kwargs) ———————- Found 1 line(s) in ‘/home/joncrall/code/ibeis/ibeis/viz/interact/interact_matches.py’: interact_matches.py : 372 | tup = viz.viz_matches.show_matches2(ibs, self.qaid, self.daid, ———————- Found 1 line(s) in ‘/home/joncrall/code/ibeis/ibeis/algo/hots/vsone_pipeline.py’: vsone_pipeline.py : 1339 | viz_matches.show_matches2(ibs, qaid, daid, fm=fm, fs=fs, fm_norm=fm_norm, ori=True, ———————- Found 2 line(s) in ‘/home/joncrall/code/ibeis/ibeis/algo/hots/chip_match.py’: chip_match.py : 204 | viz_matches.show_matches2(qreq_.ibs, cm.qaid, daid, qreq_=qreq_, chip_match.py : 219 | ibeis.viz.viz_matches.show_matches2 ———————- Found 1 line(s) in ‘/home/joncrall/code/ibeis/ibeis/algo/hots/scoring.py’: scoring.py : 562 | viz.viz_matches.show_matches2(qreq_.ibs, qaid, daid, fm, fs,

CommandLine:

python -m ibeis.viz.viz_matches --exec-show_matches2 --show
python -m ibeis --tf ChipMatch.ishow_single_annotmatch show_matches2 --show

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.algo.hots.chip_match import *  # NOQA
>>> import ibeis
>>> cm, qreq_ = ibeis.testdata_cm(defaultdb='PZ_MTEST', default_qaids=[18])
>>> cm.score_nsum(qreq_)
>>> daid = cm.get_top_aids()[0]
>>> cm.show_single_annotmatch(qreq_, daid)
>>> ut.show_if_requested()
ibeis.viz.viz_matches.show_multichip_match(rchip1, rchip2_list, kpts1, kpts2_list, fm_list, fs_list, featflag_list, fnum=None, pnum=None, **kwargs)[source]

move to df2 rchip = rchip1 H = H1 = None target_wh = None

ibeis.viz.viz_matches.show_name_matches(ibs, qaid, name_daid_list, name_fm_list, name_fs_list, name_H1_list, name_featflag_list, qreq_=None, **kwargs)[source]

Called from chip_match.py

Parameters:
  • ibs (IBEISController) – ibeis controller object
  • qaid (int) – query annotation id
  • name_daid_list (list) –
  • name_fm_list (list) –
  • name_fs_list (list) –
  • name_H1_list (list) –
  • name_featflag_list (list) –
  • qreq (QueryRequest) – query request object with hyper-parameters(default = None)
Kwargs:
draw_fmatches, name_rank, fnum, pnum, colorbar_, nonvote_mode, fastmode, show_matches, fs, fm_norm, lbl1, lbl2, rect, draw_border, cmap, H1, H2, scale_factor1, scale_factor2, draw_pts, draw_ell, draw_lines, show_nMatches, all_kpts, in_image, show_query, draw_lbl, name_annot_scores, score, rawscore, aid2_raw_rank, show_name, show_nid, show_aid, show_annot_score, show_truth, name_score, show_name_score, show_name_rank, show_timedelta

CommandLine:

python -m ibeis.viz.viz_matches --exec-show_name_matches
python -m ibeis.viz.viz_matches --test-show_name_matches --show

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.viz.viz_matches import *  # NOQA
>>> from ibeis.algo.hots import chip_match
>>> from ibeis.algo.hots import name_scoring
>>> import vtool as vt
>>> from ibeis.algo.hots import _pipeline_helpers as plh  # NOQA
>>> import numpy as np
>>> func = chip_match.ChipMatch.show_single_namematch
>>> sourcecode = ut.get_func_sourcecode(func, stripdef=True, stripret=True,
>>>                                     strip_docstr=True)
>>> setup = ut.regex_replace('viz_matches.show_name_matches', '#', sourcecode)
>>> homog = False
>>> print(ut.indent(setup, '>>> '))
>>> ibs, qreq_, cm_list = plh.testdata_post_sver('PZ_MTEST', qaid_list=[1])
>>> cm = cm_list[0]
>>> cm.score_nsum(qreq_)
>>> dnid = ibs.get_annot_nids(cm.qaid)
>>> # +--- COPIED SECTION
>>> locals_ = locals()
>>> var_list = ut.exec_func_src(
>>>     func, locals_=locals_,
>>>     sentinal='name_annot_scores = cm.annot_score_list.take(sorted_groupxs')
>>> exec(ut.execstr_dict(var_list))
>>> # L___ COPIED SECTION
>>> kwargs = {}
>>> show_name_matches(ibs, qaid, name_daid_list, name_fm_list,
>>>                   name_fs_list, name_h1_list, name_featflag_list,
>>>                   qreq_=qreq_, **kwargs)
>>> ut.quit_if_noshow()
>>> ut.show_if_requested()

ibeis.viz.viz_name module

ibeis.viz.viz_name.show_multiple_chips(ibs, aid_list, in_image=True, fnum=0, sel_aids=[], subtitle=u'', annote=False, **kwargs)[source]

CommandLine:

python -m ibeis.viz.viz_name --test-show_multiple_chips --show --no-inimage
python -m ibeis.viz.viz_name --test-show_multiple_chips --show --db NNP_Master3 --aids=6435,9861,137,6563,9167,12547,9332,12598,13285 --no-inimage --notitle
python -m ibeis.viz.viz_name --test-show_multiple_chips --show --db NNP_Master3 --aids=137,6563,12547,9332,12598,13285 --no-inimage --notitle --adjust=.05
python -m ibeis.viz.viz_name --test-show_multiple_chips --show --db NNP_Master3 --aids=6563,9332,13285,12598 --no-inimage --notitle --adjust=.05 --rc=1,4
python -m ibeis.viz.viz_name --test-show_multiple_chips --show --db PZ_Master0 --aids=1288 --no-inimage --notitle --adjust=.05
python -m ibeis.viz.viz_name --test-show_multiple_chips --show --db PZ_Master0 --aids=4020,4839 --no-inimage --notitle --adjust=.05

python -m ibeis.viz.viz_name --test-show_multiple_chips --db NNP_Master3 --aids=6524,6540,6571,6751 --no-inimage --notitle --adjust=.05 --diskshow

python -m ibeis.viz.viz_name --test-show_multiple_chips --db PZ_MTEST -a default:index=0:4 --show
--aids=1 --doboth --show --no-inimage

python -m ibeis.viz.viz_name --test-show_multiple_chips --db PZ_MTEST --aids=1 --doboth --show --no-inimage
python -m ibeis.viz.viz_name --test-show_multiple_chips --db PZ_MTEST --aids=1 --doboth --rc=2,1 --show --no-inimage
python -m ibeis.viz.viz_name --test-show_multiple_chips --db PZ_MTEST --aids=1 --doboth --rc=2,1 --show --notitle --trydrawline --no-draw_lbls
python -m ibeis.viz.viz_name --test-show_multiple_chips --db PZ_MTEST --aids=1,2 --doboth  --show --notitle --trydrawline

python -m ibeis.viz.viz_name --test-show_multiple_chips --db PZ_MTEST --aids=1,2,3,4,5 --doboth --rc=2,5 --show --chrlbl --trydrawline --qualtitle --no-figtitle --notitle
--doboth
--doboth --show

python -m ibeis.viz.viz_name --test-show_multiple_chips --db NNP_Master3 --aids=15419 --doboth --rc=2,1 --show --notitle --trydrawline --no-draw_lbls

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.viz.viz_name import *  # NOQA
>>> import ibeis
>>> ibs, aid_list, in_image = testdata_multichips()
>>> fnum = 0
>>> sel_aids = []
>>> subtitle = ''
>>> annote = False
>>> fig = show_multiple_chips(ibs, aid_list, in_image, fnum, sel_aids, subtitle, annote)
>>> ut.quit_if_noshow()
>>> fig.canvas.draw()
>>> ut.show_if_requested()
ibeis.viz.viz_name.show_name(ibs, nid, in_image=True, fnum=0, sel_aids=[], subtitle=u'', annote=False, aid_list=None, index_list=None, **kwargs)[source]
Parameters:
  • ibs (IBEISController) – ibeis controller object
  • nid
  • in_image (bool) –
  • fnum (int) – figure number
  • sel_aids (list) –
  • subtitle (str) –
  • annote (bool) –

CommandLine:

python -m ibeis.viz.viz_name --test-show_name --dpath ~/latex/crall-candidacy-2015 --save 'figures/{name}.jpg' --no-figtitle --notitle --db NNP_Master3 --figsize=9,4 --clipwhite --dpi=180 --adjust=.05 --index_list=[0,1,2,3] --rc=2,4 --append temp_out_figure.tex --name=IBEIS_PZ_0739 --no-draw_lbls --doboth --no-inimage  --diskshow

python -m ibeis.viz.viz_name --test-show_name --no-figtitle --notitle --db NNP_Master3 --figsize=9,4 --clipwhite --dpi=180 --adjust=.05 --index_list=[0,1,2,3] --rc=2,4 --append temp_out_figure.tex --name=IBEIS_PZ_0739 --no-draw_lbls --doboth --no-inimage  --show

python -m ibeis.viz.viz_name --test-show_name --show

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.viz.viz_name import *  # NOQA
>>> ibs, nid, in_image, index_list = testdata_showname()
>>> fnum = 0
>>> sel_aids = []
>>> subtitle = ''
>>> annote = False
>>> # execute function
>>> show_name(ibs, nid, in_image, fnum, sel_aids, subtitle, annote, index_list=index_list)
>>> ut.show_if_requested()
ibeis.viz.viz_name.show_name_of(ibs, aid, **kwargs)[source]
ibeis.viz.viz_name.testdata_multichips()[source]
ibeis.viz.viz_name.testdata_showname()[source]

ibeis.viz.viz_nearest_descriptors module

ibeis.viz.viz_nearest_descriptors.get_annotfeat_nn_index(ibs, qaid, qfx, qreq_=None)[source]
ibeis.viz.viz_nearest_descriptors.show_nearest_descriptors(ibs, qaid, qfx, fnum=None, stride=5, qreq_=None, **kwargs)[source]
Parameters:
  • ibs (ibeis.IBEISController) – image analysis api
  • qaid (int) – query annotation id
  • qfx (int) – query feature index
  • fnum (int) – figure number
  • stride (int) –
  • consecutive_distance_compare (bool) –

CommandLine:

# Find a good match to inspect
python -m ibeis.viz.interact.interact_matches --test-testdata_match_interact --show --db PZ_MTEST --qaid 3

# Now inspect it
python -m ibeis.viz.viz_nearest_descriptors --test-show_nearest_descriptors --show --db PZ_MTEST --qaid 3 --qfx 879
python -m ibeis.viz.viz_nearest_descriptors --test-show_nearest_descriptors --show
python -m ibeis.viz.viz_nearest_descriptors --test-show_nearest_descriptors --db PZ_MTEST --qaid 3 --qfx 879 --diskshow --save foo.png --dpi=256
SeeAlso:
plottool.viz_featrow ~/code/plottool/plottool/viz_featrow.py

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.viz.viz_nearest_descriptors import *  # NOQA
>>> import ibeis
>>> # build test data
>>> qreq_ = ibeis.testdata_qreq_()
>>> ibs = ibeis.opendb('PZ_MTEST')
>>> qaid = qreq_.qaids[0]
>>> qfx = ut.get_argval('--qfx', type_=None, default=879)
>>> fnum = None
>>> stride = 5
>>> # execute function
>>> skip = False
>>> result = show_nearest_descriptors(ibs, qaid, qfx, fnum, stride,
>>>                                   draw_chip=True,
>>>                                   draw_warped=True,
>>>                                   draw_unwarped=False,
>>>                                   draw_desc=False, qreq_=qreq_)
>>> # verify results
>>> print(result)
>>> pt.show_if_requested()
ibeis.viz.viz_nearest_descriptors.show_top_featmatches(qreq_, cm_list)[source]
Parameters:
  • qreq (ibeis.QueryRequest) – query request object with hyper-parameters
  • cm_list (list) –
SeeAlso:

python -m ibeis –tf TestResult.draw_feat_scoresep –show –db PZ_MTEST -t best:lnbnn_on=True,lnbnn_normalizer=normlnbnn-test -a default –sephack

python -m ibeis –tf TestResult.draw_feat_scoresep –show –db PZ_Master1 -t best:lnbnn_on=True -a timectrl –sephack python -m ibeis –tf TestResult.draw_feat_scoresep –show –db PZ_MTEST -t best:lnbnn_on=True -a default:size=30 –sephack python -m ibeis –tf TestResult.draw_feat_scoresep –show –db PZ_MTEST -t best:K=1,Knorm=5,lnbnn_on=True -a default:size=30 –sephack python -m ibeis –tf TestResult.draw_feat_scoresep –show –db PZ_MTEST -t best:K=1,Knorm=3,lnbnn_on=True -a default –sephack

CommandLine:

python -m ibeis.viz.viz_nearest_descriptors --exec-show_top_featmatches --show

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.viz.viz_nearest_descriptors import *  # NOQA
>>> import ibeis
>>> cm_list, qreq_ = ibeis.testdata_cmlist(defaultdb='PZ_MTEST',
>>>                                        a=['default:has_none=mother,size=30'])
>>> show_top_featmatches(qreq_, cm_list)
>>> ut.quit_if_noshow()
>>> import plottool as pt
>>> ut.show_if_requested()

ibeis.viz.viz_other module

ibeis.viz.viz_other.chip_montage(ibs, qaids, config=None)[source]

CommandLine:

python -m ibeis.viz.viz_other chip_montage --show --db PZ_MTEST
python -m ibeis.viz.viz_other chip_montage --show --db GZ_ALL

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.viz.viz_other import *  # NOQA
>>> defaltdb = 'seaturtles'
>>> import ibeis
>>> a = ['default']
>>> ibs = ibeis.opendb(defaultdb=defaltdb)
>>> ibs, qaids, daids = ibeis.testdata_expanded_aids(ibs=ibs, a=a)
>>> config = None
>>> chip_montage(ibs, qaids, config)
>>> ut.quit_if_noshow()
>>> import plottool as pt
>>> ut.show_if_requested()
ibeis.viz.viz_other.image_montage(ibs, gids, config=None)[source]

CommandLine:

python -m ibeis.viz.viz_other image_montage --show --db PZ_Master1
python -m ibeis.viz.viz_other image_montage --show --db GZ_ALL

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.viz.viz_other import *  # NOQA
>>> defaltdb = 'seaturtles'
>>> import ibeis
>>> a = ['default']
>>> ibs = ibeis.opendb(defaultdb=defaltdb)
>>> ibs, qaids, daids = ibeis.testdata_expanded_aids(ibs=ibs, a=a)
>>> config = None
>>> gids = ibs.get_annot_gids(qaids[0:1000])
>>> image_montage(ibs, gids, config)
>>> ut.quit_if_noshow()
>>> import plottool as pt
>>> ut.show_if_requested()

ibeis.viz.viz_qres module

ibeis.viz.viz_qres.show_qres(ibs, cm, qreq_=None, **kwargs)[source]

Display Query Result Logic Defaults to: query chip, groundtruth matches, and top matches

Parameters:
  • ibs (ibeis.IBEISController) – ibeis controller object
  • cm (ibeis.ChipMatch) – object of feature correspondences and scores
Kwargs:

in_image (bool) show result in image view if True else chip view annot_mode (int):

if annot_mode == 0, then draw lines and ellipse elif annot_mode == 1, then dont draw lines or ellipse elif annot_mode == 2, then draw only lines

See: viz_matches.show_name_matches, viz_helpers.get_query_text

Returns:fig
Return type:mpl.Figure

CommandLine:

./main.py --query 1 -y --db PZ_MTEST --noshow-qtres

python -m ibeis.viz.viz_qres --test-show_qres --show

python -m ibeis.viz.viz_qres --test-show_qres --show --top-aids=10 --db=PZ_MTEST --sidebyside --annot_mode=0 --notitle --no-viz_name_score --qaids=5 --max_nCols=2 --adjust=.01,.01,.01

python -m ibeis.viz.viz_qres --test-show_qres --show --top-aids=10 --db=PZ_MTEST --sidebyside --annot_mode=0 --notitle --no-viz_name_score --qaids=5 --max_nCols=2 --adjust=.01,.01,.01

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.viz.viz_qres import *  # NOQA
>>> import plottool as pt
>>> ibs, cm, qreq_, kwargs = testdata_show_qres()
>>> # execute function
>>> fig = show_qres(ibs, cm, show_query=False, qreq_=qreq_, **kwargs)
>>> # verify results
>>> #fig.show()
>>> pt.show_if_requested()
ibeis.viz.viz_qres.show_qres_analysis(ibs, cm, qreq_=None, **kwargs)[source]

Wrapper around show_qres.

KWARGS:
aid_list - show matches against aid_list (default top 3)
Parameters:
  • ibs (IBEISController) – ibeis controller object
  • cm (ChipMatch) – object of feature correspondences and scores
  • qreq (QueryRequest) – query request object with hyper-parameters(default = None)
Kwargs:
N, show_gt, show_query, aid_list, figtitle, viz_name_score, viz_name_score

CommandLine:

python -m ibeis.viz.viz_qres --exec-show_qres_analysis --show

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.viz.viz_qres import *  # NOQA
>>> import ibeis
>>> species = ibeis.const.TEST_SPECIES.ZEB_PLAIN
>>> ibs = ibeis.opendb(defaultdb='PZ_MTEST')
>>> daids = ibs.get_valid_aids(species=species)
>>> qaids = ibs.get_valid_aids(species=species)
>>> qres_list, qreq_ = ibs.query_chips(
>>>     [1], [2, 3, 4, 5, 6, 7, 8, 9],
>>>     cfgdict=dict(), return_request=True)
>>> cm = qres_list[0]
>>> kwargs = dict(show_query=False, viz_name_score=True,
>>>               show_timedelta=True, N=3, show_gf=True)
>>> show_qres_analysis(ibs, cm, qreq_, **kwargs)
>>> ut.show_if_requested()
ibeis.viz.viz_qres.show_qres_top(ibs, cm, qreq_=None, **kwargs)[source]

Wrapper around show_qres.

ibeis.viz.viz_qres.testdata_show_qres()[source]

ibeis.viz.viz_sver module

ibeis.viz.viz_sver.show_sver(ibs, aid1, aid2, chipmatch_FILT=None, aid2_svtup=None, config2_=None, **kwargs)[source]

Compiles IBEIS information and sends it to plottool

CommandLine:

python -m ibeis.viz.viz_sver --test-show_sver --show

Example

>>> # SLOW_DOCTEST
>>> from ibeis.viz.viz_sver import *   # NOQA
>>> import ibeis
>>> import utool as ut
>>> ibs = ibeis.opendb('testdb1')
>>> aid_list = ibs.get_valid_aids()
>>> aid1, aid2 = aid_list[0:2]
>>> chipmatch_FILT = None
>>> aid2_svtup = None
>>> kwargs = {}
>>> show_sver(ibs, aid1, aid2)
>>> ut.quit_if_noshow()
>>> import plottool as pt
>>> exec(pt.present())

ibeis.viz.viz_tmp module

Displays the matching graph of individuals

WindowsDepends:
pip install networkx wget http://www.graphviz.org/pub/graphviz/stable/windows/graphviz-2.38.msi graphviz-2.38.msi
class ibeis.viz.viz_tmp.AnnotGraphInteraction(ibs, aids=None, selected_aids=[], use_image=True, nids=None, temp_nids=None)[source]

Bases: plottool.abstract_interaction.AbstractInteraction

confirm(event)[source]
highlight_aid(aid, color=None)[source]
make_hud()[source]

Creates heads up display

make_inference(event)[source]
mark_pair_truth(truth)[source]
on_click_inside(*args, **kwargs)
on_key_press(event)[source]
plot(fnum, pnum)[source]
show_selected(event)[source]
toggle_images()[source]
toggle_selected_aid(aid)[source]
unselect_all(event)[source]
update_netx_graph()[source]
ibeis.viz.viz_tmp.augment_graph_mst(ibs, graph)[source]
ibeis.viz.viz_tmp.color_by_nids(graph, unique_nids=None, ibs=None, nid2_color_=None)[source]

Colors edges and nodes by nid

ibeis.viz.viz_tmp.ensure_graph_nid_labels(graph, unique_nids=None, ibs=None)[source]
ibeis.viz.viz_tmp.ensure_names_are_connected(graph, aids_list)[source]
ibeis.viz.viz_tmp.ensure_node_images(ibs, graph)[source]
ibeis.viz.viz_tmp.get_name_rowid_edges_from_aids(ibs, aid_list)[source]
ibeis.viz.viz_tmp.get_name_rowid_edges_from_nids(ibs, nids)[source]
ibeis.viz.viz_tmp.make_name_graph_interaction(ibs, nids=None, aids=None, selected_aids=[], with_all=True, invis_edges=None, ensure_edges=None, use_image=True, temp_nids=None, **kwargs)[source]

CommandLine:

python -m ibeis --tf make_name_graph_interaction --db PZ_MTEST             --aids=1,2,3,4,5,6,7,8,9 --show

python -m ibeis --tf make_name_graph_interaction --db LEWA_splits --nids=1 --show --split

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.viz.viz_graph import *  # NOQA
>>> import ibeis
>>> import plottool as pt
>>> exec(ut.execstr_funckw(make_name_graph_interaction), globals())
>>> defaultdb='testdb1'
>>> ibs = ibeis.opendb(defaultdb=defaultdb)
>>> aids = ut.get_argval('--aids', type_=list, default=None)
>>> nids = ut.get_argval('--nids', type_=list, default=ibs.get_valid_nids()[0:5])
>>> nids = None if aids is not None else nids
>>> with_all = not ut.get_argflag('--no-with-all')
>>> make_name_graph_interaction(ibs, nids, aids, with_all=with_all)
>>> #pt.zoom_factory()
>>> ut.show_if_requested()
ibeis.viz.viz_tmp.make_netx_graph_from_aid_groups(ibs, aids_list, only_reviewed_matches=True, invis_edges=None, ensure_edges=None, temp_nids=None, allow_directed=False)[source]
Parameters:
  • ibs (ibeis.IBEISController) – image analysis api
  • aids_list (list) –

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.viz.viz_graph import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='testdb1')
>>> aids_list = [[1, 2, 3, 4], [5, 6, 7]]
>>> invis_edges = [(1, 5)]
>>> only_reviewed_matches = True
>>> graph = make_netx_graph_from_aid_groups(ibs, aids_list,
>>>                                         only_reviewed_matches,
>>>                                         invis_edges)
>>> list(nx.connected_components(graph.to_undirected()))
ibeis.viz.viz_tmp.make_netx_graph_from_aidpairs(ibs, aids1, aids2, unique_aids=None)[source]
ibeis.viz.viz_tmp.viz_netx_chipgraph(ibs, graph, fnum=None, use_image=False, layout=None, zoom=None, prog=u'neato', as_directed=False, augment_graph=True, layoutkw=None, framewidth=True, **kwargs)[source]

DEPRICATE or improve

Parameters:
  • ibs (IBEISController) – ibeis controller object
  • graph (nx.DiGraph) –
  • fnum (int) – figure number(default = None)
  • use_image (bool) – (default = False)
  • zoom (float) – (default = 0.4)
Returns:

pos

Return type:

?

CommandLine:

python -m ibeis --tf viz_netx_chipgraph --show
Cand:
ibeis review_tagged_joins –save figures4/mergecase.png –figsize=15,15
–clipwhite –diskshow
ibeis compute_occurrence_groups –save figures4/occurgraph.png
–figsize=40,40 –clipwhite –diskshow

~/code/ibeis/ibeis/algo/preproc/preproc_occurrence.py

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.viz.viz_graph import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='PZ_MTEST')
>>> nid_list = ibs.get_valid_nids()[0:10]
>>> fnum = None
>>> use_image = True
>>> zoom = 0.4
>>> make_name_graph_interaction(ibs, nid_list, prog='neato')
>>> ut.show_if_requested()

Module contents

ibeis.viz.import_subs()[source]
ibeis.viz.reassign_submodule_attributes(verbose=True)[source]

why reloading all the modules doesnt do this I don’t know

ibeis.viz.reload_subs(verbose=True)[source]

Reloads ibeis.viz and submodules

ibeis.viz.rrrr(verbose=True)

Reloads ibeis.viz and submodules