ibeis.gui package¶
Submodules¶
ibeis.gui._grave module¶
-
ibeis.gui._grave.
inspect_orphaned_qres_bigcache
(ibs, bc_fpath, cfgdict={})[source]¶ Hack to try and grab the last big query
import ibeis ibs = ibeis.opendb(‘PZ_Master0’) fname = ‘PZ_Master0_QRESMAP_QSUUIDS((187)85k!tqcpgtb8k%rj)_DSUUIDS((200)4%t0tenxktstb676)2m8fp@nto!s@@0f+_a@2duauqcb4r18g7.cPkl’ # NOQA bc_dpath = ibs.get_big_cachedir() from os.path import join bc_fpath = join(bc_dpath, fname)
import os bc_dpath = ibs.get_big_cachedir() fpath_list = ut.ls(bc_dpath) ctime_list = list(map(os.path.getctime, fpath_list)) sorted_fpath_list = ut.sortedby(fpath_list, ctime_list, reverse=True) bc_fpath = sorted_fpath_list[0]
- cfgdict = dict(
- can_match_samename=False, use_k_padding=False, affine_invariance=False, scale_max=150, augment_queryside_hack=True)
ibeis.gui.clock_offset_gui module¶
Small GUI for asking the user to enter the clock time shown, and moving along a gid list if the first image isn’t a clock
-
class
ibeis.gui.clock_offset_gui.
ClockOffsetWidget
(co_wgt, ibs, gid_list, parent=None, hack=False)[source]¶ Bases:
PyQt4.QtGui.QWidget
-
ibeis.gui.clock_offset_gui.
test_clock_offset
()[source]¶ CommandLine:
python -m ibeis.gui.clock_offset_gui --test-test_clock_offset
Example
>>> # DISABLE_DOCTEST >>> from ibeis.gui.clock_offset_gui import * # NOQA >>> # build test data >>> # execute function >>> result = test_clock_offset() >>> # verify results >>> print(result)
ibeis.gui.guiback module¶
This module controls the GUI backend. It is the layer between the GUI frontend (newgui.py) and the IBEIS controller. All the functionality of the nonvisual gui components is written or called from here
- TODO:
open_database should not allow you to open subfolders
python -m utool.util_inspect check_module_usage –pat=”guiback.py”
-
class
ibeis.gui.guiback.
MainWindowBackend
(back, ibs=None)[source]¶ Bases:
PyQt4.QtCore.QObject
Sends and recieves signals to and from the frontend
Parameters: - back –
- ibs (ibeis.IBEISController) – image analysis api(default = None)
CommandLine:
python -m ibeis.gui.guiback MainWindowBackend --show
Example
>>> # DISABLE_DOCTEST >>> from ibeis.gui.guiback import * # NOQA >>> import ibeis >>> back = testdata_guiback(defaultdb=None) >>> ut.quit_if_noshow() >>> ut.quit_if_noshow() >>> guitool.qtapp_loop(qwin=back.front, freq=10)
-
add_annotation_from_image
(back, gid_list, refresh=True)[source]¶ Context -> Add Annotation from Image
-
are_you_sure
(back, use_msg=None, title=u'Confirmation', default=None, action=None, detailed_msg=None)[source]¶ Prompt user for conformation before changing something
-
compute_queries
(back, refresh=True, daids_mode=None, query_is_known=None, qaid_list=None, use_prioritized_name_subset=False, use_visual_selection=False, cfgdict={}, query_msg=None, custom_qaid_list_title=None, daid_list=None, **kwargs)[source]¶ MAIN QUERY FUNCTION
execute_query
Batch -> Compute OldStyle Queries and Actions -> Query
Computes query results for all annotations in an imageset. Results are either vs-exemplar or intra-imageset
CommandLine:
./main.py --query 1 -y python -m ibeis --query 1 -y python -m ibeis --query 1:119 --db PZ_MTEST --nocache-query --nocache-nnmid -y python -m ibeis --query 1:119 --db PZ_MTEST --nocache-query --nocache-nnmid -y --force-all-progress python -m ibeis --query 1:119 --db PZ_MTEST --nocache-query --nocache-nnmid --hots-batch-size=3 -y python -m ibeis --query 1:119 --db PZ_MTEST --nocache-query --nocache-nnmid --hots-batch-size=3 -y python -m ibeis --query 1:119 --db PZ_MTEST --nocache-query --nocache-nnmid --hots-batch-size=32 -y
Example
>>> # DISABLE_DOCTEST >>> from ibeis.gui.guiback import * # NOQA >>> import ibeis >>> main_locals = ibeis.main(db='testdb2') >>> # build test data >>> back = main_locals['back'] >>> ibs = back.ibs >>> query_is_known = None >>> # execute function >>> refresh = True >>> daids_mode = None >>> imgsetid = None >>> kwargs = {} >>> # verify results >>> print(result)
-
confirm_query_dialog
(back, daid_list=None, qaid_list=None, cfgdict=None, query_msg=None)[source]¶ Asks the user to confirm starting the identification query
-
confirm_query_dialog2
(back, species2_expanded_aids=None, cfgdict=None, query_msg=None, query_title=None)[source]¶ Asks the user to confirm starting the identification query
-
delete_annot
(back, aid_list=None)[source]¶ Action -> Delete Annotation
CommandLine:
python -m ibeis.gui.guiback --test-delete_annot --show python -m ibeis.gui.guiback --test-delete_annot --show --no-api-cache python -m ibeis.gui.guiback --test-delete_annot --show --assert-api-cache python -m ibeis.gui.guiback --test-delete_annot --show --debug-api-cache --yes
- SeeAlso:
- manual_annot_funcs.delete_annots
Example
>>> # GUI_DOCTEST >>> from ibeis.gui.guiback import * # NOQA >>> back = testdata_guiback() >>> ibs = back.ibs >>> imgsetid_list = back.ibs.get_valid_imgsetids() >>> imgsetid = ut.take(imgsetid_list, ut.list_argmax(list(map(len, back.ibs.get_imageset_gids(imgsetid_list))))) >>> back.front.select_imageset_tab(imgsetid) >>> gid = back.ibs.get_imageset_gids(imgsetid)[0] >>> # add a test annotation to delete >>> aid_list = back.add_annotation_from_image([gid]) >>> # delte annotations >>> aids1 = back.ibs.get_image_aids(gid) >>> back.delete_annot(aid_list) >>> aids2 = back.ibs.get_image_aids(gid) >>> #assert len(aids2) == len(aids1) - 1 >>> ut.quit_if_noshow() >>> guitool.qtapp_loop(back.mainwin, frequency=100)
-
display_dbinfo
(*args, **kwargs)[source]¶ CommandLine:
python -m ibeis.gui.guiback --test-display_dbinfo
Example
>>> # DISABLE_DOCTEST >>> from ibeis.gui.guiback import * # NOQA >>> # build test data >>> back = testdata_guiback() >>> # execute function >>> result = back.display_dbinfo() >>> # verify results >>> print(result)
-
imageset_reviewed_all_images
(back, refresh=True)[source]¶ Step 6) Commit
Sets all imagesets as reviwed and ships them to wildbook
commit step
-
imageset_set_species
(back, refresh=True)[source]¶ HACK: sets the species columns of all annotations in the imageset to be whatever is currently in the detect config
-
import_images_from_dir
(back, dir_=None, size_filter=None, refresh=True, clock_offset=True, return_dir=False, defaultdir=None)[source]¶ File -> Import Images From Directory
-
import_images_from_dir_with_smart
(back, dir_=None, size_filter=None, refresh=True, smart_xml_fpath=None, defaultdir=None)[source]¶ File -> Import Images From Directory with smart
Parameters: - dir (None) – (default = None)
- size_filter (None) – (default = None)
- refresh (bool) – (default = True)
Returns: gid_list
Return type: list
CommandLine:
python -m ibeis.gui.guiback --test-import_images_from_dir_with_smart --show python -m ibeis.gui.guiback --test-import_images_from_dir_with_smart --show --auto
Example
>>> # DEV_GUI_DOCTEST >>> from ibeis.gui.guiback import * # NOQA >>> back = testdata_guiback(defaultdb='freshsmart_test', delete_ibsdir=True, allow_newdir=True) >>> ibs = back.ibs >>> defaultdir = ut.truepath('~/lewa-desktop/Desktop/GZ_Foal_Patrol_22_06_2015') >>> dir_ = None if not ut.get_argflag('--auto') else join(defaultdir, 'Photos') >>> smart_xml_fpath = None if not ut.get_argflag('--auto') else join(defaultdir, 'Patrols', 'LWC_000526LEWA_GZ_FOAL_PATROL.xml') >>> size_filter = None >>> refresh = True >>> gid_list = back.import_images_from_dir_with_smart(dir_, size_filter, refresh, defaultdir=defaultdir, smart_xml_fpath=smart_xml_fpath) >>> result = ('gid_list = %s' % (str(gid_list),)) >>> print(result) >>> ut.quit_if_noshow() >>> guitool.qtapp_loop(back.mainwin, frequency=100)
-
import_images_from_file
(back, gpath_list=None, refresh=True, as_annots=False, clock_offset=True)[source]¶ File -> Import Images From File
- Example
- # GUI_DOCTEST >>> print(‘[TEST] GET_TEST_IMAGE_PATHS’) >>> # The test api returns a list of interesting chip indexes >>> mode = ‘FILE’ >>> if mode == ‘FILE’: >>> gpath_list = list(map(utool.unixpath, grabdata.get_test_gpaths())) >>> # >>> # else: >>> # dir_ = utool.truepath(join(sysres.get_workdir(), ‘PZ_MOTHERS/images’)) >>> # gpath_list = utool.list_images(dir_, fullpath=True, recursive=True)[::4] >>> print(‘[TEST] IMPORT IMAGES FROM FILEn * gpath_list=%r’ % gpath_list) >>> gid_list = back.import_images(gpath_list=gpath_list) >>> thumbtup_list = ibs.get_image_thumbtup(gid_list) >>> imgpath_list = [tup[1] for tup in thumbtup_list] >>> gpath_list2 = ibs.get_image_paths(gid_list) >>> for path in gpath_list2: >>> assert path in imgpath_list, “Imported Image not in db, path=%r” % path >>> elif mode == ‘DIR’: >>> dir_ = grabdata.get_testdata_dir() >>> print(‘[TEST] IMPORT IMAGES FROM DIRn * dir_=%r’ % dir_) >>> gid_list = back.import_images(dir_=dir_) >>> else: >>> raise AssertionError(‘unknown mode=%r’ % mode) >>> # >>> print(‘[TEST] * len(gid_list)=%r’ % len(gid_list))
-
make_confirm_query_msg
(back, daid_list, qaid_list, cfgdict=None, query_msg=None)[source]¶ Parameters: - daid_list (list) –
- qaid_list (list) –
CommandLine:
python -m ibeis.gui.guiback --test-MainWindowBackend.make_confirm_query_msg
Example
>>> # GUI_DOCTEST >>> from ibeis.gui.guiback import * # NOQA >>> import ibeis >>> # build test data >>> main_locals = ibeis.main(defaultdb='testdb1') >>> ibs, back = ut.dict_take(main_locals, ['ibs', 'back']) >>> daid_list = [1, 2, 3, 4, 5] >>> qaid_list = [4, 5, 6, 7, 8, 9] >>> ibs.get_annotconfig_stats(qaid_list, daid_list) >>> # execute function >>> result = back.make_confirm_query_msg(daid_list, qaid_list) >>> # verify results >>> print(result)
-
make_confirm_query_msg2
(back, species2_expanded_aids, cfgdict=None, query_msg=None, query_title=None)[source]¶ CommandLine:
python -m ibeis.gui.guiback --test-MainWindowBackend.make_confirm_query_msg2 --show
Example
>>> # GUI_DOCTEST >>> from ibeis.gui.guiback import * # NOQA >>> import ibeis >>> main_locals = ibeis.main(defaultdb='testdb1') >>> ibs, back = ut.dict_take(main_locals, ['ibs', 'back']) >>> ut.exec_funckw(back.make_confirm_query_msg2, globals()) >>> imgsetid = ibs.get_imageset_imgsetids_from_text('*All Images') >>> species2_expanded_aids = back._get_expanded_aids_groups(imgsetid) >>> #ibs.get_annotconfig_stats(qaid_list, daid_list) >>> short_msg, detailed_msg = back.make_confirm_query_msg2(species2_expanded_aids) >>> print(short_msg) >>> print(detailed_msg) >>> ut.quit_if_noshow() >>> back.confirm_query_dialog2(species2_expanded_aids)
-
new_database
(back, new_dbdir=None)[source]¶ File -> New Database
Parameters: new_dbdir (None) – (default = None) CommandLine:
python -m ibeis.gui.guiback new_database --show
Example
>>> # DISABLE_DOCTEST >>> from ibeis.gui.guiback import * # NOQA >>> import ibeis >>> #back = testdata_guiback(defaultdb='testdb1') >>> back = testdata_guiback(defaultdb=None) >>> dbdir = None >>> result = back.new_database(dbdir) >>> ut.quit_if_noshow() >>> guitool.qtapp_loop(qwin=back.front, freq=10)
-
notify_controller_killed
(back)[source]¶ Observer’s notify function that the ibeis controller has been killed.
-
open_database
(back, dbdir=None)[source]¶ File -> Open Database
Parameters: dbdir (None) – (default = None) CommandLine:
python -m ibeis.gui.guiback --test-open_database
Example
>>> # GUI_DOCTEST >>> from ibeis.gui.guiback import * # NOQA >>> back = testdata_guiback(defaultdb='testdb1') >>> testdb0 = sysres.db_to_dbdir('testdb0') >>> testdb1 = sysres.db_to_dbdir('testdb1') >>> print('[TEST] TEST_OPEN_DATABASE testdb1=%r' % testdb1) >>> back.open_database(testdb1) >>> print('[TEST] TEST_OPEN_DATABASE testdb0=%r' % testdb0) >>> back.open_database(testdb0) >>> import ibeis >>> #dbdir = join(ibeis.sysres.get_workdir(), 'PZ_MTEST', '_ibsdb') >>> dbdir = None >>> result = back.open_database(dbdir) >>> print(result)
-
run_annot_splits
(back, aid_list)[source]¶ Checks for mismatches within a group of annotations
Parameters: aid_list (int) – list of annotation ids CommandLine:
python -m ibeis.gui.guiback --test-MainWindowBackend.run_annot_splits --show
Example
>>> # GUI_DOCTEST >>> from ibeis.gui.guiback import * # NOQA >>> back = testdata_guiback() >>> ibs = back.ibs >>> aids_list, nids = back.ibs.group_annots_by_name(back.ibs.get_valid_aids()) >>> aid_list = aids_list[ut.list_argmax(list(map(len, aids_list)))] >>> back.run_annot_splits(aid_list) >>> ut.quit_if_noshow() >>> guitool.qtapp_loop(back.mainwin, frequency=100)
-
run_merge_checks
(back)[source]¶ Checks for missed matches within a group of annotations
CommandLine:
python -m ibeis.gui.guiback --test-run_merge_checks --show
Example
>>> # GUI_DOCTEST >>> from ibeis.gui.guiback import * # NOQA >>> back = testdata_guiback() >>> result = back.run_merge_checks() >>> print(result) >>> ut.quit_if_noshow() >>> guitool.qtapp_loop(back.mainwin, frequency=100)
-
run_merge_checks_multitons
(back)[source]¶ Checks for missed matches within a group of annotations. Only uses annotations with more 2 annots per id.
-
select_aid
(back, aid, imgsetid=None, show=True, show_annotation=True, web=False, **kwargs)[source]¶ Table Click -> Chip Table
-
select_gid
(back, gid, imgsetid=None, show=True, sel_aids=None, fnum=None, web=False, **kwargs)[source]¶ Table Click -> Image Table
Example
>>> # GUI_DOCTEST >>> print(''' >>> get_valid_gids >>> ''') >>> valid_gids = ibs.get_valid_gids() >>> print(''' >>> get_valid_aids >>> ''') >>> valid_aids = ibs.get_valid_aids() >>> # >>> print(''' >>> * len(valid_aids) = %r >>> * len(valid_gids) = %r >>> ''' % (len(valid_aids), len(valid_gids))) >>> assert len(valid_gids) > 0, 'database images cannot be empty for test' >>> # >>> gid = valid_gids[0] >>> aid_list = ibs.get_image_aids(gid) >>> aid = aid_list[-1] >>> back.select_gid(gid, aids=[aid])
-
select_nid
(back, nid, imgsetid=None, show=True, show_name=True, **kwargs)[source]¶ Table Click -> Name Table
-
updateWindowTitleSignal
¶
-
class
ibeis.gui.guiback.
NewDatabaseWidget
(parent=None, orientation=2, verticalSizePolicy=7, horizontalSizePolicy=7, verticalStretch=0, **kwargs)[source]¶ Bases:
guitool.guitool_components.GuitoolWidget
Parameters: parent (None) – (default = None) CommandLine:
python -m ibeis.gui.guiback NewDatabaseWidget --show
Example
>>> # DISABLE_DOCTEST >>> from ibeis.gui.guiback import * # NOQA >>> import guitool as gt >>> guitool.ensure_qtapp() >>> self = NewDatabaseWidget(back=None) >>> self.resize(400, 200) >>> self.show() >>> ut.quit_if_noshow() >>> gt.qtapp_loop(qwin=self, freq=10)
-
ibeis.gui.guiback.
backblock
(func)[source]¶ BLOCKING DECORATOR TODO: This decorator has to be specific to either front or back. Is there a way to make it more general?
-
ibeis.gui.guiback.
backreport
(func)[source]¶ reports errors on backend functions should be around every function by default
ibeis.gui.guiexcept module¶
ibeis.gui.guiheaders module¶
This model provides the declarative interface to all of the api_*_models in guitool. Each different type of model/view has to register its iders, getters, and potentially setters (hopefully if guitool ever gets off the ground the delters as well)
Different columns can be hidden / shown by modifying this file
TODO: need to cache the total number of annotations or something about imagesets on disk to help startuptime.
ibeis.gui.inspect_gui module¶
This module was never really finished. It is used in some cases to display the results from a query in a qt window. It needs some work if its to be re-integrated.
- TODO:
- Refresh name table on inspect gui close
-
class
ibeis.gui.inspect_gui.
CustomFilterModel
(model, headers=None, parent=None, *args)[source]¶ Bases:
guitool.filter_proxy_model.FilterProxyModel
-
class
ibeis.gui.inspect_gui.
QueryResultsWidget
(qres_wgt, ibs, cm_list, parent=None, callback=None, name_scoring=False, qreq_=None, **kwargs)[source]¶ Bases:
guitool.api_item_widget.APIItemWidget
Window for gui inspection
CommandLine:
python -m ibeis.gui.inspect_gui --test-test_inspect_matches --show
-
ibeis.gui.inspect_gui.
ensure_match_img
(ibs, cm, daid, qreq_=None, match_thumbtup_cache={})[source]¶ CommandLine:
python -m ibeis.gui.inspect_gui --test-ensure_match_img --show
Example
>>> # ENABLE_DOCTEST >>> from ibeis.gui.inspect_gui import * # NOQA >>> import ibeis >>> # build test data >>> cm, qreq_ = ibeis.testdata_cm() >>> daid = cm.get_top_aids()[0] >>> match_thumbtup_cache = {} >>> # execute function >>> match_thumb_fpath_ = ensure_match_img(qreq_.ibs, cm, daid, qreq_, match_thumbtup_cache) >>> # verify results >>> result = str(match_thumb_fpath_) >>> print(result) >>> ut.quit_if_noshow() >>> ut.startfile(match_thumb_fpath_, quote=True)
assert that the ampersand cannot have duplicate keys
Parameters: - ibs (ibeis.IBEISController) – ibeis controller object
- aid1 (int) – annotation id
- aid2 (int) – annotation id
- cm (ibeis.ChipMatch) – object of feature correspondences and scores
- qreq (ibeis.QueryRequest) – query request object with hyper-parameters(default = None)
- aid_list (list) – list of annotation rowids(default = None)
Returns: options
Return type: list
CommandLine:
python -m ibeis.gui.inspect_gui --exec-get_aidpair_context_menu_options python -m ibeis.gui.inspect_gui --exec-get_aidpair_context_menu_options --verbose python -m ibeis.gui.inspect_gui --exec-get_aidpair_context_menu_options --verbose -a timecontrolled -t invarbest --db PZ_Master1 --qaid 574 # Other scripts that call this one;w python -m ibeis.dev -e cases --db PZ_Master1 -a timectrl -t best --filt :sortdsc=gfscore,fail=True,min_gtscore=.0001 --show python -m ibeis.dev -e cases --db PZ_MTEST -a timectrl -t best --filt :sortdsc=gfscore,fail=True,min_gtscore=.0001 --show
Example
>>> # ENABLE_DOCTEST >>> from ibeis.gui.inspect_gui import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('PZ_MTEST') >>> qreq_ = ibeis.main_helpers.testdata_qreq_(t=['default:fg_on=False']) >>> cm_list = qreq_.execute() >>> cm = cm_list[0] >>> ibs = qreq_.ibs >>> aid1 = cm.qaid >>> aid2 = cm.get_top_aids()[0] >>> aid_list = None >>> options = get_aidpair_context_menu_options(ibs, aid1, aid2, cm, qreq_, aid_list) >>> result = ('options = %s' % (ut.list_str(options),)) >>> print(result)
-
ibeis.gui.inspect_gui.
get_automatch_candidates
(cm_list, ranks_lt=5, directed=True, name_scoring=False, ibs=None, filter_reviewed=False, filter_duplicate_namepair_matches=False)[source]¶ Needs to be moved to a better file. Maybe something to do with identification.
Returns a list of matches that should be inspected This function is more lightweight than orgres or allres. Used in inspect_gui and interact_qres2
Parameters: - cm_list (list) – list of chip match objects
- ranks_lt (int) – put all ranks less than this number into the graph
- directed (bool) –
Returns: candidate_matches = (qaid_arr, daid_arr, score_arr, rank_arr)
Return type: tuple
CommandLine:
python -m ibeis.expt.results_organizer --test-get_automatch_candidates:2 python -m ibeis.expt.results_organizer --test-get_automatch_candidates:0
- Example0:
>>> # ENABLE_DOCTEST >>> from ibeis.gui.inspect_gui import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('PZ_MTEST') >>> qreq_ = ibeis.main_helpers.testdata_qreq_() >>> cm_list = qreq_.execute() >>> ranks_lt = 5 >>> directed = True >>> name_scoring = False >>> candidate_matches = get_automatch_candidates(cm_list, ranks_lt, directed, ibs=ibs) >>> print(candidate_matches)
- Example1:
>>> # UNSTABLE_DOCTEST >>> from ibeis.gui.inspect_gui import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('PZ_MTEST') >>> qaid_list = ibs.get_valid_aids()[0:5] >>> daid_list = ibs.get_valid_aids()[0:20] >>> cm_list = ibs.query_chips(qaid_list, daid_list) >>> ranks_lt = 5 >>> directed = False >>> name_scoring = False >>> filter_reviewed = False >>> filter_duplicate_namepair_matches = True >>> candidate_matches = get_automatch_candidates( ... cm_list, ranks_lt, directed, name_scoring=name_scoring, ... filter_reviewed=filter_reviewed, ... filter_duplicate_namepair_matches=filter_duplicate_namepair_matches, ... ibs=ibs) >>> print(candidate_matches)
- Example3:
>>> # UNSTABLE_DOCTEST >>> from ibeis.gui.inspect_gui import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('PZ_MTEST') >>> qaid_list = ibs.get_valid_aids()[0:1] >>> daid_list = ibs.get_valid_aids()[10:100] >>> qaid2_cm = ibs.query_chips(qaid_list, daid_list) >>> ranks_lt = 1 >>> directed = False >>> name_scoring = False >>> filter_reviewed = False >>> filter_duplicate_namepair_matches = True >>> candidate_matches = get_automatch_candidates( ... cm_list, ranks_lt, directed, name_scoring=name_scoring, ... filter_reviewed=filter_reviewed, ... filter_duplicate_namepair_matches=filter_duplicate_namepair_matches, ... ibs=ibs) >>> print(candidate_matches)
- Example4:
>>> # UNSTABLE_DOCTEST >>> from ibeis.gui.inspect_gui import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('PZ_MTEST') >>> qaid_list = ibs.get_valid_aids()[0:10] >>> daid_list = ibs.get_valid_aids()[0:10] >>> qres_list = ibs.query_chips(qaid_list, daid_list) >>> ranks_lt = 3 >>> directed = False >>> name_scoring = False >>> filter_reviewed = False >>> filter_duplicate_namepair_matches = True >>> candidate_matches = get_automatch_candidates( ... qaid2_cm, ranks_lt, directed, name_scoring=name_scoring, ... filter_reviewed=filter_reviewed, ... filter_duplicate_namepair_matches=filter_duplicate_namepair_matches, ... ibs=ibs) >>> print(candidate_matches)
-
ibeis.gui.inspect_gui.
get_match_status
(ibs, aid_pair)[source]¶ Data role for status column FIXME: no other function in this project takes a tuple of scalars as an argument. Everything else is written in the context of lists, This function should follow the same paradigm, but CustomAPI will have to change.
-
ibeis.gui.inspect_gui.
get_match_status_bgrole
(ibs, aid_pair)[source]¶ Background role for status column
-
ibeis.gui.inspect_gui.
get_match_thumb_fname
(cm, daid, qreq_)[source]¶ CommandLine:
python -m ibeis.gui.inspect_gui --exec-get_match_thumb_fname
Example
>>> # DISABLE_DOCTEST >>> from ibeis.gui.inspect_gui import * # NOQA >>> import ibeis >>> cm, qreq_ = ibeis.testdata_cm('PZ_MTEST') >>> thumbsize = (128, 128) >>> daid = cm.get_top_aids()[0] >>> match_thumb_fname = get_match_thumb_fname(cm, daid, qreq_) >>> result = match_thumb_fname >>> print(result) match_aids=1,1_cfgstr=ubpzwu5k54h6xbnr.jpg
-
ibeis.gui.inspect_gui.
get_reviewed_status
(ibs, aid_pair)[source]¶ Data role for status column FIXME: no other function in this project takes a tuple of scalars as an argument. Everything else is written in the context of lists, This function should follow the same paradigm, but CustomAPI will have to change.
-
ibeis.gui.inspect_gui.
get_reviewed_status_bgrole
(ibs, aid_pair)[source]¶ Background role for status column
-
ibeis.gui.inspect_gui.
launch_review_matches_interface
(ibs, cm_list, dodraw=False, filter_reviewed=False)[source]¶ TODO: move to a more general function
-
ibeis.gui.inspect_gui.
make_qres_api
(ibs, cm_list, ranks_lt=None, name_scoring=False, filter_reviewed=False, filter_duplicate_namepair_matches=False, qreq_=None)[source]¶ Builds columns which are displayable in a ColumnListTableWidget
CommandLine:
python -m ibeis.gui.inspect_gui --test-test_inspect_matches --show python -m ibeis.gui.inspect_gui --test-make_qres_api
Example
>>> # ENABLE_DOCTEST >>> from ibeis.gui.inspect_gui import * # NOQA >>> import ibeis >>> import guitool >>> from ibeis.gui import inspect_gui >>> cm_list, qreq_ = ibeis.main_helpers.testdata_cmlist() >>> tblname = 'chipmatch' >>> name_scoring = False >>> ranks_lt = 5 >>> qres_api = make_qres_api(qreq_.ibs, cm_list, ranks_lt, name_scoring, qreq_=qreq_) >>> print('qres_api = %r' % (qres_api,))
-
ibeis.gui.inspect_gui.
review_match
(ibs, aid1, aid2, update_callback=None, backend_callback=None, qreq_=None, cm=None, **kwargs)[source]¶
-
ibeis.gui.inspect_gui.
set_annot_pair_as_negative_match_
(ibs, aid1, aid2, cm, qreq_, **kwargs)[source]¶
-
ibeis.gui.inspect_gui.
set_annot_pair_as_positive_match_
(ibs, aid1, aid2, cm, qreq_, **kwargs)[source]¶
kwargs are used for callbacks like qres_callback and query_callback
-
ibeis.gui.inspect_gui.
test_inspect_matches
(ibs, qaid_list, daid_list)[source]¶ Parameters: - ibs (IBEISController) –
- qaid_list (list) – query annotation id list
- daid_list (list) – database annotation id list
Returns: Return type: dict
CommandLine:
python -m ibeis.gui.inspect_gui --test-test_inspect_matches --show python -m ibeis.gui.inspect_gui --test-test_inspect_matches --show --nodelete python -m ibeis.gui.inspect_gui --test-test_inspect_matches --cmd
Example
>>> # DISABLE_DOCTEST >>> from ibeis.gui.inspect_gui import * # NOQA >>> import ibeis >>> import guitool >>> ibs = ibeis.opendb(db='PZ_MTEST') >>> assert ibs.dbname == 'PZ_MTEST', 'do not use on a real database' >>> qaid_list = ibs.get_valid_aids()[0:5] >>> daid_list = ibs.get_valid_aids()[0:20] >>> if not ut.get_argflag('--nodelete'): >>> ibs.delete_annotmatch(ibs._get_all_annotmatch_rowids()) >>> main_locals = test_inspect_matches(ibs, qaid_list, daid_list) >>> main_execstr = ibeis.main_loop(main_locals) >>> ut.quit_if_noshow() >>> # TODO: add in qwin to main loop >>> guitool.qtapp_loop(qwin=main_locals['qres_wgt']) >>> print(main_execstr) >>> exec(main_execstr)
ibeis.gui.models_and_views module¶
This provides concrete classes which inherit from abstract api_item_models/api_table_models/api_tree_models in guitool.
-
class
ibeis.gui.models_and_views.
IBEISItemModel
(model, headers=None, parent=None, *args)[source]¶ Bases:
guitool.api_item_model.APIItemModel
-
class
ibeis.gui.models_and_views.
IBEISStripeModel
(model, headers=None, parent=None, *args)[source]¶ Bases:
guitool.stripe_proxy_model.StripeProxyModel
-
class
ibeis.gui.models_and_views.
IBEISTableView
(tblview, parent=None)[source]¶ Bases:
guitool.api_table_view.APITableView
View for ANNOTATION / NAME / IMAGE Tables
-
class
ibeis.gui.models_and_views.
IBEISTableWidget
(widget, headers=None, parent=None, *args)[source]¶ Bases:
guitool.api_item_widget.APIItemWidget
-
class
ibeis.gui.models_and_views.
IBEISTreeView
(treeview, parent=None)[source]¶ Bases:
guitool.api_tree_view.APITreeView
View for NAME / ANNOTATION Tree
-
class
ibeis.gui.models_and_views.
IBEISTreeWidget
(widget, headers=None, parent=None, *args)[source]¶ Bases:
guitool.api_item_widget.APIItemWidget
-
class
ibeis.gui.models_and_views.
ImagesetTableModel
(model, headers=None, parent=None)[source]¶ Bases:
guitool.api_item_model.APIItemModel
ibeis.gui.newgui module¶
This should probably be renamed guifront.py This defines all of the visual components to the GUI It is invoked from guiback, which handles the nonvisual logic.
- BUGS:
- Copying the ungrouped imageset raises an error. Should have the option
to copy or move it. Other special imageset should not have this option.
Should gray out an option if it is not available.
-
class
ibeis.gui.newgui.
APITabWidget
(tabwgt, parent=None, horizontalStretch=1)[source]¶ Bases:
PyQt4.QtGui.QTabWidget
Holds the table-tabs
use setCurrentIndex to change the selection
-
class
ibeis.gui.newgui.
IBEISGuiWidget
(ibswgt, back=None, ibs=None, parent=None)[source]¶ Bases:
PyQt4.QtGui.QWidget
CommandLine:
# Testing python -m ibeis --db NNP_Master3 --onlyimgtbl python -m ibeis --db PZ_Master1 --onlyimgtbl
-
changing_models_gen
(ibswgt, tblnames=None)[source]¶ Loops over tablenames emitting layoutChanged at the end for each
-
edit_image_time
(ibswgt, gid_list)[source]¶ CommandLine:
python -m ibeis.gui.newgui --exec-edit_image_time --show
Example
>>> # DISABLE_DOCTEST >>> from ibeis.gui.newgui import * # NOQA >>> ibs, back, ibswgt, testdata_main_loop = testdata_guifront('testdb3') >>> #ibs, back, ibswgt, testdata_main_loop = testdata_guifront('lynx') >>> ibswgt.edit_image_time([277, 630]) >>> testdata_main_loop(globals(), locals())
-
filter_annotation_table
(ibswgt)[source]¶ TODO: Finish implementation
CommandLine:
python -m ibeis.gui.newgui --test-filter_annotation_table --show --db lynx --imgsetid 2
Example
>>> # DISABLE_DOCTEST >>> from ibeis.gui.newgui import * # NOQA >>> ibs, back, ibswgt, testdata_main_loop = testdata_guifront('testdb3') >>> #ibs, back, ibswgt, testdata_main_loop = testdata_guifront('PZ_Master1') >>> result = ibswgt.filter_annotation_table() >>> print(result) >>> testdata_main_loop(globals(), locals())
-
imagesDropped
(ibswgt, url_list)[source]¶ image drag and drop event
CommandLine:
python -m ibeis.gui.newgui imagesDropped --show
Example
>>> # GUI_DOCTEST >>> from ibeis.gui.newgui import * # NOQA >>> ibs, back, ibswgt, testdata_main_loop = testdata_guifront('hstest') >>> url_list = ['images.foo'] >>> url_list = [ut.truepath('~/Downloads/hs-images.zip')] >>> url = url_list[0] >>> ut.quit_if_noshow() >>> ibswgt.imagesDropped(url_list) >>> testdata_main_loop(globals(), locals())
-
make_adjacent_qtindex_callbacks
(ibswgt, model, qtindex)[source]¶ Returns: (current_rowid, next_callback, prev_callback) Return type: tuple CommandLine:
python -m ibeis.gui.newgui --test-make_adjacent_qtindex_callbacks
Example
>>> # DISABLE_DOCTEST >>> from ibeis.gui.newgui import * # NOQA >>> # build test data >>> ibs, back, ibswgt, testdata_main_loop = testdata_guifront() >>> gid = ibs.get_valid_gids()[0] >>> model = ibswgt.models[gh.IMAGE_TABLE] >>> qtindex, row = model.get_row_and_qtindex_from_id(gid) >>> # execute function >>> (current_rowid, next_callback, prev_callback) = ibswgt.make_adjacent_qtindex_callbacks(model, qtindex) >>> assert prev_callback is None, 'should not be a previous image id' >>> current_rowid1, next_callback1, prev_callback1 = next_callback() >>> assert next_callback() is None, 'race condition not prevented' >>> current_rowid2, next_callback2, prev_callback2 = next_callback1() >>> # testdata main loop func >>> testdata_main_loop(globals(), locals())
-
on_contextMenuClicked
(*args, **kwargs)[source]¶ Right click anywhere in the GUI Context menus on right click of a table
CommandLine:
python -m ibeis --db WS_ALL --imgsetid 2 --select-name=A-003
-
on_doubleclick
(*args, **kwargs)[source]¶ Double clicking anywhere in the GUI
CommandLine:
python -m ibeis --db lynx --imgsetid 2 --select-name=goku
-
select_table_indicies_from_text
(ibswgt, tblname, text, allow_table_change=False)[source]¶ Parameters: - tablename of the id to parse from text (tblname) – Example
>>> # GUI_DOCTEST >>> from ibeis.gui.newgui import * # NOQA >>> # build test data >>> ibs, back, ibswgt, testdata_main_loop = testdata_guifront() >>> ibswgt.set_table_tab(gh.ANNOTATION_TABLE) >>> tblname = gh.NAMES_TREE >>> text = 'lena' >>> ibswgt.select_table_indicies_from_text(tblname, text)
-
set_table_tab
(ibswgt, tblname)[source]¶ Programmatically change to the table-tab to either: Image, ImageGrid, Annotation, or Names table/tree
Example
>>> # GUI_DOCTEST >>> from ibeis.gui.newgui import * # NOQA >>> # build test data >>> ibs, back, ibswgt, testdata_main_loop = testdata_guifront() >>> ibswgt.set_table_tab(gh.ANNOTATION_TABLE)
-
spawn_edit_image_annotation_interaction
(ibswgt, model, qtindex, gid, imgsetid)[source]¶ TODO: needs reimplement using more standard interaction methods
-
spawn_edit_image_annotation_interaction_from_aid
(ibswgt, aid, imgsetid, model=None, qtindex=None)[source]¶ hack for letting annots spawn image editing
CommandLine:
python -m ibeis.gui.newgui --test-spawn_edit_image_annotation_interaction_from_aid --show
Example
>>> # DISABLE_DOCTEST >>> from ibeis.gui.newgui import * # NOQA >>> import ibeis >>> main_locals = ibeis.main(defaultdb='testdb1') >>> ibs, back = ut.dict_take(main_locals, ['ibs', 'back']) >>> ibswgt = back.ibswgt # NOQA >>> aid = 4 >>> imgsetid = 1 >>> ibswgt.spawn_edit_image_annotation_interaction_from_aid(aid, imgsetid) >>> if ut.show_was_requested(): >>> guitool.qtapp_loop(qwin=ibswgt)
-
update_selection
(*args, **kwargs)[source]¶ Quirky behavior: if you select two columns in a row and then unselect only one, the whole row is unselected, because this function only deals with deltas.
Example
>>> # DISABLE_DOCTEST >>> from ibeis.gui.newgui import * # NOQA >>> ibs, back, ibswgt, testdata_main_loop = testdata_guifront() >>> ibswgt.set_table_tab(gh.NAMES_TREE) >>> view = ibswgt.views[gh.NAMES_TREE] >>> view.expandAll() >>> AUTOSELECT = False >>> if AUTOSELECT: ... view.selectAll() >>> selmodel = view.selectionModel() >>> selected = selmodel.selection() >>> deselected = QtGui.QItemSelection() >>> # verify results >>> print(result)
-
-
class
ibeis.gui.newgui.
IBEISMainWindow
(mainwin, back=None, ibs=None, parent=None)[source]¶ Bases:
PyQt4.QtGui.QMainWindow
-
dropSignal
¶
-
quitSignal
¶
-