ibeis.other package

Submodules

ibeis.other.dbinfo module

get_dbinfo is probably the only usefull funciton in here # This is not the cleanest module

ibeis.other.dbinfo.cache_memory_stats(ibs, cid_list, fnum=None)[source]
ibeis.other.dbinfo.get_dbinfo(ibs, verbose=True, with_imgsize=False, with_bytes=False, with_contrib=False, with_agesex=False, with_header=True, short=False, tag=u'dbinfo', aid_list=None)[source]

Returns dictionary of digestable database information Infostr is a string summary of all the stats. Prints infostr in addition to returning locals

Parameters:
  • ibs (IBEISController) –
  • verbose (bool) –
  • with_imgsize (bool) –
  • with_bytes (bool) –
Returns:

Return type:

dict

CommandLine:

python -m ibeis.other.dbinfo --exec-get_dbinfo:0
python -m ibeis.other.dbinfo --test-get_dbinfo:1
python -m ibeis.other.dbinfo --test-get_dbinfo:0 --db NNP_Master3
python -m ibeis.other.dbinfo --test-get_dbinfo:0 --db PZ_Master1
python -m ibeis.other.dbinfo --test-get_dbinfo:0 --db GZ_ALL
python -m ibeis.other.dbinfo --exec-get_dbinfo:0 --db PZ_ViewPoints
python -m ibeis.other.dbinfo --exec-get_dbinfo:0 --db GZ_Master1

python -m ibeis.other.dbinfo --exec-get_dbinfo:0 -a ctrl
python -m ibeis.other.dbinfo --exec-get_dbinfo:0 -a default:minqual=ok,require_timestamp=True --dbdir ~/lev/media/danger/LEWA
python -m ibeis.other.dbinfo --exec-get_dbinfo:0 -a default:minqual=ok,require_timestamp=True --dbdir ~/lev/media/danger/LEWA --loadbackup=0

python -m ibeis.other.dbinfo --exec-get_dbinfo:0 -a default: --dbdir ~/lev/media/danger/LEWA
python -m ibeis.other.dbinfo --exec-get_dbinfo:0 -a default: --dbdir ~/lev/media/danger/LEWA --loadbackup=0
Example1:
>>> # SCRIPT
>>> from ibeis.other.dbinfo import *  # NOQA
>>> import ibeis
>>> defaultdb = 'testdb1'
>>> ibs, aid_list = ibeis.testdata_aids(defaultdb, a='default:minqual=ok,view=primary,view_ext1=1')
>>> kwargs = ut.get_kwdefaults(get_dbinfo)
>>> kwargs['verbose'] = False
>>> kwargs['aid_list'] = aid_list
>>> kwargs = ut.parse_dict_from_argv(kwargs)
>>> output = get_dbinfo(ibs, **kwargs)
>>> result = (output['info_str'])
>>> print(result)
>>> #ibs = ibeis.opendb(defaultdb='testdb1')
>>> # <HACK FOR FILTERING>
>>> #from ibeis.expt import cfghelpers
>>> #from ibeis.expt import annotation_configs
>>> #from ibeis.init import filter_annots
>>> #named_defaults_dict = ut.dict_take(annotation_configs.__dict__,
>>> #                                   annotation_configs.TEST_NAMES)
>>> #named_qcfg_defaults = dict(zip(annotation_configs.TEST_NAMES,
>>> #                               ut.get_list_column(named_defaults_dict, 'qcfg')))
>>> #acfg = cfghelpers.parse_argv_cfg(('--annot-filter', '-a'), named_defaults_dict=named_qcfg_defaults, default=None)[0]
>>> #aid_list = ibs.get_valid_aids()
>>> # </HACK FOR FILTERING>
Example1:
>>> # ENABLE_DOCTEST
>>> from ibeis.other.dbinfo import *  # NOQA
>>> import ibeis
>>> verbose = True
>>> short = True
>>> #ibs = ibeis.opendb(db='GZ_ALL')
>>> #ibs = ibeis.opendb(db='PZ_Master0')
>>> ibs = ibeis.opendb('testdb1')
>>> assert ibs.get_dbname() == 'testdb1', 'DO NOT DELETE CONTRIBUTORS OF OTHER DBS'
>>> ibs.delete_contributors(ibs.get_valid_contrib_rowids())
>>> ibs.delete_empty_nids()
>>> #ibs = ibeis.opendb(db='PZ_MTEST')
>>> output = get_dbinfo(ibs, with_contrib=False, verbose=False, short=True)
>>> result = (output['info_str'])
>>> print(result)
+============================
DB Info:  testdb1
DB Notes: None
DB NumContrib: 0
----------
# Names                      = 7
# Names (unassociated)       = 0
# Names (singleton)          = 5
# Names (multiton)           = 2
----------
# Annots                     = 13
# Annots (unknown)           = 4
# Annots (singleton)         = 5
# Annots (multiton)          = 4
----------
# Img                        = 13
L============================
ibeis.other.dbinfo.get_short_infostr(ibs)[source]

Returns printable database information

Parameters:ibs (IBEISController) – ibeis controller object
Returns:infostr
Return type:str

CommandLine:

python -m ibeis.other.dbinfo --test-get_short_infostr

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.dbinfo import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb('testdb1')
>>> infostr = get_short_infostr(ibs)
>>> result = str(infostr)
>>> print(result)
dbname = 'testdb1'
num_images = 13
num_annotations = 13
num_names = 7
ibeis.other.dbinfo.hackshow_names(ibs, aid_list, fnum=None)[source]
Parameters:

CommandLine:

python -m ibeis.other.dbinfo --exec-hackshow_names --show
python -m ibeis.other.dbinfo --exec-hackshow_names --show --db PZ_Master1

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.dbinfo import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='PZ_MTEST')
>>> aid_list = ibs.get_valid_aids()
>>> result = hackshow_names(ibs, aid_list)
>>> print(result)
>>> ut.show_if_requested()
ibeis.other.dbinfo.latex_dbstats(ibs_list, **kwargs)[source]
Parameters:ibs (IBEISController) – ibeis controller object

CommandLine:

python -m ibeis.other.dbinfo --exec-latex_dbstats --dblist testdb1
python -m ibeis.other.dbinfo --exec-latex_dbstats --dblist testdb1 --show
python -m ibeis.other.dbinfo --exec-latex_dbstats --dblist PZ_Master0 testdb1 --show
python -m ibeis.other.dbinfo --exec-latex_dbstats --dblist PZ_Master0 PZ_MTEST GZ_ALL --show
python -m ibeis.other.dbinfo --test-latex_dbstats --dblist GZ_ALL NNP_MasterGIRM_core --show

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.dbinfo import *  # NOQA
>>> import ibeis
>>> db_list = ut.get_argval('--dblist', type_=list, default=['testdb1'])
>>> ibs_list = [ibeis.opendb(db=db) for db in db_list]
>>> tabular_str = latex_dbstats(ibs_list)
>>> tabular_cmd = ut.latex_newcommand(ut.latex_sanitize_command_name('DatabaseInfo'), tabular_str)
>>> ut.copy_text_to_clipboard(tabular_cmd)
>>> write_fpath = ut.get_argval('--write', type_=str, default=None)
>>> if write_fpath is not None:
>>>     fpath = ut.truepath(write_fpath)
>>>     text = ut.readfrom(fpath)
>>>     new_text = ut.replace_between_tags(text, tabular_cmd, '% <DBINFO>', '% </DBINFO>')
>>>     ut.writeto(fpath, new_text)
>>> ut.print_code(tabular_cmd, 'latex')
>>> ut.quit_if_noshow()
>>> ut.render_latex_text('\\noindent \n' + tabular_str)
ibeis.other.dbinfo.print_feature_info(testres)[source]

draws keypoint statistics for each test configuration

Parameters:testres (ibeis.expt.test_result.TestResult) – test result

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.dbinfo import *  # NOQA
>>> import ibeis
>>> ibs, testres = ibeis.testdata_expts(defaultdb='PZ_MTEST', a='timectrl', t='invar:AI=False')
>>> (tex_nKpts, tex_kpts_stats, tex_scale_stats) = feature_info(ibs)
>>> result = ('(tex_nKpts, tex_kpts_stats, tex_scale_stats) = %s' % (ut.repr2((tex_nKpts, tex_kpts_stats, tex_scale_stats)),))
>>> print(result)
>>> ut.quit_if_noshow()
>>> import plottool as pt
>>> ut.show_if_requested()
ibeis.other.dbinfo.print_qd_info(ibs, qaid_list, daid_list, verbose=False)[source]
SeeAlso:
ibs.print_annotconfig_stats(qaid_list, daid_list)

information for a query/database aid configuration

ibeis.other.dbinfo.show_image_time_distributions(ibs, gid_list)[source]
Parameters:

CommandLine:

python -m ibeis.other.dbinfo --exec-show_image_time_distributions --show
python -m ibeis.other.dbinfo --exec-show_image_time_distributions --show --db lynx

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.dbinfo import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='testdb1')
>>> aids = ibeis.testdata_aids(ibs=ibs)
>>> gid_list = ut.unique_unordered(ibs.get_annot_gids(aids))
>>> result = show_image_time_distributions(ibs, gid_list)
>>> print(result)
>>> ut.show_if_requested()
ibeis.other.dbinfo.show_time_distributions(ibs, unixtime_list)[source]
ibeis.other.dbinfo.test_name_consistency(ibs)[source]

Example

>>> import ibeis
>>> ibs = ibeis.opendb(db='PZ_Master0')
>>> #ibs = ibeis.opendb(db='GZ_ALL')

ibeis.other.detectfuncs module

developer convenience functions for ibs

TODO: need to split up into sub modules:

consistency_checks feasibility_fixes move the export stuff to dbio

then there are also convineience functions that need to be ordered at least within this file

ibeis.other.detectfuncs.classifier_confusion_matrix_algo_plot(ibs, label, color, conf, **kwargs)[source]
ibeis.other.detectfuncs.classifier_precision_recall_algo(ibs, **kwargs)[source]
ibeis.other.detectfuncs.classifier_precision_recall_algo_display(ibs, figsize=(16, 16), **kwargs)[source]
ibeis.other.detectfuncs.classifier_precision_recall_algo_plot(ibs, **kwargs)[source]
ibeis.other.detectfuncs.classifier_roc_algo_plot(ibs, **kwargs)[source]
ibeis.other.detectfuncs.classifier_train(ibs)[source]
ibeis.other.detectfuncs.detect_write_detection_all(ibs)[source]
ibeis.other.detectfuncs.detector_confusion_matrix_algo_plot(ibs, label, color, conf, **kwargs)[source]
ibeis.other.detectfuncs.detector_metric_graphs(ibs)[source]
ibeis.other.detectfuncs.detector_parse_gt(ibs, test_gid_set=None)[source]
ibeis.other.detectfuncs.detector_parse_pred(ibs, test_gid_set=None, **kwargs)[source]
ibeis.other.detectfuncs.detector_precision_recall_algo(ibs, samples=500, force_serial=True, **kwargs)[source]
ibeis.other.detectfuncs.detector_precision_recall_algo_display(ibs, min_overlap=0.5, figsize=(24, 7), **kwargs)[source]
ibeis.other.detectfuncs.detector_precision_recall_algo_plot(ibs, **kwargs)[source]
ibeis.other.detectfuncs.detector_precision_recall_algo_worker(tup)[source]
ibeis.other.detectfuncs.detector_train(ibs)[source]
ibeis.other.detectfuncs.export_to_xml(ibs, offset=u'auto', enforce_yaw=False, target_size=500, purge=False)[source]
ibeis.other.detectfuncs.fix_horizontal_bounding_boxes_to_orient(ibs, gid, bbox_list)[source]
ibeis.other.detectfuncs.general_area_best_conf(conf_list, x_list, y_list, label=u'Unknown', color=u'b', invert=False, x_limit=0.9, **kwargs)[source]
ibeis.other.detectfuncs.general_confusion_matrix_algo(label_correct_list, label_predict_list, category_list, category_mapping, fig_, axes_, fuzzy_dict=None, conf=None, conf_list=None, **kwargs)[source]
ibeis.other.detectfuncs.general_identify_operating_point(conf_list, x_list, y_list, invert=False, x_limit=0.9)[source]
ibeis.other.detectfuncs.general_intersection_over_union(bbox1, bbox2)[source]
ibeis.other.detectfuncs.general_overlap(gt_list, pred_list)[source]
ibeis.other.detectfuncs.general_parse_gt(ibs, test_gid_set=None)[source]
ibeis.other.detectfuncs.general_precision_recall_algo(ibs, label_list, confidence_list, category=u'positive', samples=10000, **kwargs)[source]
ibeis.other.detectfuncs.general_tp_fp_fn(gt_list, pred_list, min_overlap, duplicate_assign=True, check_species=False, check_viewpoint=False, **kwargs)[source]
ibeis.other.detectfuncs.imageset_train_test_split(ibs, train_split=0.8)[source]
ibeis.other.detectfuncs.labeler_confusion_matrix_algo_plot(ibs, label, color, **kwargs)[source]
ibeis.other.detectfuncs.labeler_precision_recall_algo(ibs, category_list, label_dict, **kwargs)[source]
ibeis.other.detectfuncs.labeler_precision_recall_algo_display(ibs, figsize=(16, 16), **kwargs)[source]
ibeis.other.detectfuncs.labeler_precision_recall_algo_plot(ibs, **kwargs)[source]
ibeis.other.detectfuncs.labeler_roc_algo_plot(ibs, **kwargs)[source]
ibeis.other.detectfuncs.labeler_tp_tn_fp_fn(ibs, samples=10000, **kwargs)[source]
ibeis.other.detectfuncs.labeler_train(ibs)[source]
ibeis.other.detectfuncs.localizer_confusion_matrix_algo_plot(ibs, label, color, conf, **kwargs)[source]
ibeis.other.detectfuncs.localizer_distributions(ibs)[source]
ibeis.other.detectfuncs.localizer_parse_pred(ibs, test_gid_set=None, **kwargs)[source]
ibeis.other.detectfuncs.localizer_precision_recall_algo(ibs, samples=500, force_serial=True, **kwargs)[source]
ibeis.other.detectfuncs.localizer_precision_recall_algo_display(ibs, min_overlap=0.5, figsize=(24, 7), **kwargs)[source]
ibeis.other.detectfuncs.localizer_precision_recall_algo_display_animate(ibs, **kwargs)[source]
ibeis.other.detectfuncs.localizer_precision_recall_algo_plot(ibs, **kwargs)[source]
ibeis.other.detectfuncs.localizer_precision_recall_algo_worker(tup)[source]
ibeis.other.detectfuncs.localizer_train(ibs)[source]
ibeis.other.detectfuncs.plot_distrobutions(distro_dict)[source]
ibeis.other.detectfuncs.redownload_detection_models(ibs)[source]
Parameters:ibs (IBEISController) –

CommandLine:

python -c "from ibeis.algo.detect import grabmodels; grabmodels.redownload_models()"
python -c "import utool, ibeis.algo; utool.view_directory(ibeis.algo.detect.grabmodels._expand_modeldir())"

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.detectfuncs import *  # NOQA
>>> import ibeis  # NOQA
>>> ibs = ibeis.opendb('testdb1')
>>> result = redownload_detection_models(ibs)
>>> print(result)
ibeis.other.detectfuncs.remove_rfdetect(ibs)[source]
ibeis.other.detectfuncs.view_model_dir(ibs)[source]

ibeis.other.duct_tape module

ibeis.other.duct_tape.enforce_unkonwn_name_is_explicit(ibs)[source]
ibeis.other.duct_tape.fix_compname_configs(ibs)[source]

duct tape to keep version in check

ibeis.other.duct_tape.fix_nulled_yaws(ibs)[source]
ibeis.other.duct_tape.parse_and_update_image_exif_orientations(ibs, verbose=False)[source]
ibeis.other.duct_tape.remove_database_slag(ibs, delete_empty_names=False, delete_empty_imagesets=False, delete_annotations_for_missing_images=False, delete_image_labels_for_missing_types=False, delete_annot_labels_for_missing_types=False, delete_chips_for_missing_annotations=False, delete_features_for_missing_annotations=False, delete_invalid_eg_relations=False, delete_invalid_gl_relations=False, delete_invalid_al_relations=True)[source]

ibeis.other.ibsfuncs module

developer convenience functions for ibs

TODO: need to split up into sub modules:

consistency_checks feasibility_fixes move the export stuff to dbio

then there are also convineience functions that need to be ordered at least within this file

ibeis.other.ibsfuncs.add_next_imageset(ibs)[source]

Adds a new imageset to the database

ibeis.other.ibsfuncs.aidstr(aid, ibs=None, notes=False)[source]

Helper to make a string from an aid

ibeis.other.ibsfuncs.annotstr(ibs, aid)[source]
ibeis.other.ibsfuncs.assert_images_exist(ibs, gid_list=None, verbose=True)[source]
ibeis.other.ibsfuncs.assert_lblannot_rowids_are_type(ibs, lblannot_rowid_list, valid_lbltype_rowid)[source]
ibeis.other.ibsfuncs.assert_singleton_relationship(ibs, alrids_list)[source]
ibeis.other.ibsfuncs.assert_valid_aids(ibs, aid_list, verbose=False, veryverbose=False, msg=u'', auuid_list=None)[source]
Parameters:
  • ibs (IBEISController) – ibeis controller object
  • aid_list (int) – list of annotation ids
  • verbose (bool) – verbosity flag(default = False)
  • veryverbose (bool) – (default = False)

CommandLine:

python -m ibeis.other.ibsfuncs --test-assert_valid_aids

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='testdb1')
>>> aid_list = ibs.get_valid_aids()
>>> verbose = False
>>> veryverbose = False
>>> print('Asserting multiple')
>>> result = assert_valid_aids(ibs, aid_list, verbose, veryverbose)
>>> print('Asserting single')
>>> result = assert_valid_aids(ibs, aid_list[0:1], verbose, veryverbose)
>>> print('Asserting multiple incorrect')
>>> auuid_list = ibs.get_annot_uuids(aid_list) + [None]
>>> try:
>>>    result = assert_valid_aids(ibs, aid_list + [0], verbose, veryverbose, auuid_list=auuid_list)
>>> except AssertionError:
>>>    print('Correctly got assertion')
>>> else:
>>>    assert False, 'should have failed'
>>> print('Asserting single incorrect')
>>> try:
>>>    result = assert_valid_aids(ibs, [0], verbose, veryverbose)
>>> except AssertionError:
>>>    print('Correctly got assertion')
>>> else:
>>>    assert False, 'should have failed'
>>> print(result)
>>> print(result)
ibeis.other.ibsfuncs.assert_valid_gids(ibs, gid_list, verbose=False, veryverbose=False)[source]
ibeis.other.ibsfuncs.assert_valid_names(name_list)[source]

Asserts that user specified names do not conflict with the standard unknown name

ibeis.other.ibsfuncs.assert_valid_species_texts(ibs, species_list, iswarning=True)[source]
ibeis.other.ibsfuncs.batch_rename_consecutive_via_species(ibs, imgsetid=None)[source]

actually sets the new consectuive names

ibeis.other.ibsfuncs.check_annot_consistency(ibs, aid_list=None)[source]
Parameters:

CommandLine:

python -m ibeis.other.ibsfuncs --test-check_annot_consistency

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis  # NOQA
>>> ibs = ibeis.opendb('testdb1')
>>> aid_list = ibs.get_valid_aids()
>>> result = check_annot_consistency(ibs, aid_list)
>>> print(result)
ibeis.other.ibsfuncs.check_annot_corrupt_uuids(ibs, aid_list=None)[source]

# del dtool.__SQLITE__.converters[‘UUID’] # import uuid # del dtool.__SQLITE__.adapters[(uuid.UUID, dtool.__SQLITE__.PrepareProtocol)]

>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis  # NOQA
>>> ibs = ibeis.opendb('PZ_MTEST')
>>> aid_list = ibs.get_valid_aids()
>>> check_annot_corrupt_uuids(ibs, aid_list)
ibeis.other.ibsfuncs.check_annot_size(ibs)[source]
ibeis.other.ibsfuncs.check_annotmatch_consistency(ibs)[source]
ibeis.other.ibsfuncs.check_chip_existence(ibs, aid_list=None)[source]
ibeis.other.ibsfuncs.check_exif_data(ibs, gid_list)[source]

TODO CALL SCRIPT

ibeis.other.ibsfuncs.check_image_consistency(ibs, gid_list=None)[source]
Parameters:
  • ibs (IBEISController) – ibeis controller object
  • gid_list (list) – (default = None)

CommandLine:

python -m ibeis.other.ibsfuncs --exec-check_image_consistency  --db=GZ_Master1

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='testdb1')
>>> gid_list = None
>>> result = check_image_consistency(ibs, gid_list)
>>> print(result)
ibeis.other.ibsfuncs.check_image_uuid_consistency(ibs, gid_list)[source]

Checks to make sure image uuids are computed detemenistically by recomputing all guuids and checking that they are equal to what is already there.

VERY SLOW

CommandLine:

python -m ibeis.other.ibsfuncs --test-check_image_uuid_consistency --db=PZ_Master0
python -m ibeis.other.ibsfuncs --test-check_image_uuid_consistency --db=GZ_Master1
python -m ibeis.other.ibsfuncs --test-check_image_uuid_consistency
python -m ibeis.other.ibsfuncs --test-check_image_uuid_consistency --db lynx

Example

>>> # DISABLE_DOCTEST
>>> # Check for very large files
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='PZ_MTEST')
>>> gid_list_ = ibs.get_valid_gids()
>>> gpath_list_ = ibs.get_image_paths(gid_list_)
>>> bytes_list_ = [ut.get_file_nBytes(path) for path in gpath_list_]
>>> sortx = ut.list_argsort(bytes_list_, reverse=True)[0:10]
>>> gpath_list = ut.take(gpath_list_, sortx)
>>> bytes_list = ut.take(bytes_list_, sortx)
>>> gid_list   = ut.take(gid_list_, sortx)
>>> ibeis.other.ibsfuncs.check_image_uuid_consistency(ibs, gid_list)
ibeis.other.ibsfuncs.check_name_consistency(ibs, nid_list)[source]
Parameters:

CommandLine:

python -m ibeis.other.ibsfuncs --test-check_name_consistency

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> # build test data
>>> ibs = ibeis.opendb('testdb1')
>>> nid_list = ibs._get_all_known_nids()
>>> # execute function
>>> result = check_name_consistency(ibs, nid_list)
>>> # verify results
>>> print(result)
ibeis.other.ibsfuncs.check_name_mapping_consistency(ibs, nx2_aids)[source]

checks that all the aids grouped in a name ahave the same name

ibeis.other.ibsfuncs.compare_nested_props(ibs, aids1_list, aids2_list, getter_func, cmp_func)[source]

Compares properties of query vs database annotations

grouped_qaids = aids1_list grouped_groundtruth_list = aids2_list

getter_func = ibs.get_annot_yaws cmp_func = vt.ori_distance

getter_func = ibs.get_annot_image_unixtimes_asfloat cmp_func = ut.unixtime_hourdiff

ExpandNestedComparisions:
import itertools list(map(list, itertools.starmap(ut.iprod, zip(aids1_list, aids2_list))))
Parameters:
  • ibs (IBEISController) – ibeis controller object
  • aids1_list (list) –
  • aids2_list (list) –
  • getter_func
  • cmp_func
Returns:

Return type:

list of ndarrays

CommandLine:

python -m ibeis.other.ibsfuncs --exec-compare_nested_props --show

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='PZ_MTEST')
>>> aids1_list = [ibs.get_valid_aids()[8:11]]
>>> aids2_list = [ibs.get_valid_aids()[8:11]]
>>> getter_func = ibs.get_annot_image_unixtimes_asfloat
>>> cmp_func = ut.unixtime_hourdiff
>>> result = compare_nested_props(ibs, aids1_list, aids2_list, getter_func, cmp_func)
>>> print(result)
>>> ut.quit_if_noshow()
>>> import plottool as pt
>>> ut.show_if_requested()
ibeis.other.ibsfuncs.compute_all_chips(ibs, **kwargs)[source]

Executes lazy evaluation of all chips

ibeis.other.ibsfuncs.compute_occurrences(ibs)[source]

Clusters ungrouped images into imagesets representing occurrences

CommandLine:

python -m ibeis.control.IBEISControl --test-compute_occurrences

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.control.IBEISControl import *  # NOQA
>>> import ibeis  # NOQA
>>> # build test data
>>> ibs = ibeis.opendb('testdb1')
>>> ibs.compute_occurrences()
>>> ibs.update_special_imagesets()
>>> # Now we want to remove some images from a non-special imageset
>>> nonspecial_imgsetids = [i for i in ibs.get_valid_imgsetids() if i not in ibs.get_special_imgsetids()]
>>> images_to_remove = ibs.get_imageset_gids(nonspecial_imgsetids[0:1])[0][0:1]
>>> ibs.unrelate_images_and_imagesets(images_to_remove,nonspecial_imgsetids[0:1] * len(images_to_remove))
>>> ibs.update_special_imagesets()
>>> ungr_imgsetid = ibs.get_imageset_imgsetids_from_text(const.UNGROUPED_IMAGES_IMAGESETTEXT)
>>> ungr_gids = ibs.get_imageset_gids([ungr_imgsetid])[0]
>>> #Now let's make sure that when we recompute imagesets, our non-special imgsetid remains the same
>>> print('PRE COMPUTE: ImageSets are %r' % ibs.get_valid_imgsetids())
>>> print('Containing: %r' % ibs.get_imageset_gids(ibs.get_valid_imgsetids()))
>>> ibs.compute_occurrences()
>>> print('COMPUTE: New imagesets are %r' % ibs.get_valid_imgsetids())
>>> print('Containing: %r' % ibs.get_imageset_gids(ibs.get_valid_imgsetids()))
>>> ibs.update_special_imagesets()
>>> print('UPDATE SPECIAL: New imagesets are %r' % ibs.get_valid_imgsetids())
>>> print('Containing: %r' % ibs.get_imageset_gids(ibs.get_valid_imgsetids()))
>>> assert(images_to_remove[0] not in ibs.get_imageset_gids(nonspecial_imgsetids[0:1])[0])
ibeis.other.ibsfuncs.compute_occurrences_smart(ibs, gid_list, smart_xml_fpath)[source]

Function to load and process a SMART patrol XML file

ibeis.other.ibsfuncs.convert_empty_images_to_annotations(ibs)[source]

images without chips are given an ANNOTATION over the entire image

ibeis.other.ibsfuncs.copy_imagesets(ibs, imgsetid_list)[source]
Parameters:
  • ibs (IBEISController) – ibeis controller object
  • imgsetid_list (list) –
Returns:

new_imgsetid_list

Return type:

list

CommandLine:

python -m ibeis.other.ibsfuncs --test-copy_imagesets

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> # build test data
>>> ibs = ibeis.opendb('testdb1')
>>> ibs.delete_all_imagesets()
>>> ibs.compute_occurrences()
>>> imgsetid_list = ibs.get_valid_imgsetids()
>>> # execute function
>>> new_imgsetid_list = copy_imagesets(ibs, imgsetid_list)
>>> # verify results
>>> result = str(ibs.get_imageset_text(new_imgsetid_list))
>>> assert [2] == list(set(map(len, ibs.get_image_imgsetids(ibs.get_valid_gids()))))
>>> print(result)
>>> ibs.delete_all_imagesets()
>>> ibs.compute_occurrences()
ibeis.other.ibsfuncs.create_new_imageset_from_images(ibs, gid_list, new_imgsetid=None)[source]
Parameters:gid_list (list) –

CommandLine:

python -m ibeis.other.ibsfuncs --test-create_new_imageset_from_images

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb('testdb1')
>>> gid_list = ibs.get_valid_gids()[::2]
>>> # execute function
>>> new_imgsetid = create_new_imageset_from_images(ibs, gid_list)
>>> # verify results
>>> result = new_imgsetid
>>> print(result)
ibeis.other.ibsfuncs.create_new_imageset_from_names(ibs, nid_list)[source]
Parameters:nid_list (list) –

CommandLine:

python -m ibeis.other.ibsfuncs --test-create_new_imageset_from_names

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb('testdb1')
>>> nid_list = ibs._get_all_known_nids()[0:2]
>>> # execute function
>>> new_imgsetid = ibs.create_new_imageset_from_names(nid_list)
>>> # clean up
>>> ibs.delete_imagesets(new_imgsetid)
>>> # verify results
>>> result = new_imgsetid
>>> print(result)
ibeis.other.ibsfuncs.dans_lists(ibs, positives=10, negatives=10, verbose=False)[source]
ibeis.other.ibsfuncs.delete_all_annotations(ibs)[source]

Carefull with this function. Annotations are not recomputable

ibeis.other.ibsfuncs.delete_all_chips(ibs)[source]
ibeis.other.ibsfuncs.delete_all_features(ibs)[source]
ibeis.other.ibsfuncs.delete_all_imagesets(ibs)[source]
ibeis.other.ibsfuncs.delete_all_recomputable_data(ibs)[source]

Delete all cached data including chips and imagesets

ibeis.other.ibsfuncs.delete_cache(ibs, delete_chips=False, delete_imagesets=False)[source]

Deletes the cache directory in the database directory. Can specify to delete encoutners and chips as well.

ibeis.other.ibsfuncs.delete_cachedir(ibs)[source]

Deletes the cache directory in the database directory.

(does not remove chips)

ibeis.other.ibsfuncs.delete_flann_cachedir(ibs)[source]
ibeis.other.ibsfuncs.delete_ibeis_database(dbdir)[source]
ibeis.other.ibsfuncs.delete_neighbor_cache(ibs)[source]
ibeis.other.ibsfuncs.delete_qres_cache(ibs)[source]
Parameters:ibs (IBEISController) – ibeis controller object

CommandLine:

python -m ibeis --tf delete_qres_cache
python -m ibeis --tf delete_qres_cache --db PZ_MTEST
python -m ibeis --tf delete_qres_cache --db PZ_Master1

Example

>>> # SCRIPT
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='testdb1')
>>> result = delete_qres_cache(ibs)
>>> print(result)
ibeis.other.ibsfuncs.delete_thumbnails(ibs)[source]
ibeis.other.ibsfuncs.detect_join_cases(ibs)[source]
Parameters:ibs (IBEISController) – ibeis controller object
Returns:qres_list - object of feature correspondences and scores
Return type:QueryResult

CommandLine:

python -m ibeis.other.ibsfuncs --test-detect_join_cases --show

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> # build test data
>>> ibs = ibeis.opendb('PZ_MTEST')
>>> # execute function
>>> cm_list = detect_join_cases(ibs)
>>> # verify results
>>> #result = str(qres_list)
>>> #print(result)
>>> ut.quit_if_noshow()
>>> import guitool
>>> from ibeis.gui import inspect_gui
>>> guitool.ensure_qapp()
>>> qres_wgt = inspect_gui.launch_review_matches_interface(qreq_, cm_list, filter_reviewed=False)
>>> qres_wgt.show()
>>> qres_wgt.raise_()
>>> guitool.qtapp_loop(qres_wgt)
ibeis.other.ibsfuncs.ensure_annotation_data(ibs, aid_list, chips=True, feats=True, featweights=False)[source]
ibeis.other.ibsfuncs.ensure_unix_gpaths(gpath_list)[source]

Asserts that all paths are given with forward slashes. If not it fixes them

ibeis.other.ibsfuncs.export_to_hotspotter(ibs)[source]
ibeis.other.ibsfuncs.filter_aids_count(ibs, aid_list=None, pre_unixtime_sort=True)[source]
ibeis.other.ibsfuncs.filter_aids_custom(ibs, aid_list)[source]
Parameters:
  • ibs (IBEISController) – ibeis controller object
  • aid_list (int) – list of annotation ids
Returns:

aid_list_

Return type:

list

CommandLine:

python -m ibeis.other.ibsfuncs --test-filter_aids_custom

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> # build test data
>>> ibs = ibeis.opendb('testdb2')
>>> aid_list = ibs.get_valid_aids()
>>> # execute function
>>> aid_list_ = filter_aids_custom(ibs, aid_list)
>>> # verify results
>>> result = str(aid_list_)
>>> print(result)
ibeis.other.ibsfuncs.filter_aids_to_quality(ibs, aid_list, minqual, unknown_ok=True)[source]
ibeis.other.ibsfuncs.filter_aids_to_species(ibs, aid_list, species)[source]
Parameters:
  • ibs (IBEISController) – ibeis controller object
  • aid_list (int) – list of annotation ids
  • species
Returns:

aid_list_

Return type:

list

CommandLine:

python -m ibeis.other.ibsfuncs --exec-filter_aids_to_species

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='testdb1')
>>> aid_list = ibs.get_valid_aids()
>>> species = ibeis.const.TEST_SPECIES.ZEB_GREVY
>>> aid_list_ = filter_aids_to_species(ibs, aid_list, species)
>>> result = 'aid_list_ = %r' % (aid_list_,)
>>> print(result)
aid_list_ = [9, 10]
ibeis.other.ibsfuncs.filter_aids_to_viewpoint(ibs, aid_list, valid_yaws, unknown_ok=True)[source]

Removes aids that do not have a valid yaw

TODO: rename to valid_viewpoint because this func uses category labels

valid_yaws = [‘primary’, ‘primary1’, ‘primary-1’]

ibeis.other.ibsfuncs.filter_aids_without_name(ibs, aid_list, invert=False)[source]

Remove aids without names

ibeis.other.ibsfuncs.filter_aids_without_timestamps(ibs, aid_list, invert=False)[source]

Removes aids without timestamps aid_list = ibs.get_valid_aids()

ibeis.other.ibsfuncs.filter_annots_using_minimum_timedelta(ibs, aid_list, min_timedelta)[source]

Uses a dynamic program to find the maximum number of annotations that are above the minimum timedelta requirement.

Parameters:
  • ibs (IBEISController) – ibeis controller object
  • aid_list
  • min_timedelta

CommandLine:

python -m ibeis.other.ibsfuncs --exec-filter_annots_using_minimum_timedelta
python -m ibeis.other.ibsfuncs --exec-filter_annots_using_minimum_timedelta --db PZ_Master1

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='PZ_MTEST')
>>> aid_list = ibs.get_valid_aids()
>>> aid_list = ibs.filter_aids_without_timestamps(aid_list)
>>> print('Before')
>>> ibs.print_annot_stats(aid_list, min_name_hourdist=True)
>>> min_timedelta = 60 * 60 * 24
>>> filtered_aids = filter_annots_using_minimum_timedelta(ibs, aid_list, min_timedelta)
>>> print('After')
>>> ibs.print_annot_stats(filtered_aids, min_name_hourdist=True)
>>> ut.quit_if_noshow()
>>> ibeis.other.dbinfo.hackshow_names(ibs, aid_list)
>>> ibeis.other.dbinfo.hackshow_names(ibs, filtered_aids)
>>> ut.show_if_requested()
ibeis.other.ibsfuncs.filter_gids_custom(ibs, gid_list)[source]
ibeis.other.ibsfuncs.filter_junk_annotations(ibs, aid_list)[source]

remove junk annotations from a list

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

filtered_aid_list

Return type:

list

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb('testdb1')
>>> aid_list = ibs.get_valid_aids()
>>> filtered_aid_list = filter_junk_annotations(ibs, aid_list)
>>> result = str(filtered_aid_list)
>>> print(result)
ibeis.other.ibsfuncs.filter_nids_custom(ibs, nid_list)[source]
ibeis.other.ibsfuncs.filterflags_unflat_aids_custom(ibs, aids_list)[source]
ibeis.other.ibsfuncs.find_unlabeled_name_members(ibs, **kwargs)[source]

Find annots where some members of a name have information but others do not.

Parameters:ibs (IBEISController) – ibeis controller object

CommandLine:

python -m ibeis.other.ibsfuncs --exec-find_unlabeled_name_members --qual

Example

>>> # SCRIPT
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='PZ_Master1')
>>> defaultdict = dict(ut.parse_func_kwarg_keys(find_unlabeled_name_members, with_vals=True))
>>> kwargs = ut.argparse_dict(defaultdict)
>>> result = find_unlabeled_name_members(ibs, **kwargs)
>>> print(result)
ibeis.other.ibsfuncs.fix_and_clean_database(ibs)[source]

Function to run all database cleanup scripts

Rename to run_cleanup_scripts

Break into two funcs:
run_cleanup_scripts run_fixit_scripts
CONSITENCY CHECKS TODO:
  • check that annotmatches marked as False do not have the same name for similar viewpoints.
  • check that photobombs are have different names
  • warn if scenery matches have the same name
ibeis.other.ibsfuncs.fix_exif_data(ibs, gid_list)[source]

TODO CALL SCRIPT

Parameters:
  • ibs (IBEISController) – ibeis controller object
  • gid_list (list) – list of image ids

CommandLine:

python -m ibeis.other.ibsfuncs --exec-fix_exif_data

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='lynx')
>>> gid_list = ibs.get_valid_gids()
>>> result = fix_exif_data(ibs, gid_list)
>>> print(result)
ibeis.other.ibsfuncs.fix_invalid_annotmatches(ibs)[source]
ibeis.other.ibsfuncs.fix_invalid_name_texts(ibs)[source]

Ensure that no name text is empty or ‘____’

Parameters:ibs (IBEISController) – ibeis controller object

CommandLine:

python -m ibeis.other.ibsfuncs --test-fix_invalid_names

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis  # NOQA
>>> # build test data
>>> ibs = ibeis.opendb('testdb1')
>>> # execute function
>>> result = fix_invalid_name_texts(ibs)
>>> # verify results
>>> print(result)

ibs.set_name_texts(nid_list[3], ‘____’) ibs.set_name_texts(nid_list[2], ‘’)

ibeis.other.ibsfuncs.fix_invalid_nids(ibs)[source]

Make sure that all rowids are greater than 0

We can only handle there being a name with rowid 0 if it is UNKNOWN. In this case we safely delete it, but anything more complicated needs to be handled anually

Parameters:ibs (IBEISController) – ibeis controller object

CommandLine:

python -m ibeis.other.ibsfuncs --test-fix_invalid_nids

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis  # NOQA
>>> # build test data
>>> ibs = ibeis.opendb('testdb1')
>>> # execute function
>>> result = fix_invalid_nids(ibs)
>>> # verify results
>>> print(result)
ibeis.other.ibsfuncs.fix_remove_visual_dupliate_annotations(ibs)[source]

depricate because duplicate visual_uuids are no longer allowed to be duplicates

Add to clean database?

removes visually duplicate annotations

Parameters:ibs (IBEISController) –

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis  # NOQA
>>> ibs = ibeis.opendb('GZ_ALL')
>>> fix_remove_visual_dupliate_annotations(ibs)
ibeis.other.ibsfuncs.fix_unknown_exemplars(ibs)[source]

Goes through all of the annotations, and sets their exemplar flag to 0 if it is associated with an unknown annotation

ibeis.other.ibsfuncs.fix_zero_features(ibs)[source]
ibeis.other.ibsfuncs.flag_aids_count(ibs, aid_list)[source]
Parameters:
  • ibs (IBEISController) – ibeis controller object
  • aid_list (int) – list of annotation ids
  • pre_unixtime_sort (bool) –
Returns:

Return type:

list

CommandLine:

python -m ibeis.other.ibsfuncs --test-flag_aids_count

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> # build test data
>>> ibs = ibeis.opendb('testdb1')
>>> aid_list = ibs.get_valid_aids()
>>> # execute function
>>> gzc_flag_list = flag_aids_count(ibs, aid_list)
>>> result = gzc_flag_list
>>> # verify results
>>> print(result)
[False, True, False, False, True, False, True, True, False, True, False, True, True]
ibeis.other.ibsfuncs.get_aidpair_truths(ibs, aid1_list, aid2_list)[source]

Uses NIDS to verify truth

Parameters:
  • ibs (IBEISController) – ibeis controller object
  • aid1_list (list) –
  • aid2_list (list) –
Returns:

truth

Return type:

list[bool]

CommandLine:

python -m ibeis.other.ibsfuncs --test-get_aidpair_truths

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> # build test data
>>> ibs = ibeis.opendb('testdb1')
>>> aid1_list = ibs.get_valid_aids()
>>> aid2_list = ut.list_roll(ibs.get_valid_aids(), -1)
>>> # execute function
>>> truth = get_aidpair_truths(ibs, aid1_list, aid2_list)
>>> # verify results
>>> result = str(truth)
>>> print(result)
ibeis.other.ibsfuncs.get_aids_with_groundtruth(ibs)[source]

returns aids with valid groundtruth

ibeis.other.ibsfuncs.get_annot_bbox_area(ibs, aid_list)[source]
ibeis.other.ibsfuncs.get_annot_been_adjusted(ibs, aid_list)[source]

Returns if a bounding box has been adjusted from defaults set in use_images_as_annotations Very hacky very heurstic.

ibeis.other.ibsfuncs.get_annot_custom_filterflags(ibs, aid_list)[source]
ibeis.other.ibsfuncs.get_annot_encounter_text(ibs, aids)[source]

Encounter identifier for annotations

ibeis.other.ibsfuncs.get_annot_fgweights_subset(ibs, aid_list, fxs_list, config2_=None)[source]
ibeis.other.ibsfuncs.get_annot_info(ibs, aid_list, default=False, reference_aid=None, **kwargs)[source]
Parameters:
  • ibs (ibeis.IBEISController) – ibeis controller object
  • aid_list (list) – list of annotation rowids
  • default (bool) – (default = False)
Returns:

infodict_list

Return type:

list

CommandLine:

python -m ibeis.other.ibsfuncs --exec-get_annot_info --tb

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='testdb1')
>>> aid_list = ibs.get_valid_aids()[0:2]
>>> default = True
>>> infodict_list = ibs.get_annot_info(1, default)
>>> result = ('infodict_list = %s' % (ut.obj_str(infodict_list, nl=4),))
>>> print(result)
ibeis.other.ibsfuncs.get_annot_intermediate_viewpoint_stats(ibs, aids, size=2)[source]
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> aids = available_aids
ibeis.other.ibsfuncs.get_annot_is_hard(ibs, aid_list)[source]
CmdLine:
./dev.py –cmd –db PZ_Mothers
Parameters:
Returns:

is_hard_list

Return type:

list

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis  # NOQA
>>> ibs = ibeis.opendb('testdb1')
>>> aid_list = ibs.get_valid_aids()[0::2]
>>> is_hard_list = get_annot_is_hard(ibs, aid_list)
>>> result = str(is_hard_list)
>>> print(result)
[False, False, False, False, False, False, False]
ibeis.other.ibsfuncs.get_annot_lazy_dict(ibs, aid, config2_=None)[source]
Parameters:
  • ibs (ibeis.IBEISController) – image analysis api
  • aid (int) – annotation id
  • config2 (dict) – (default = None)
Returns:

metadata

Return type:

ut.LazyDict

CommandLine:

python -m ibeis.other.ibsfuncs --exec-get_annot_lazy_dict --show

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='testdb1')
>>> aid = 1
>>> config2_ = None
>>> metadata = get_annot_lazy_dict(ibs, aid, config2_)
>>> result = ('metadata = %s' % (ut.repr3(metadata),))
>>> print(result)
ibeis.other.ibsfuncs.get_annot_lazy_dict2(ibs, aid, config=None)[source]
Parameters:
  • ibs (ibeis.IBEISController) – image analysis api
  • aid (int) – annotation id
  • config (dict) – (default = None)
Returns:

metadata

Return type:

ut.LazyDict

CommandLine:

python -m ibeis.other.ibsfuncs --exec-get_annot_lazy_dict2 --show

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='testdb1')
>>> aid = 1
>>> config = {'dim_size': 450}
>>> metadata = get_annot_lazy_dict2(ibs, aid, config)
>>> result = ('metadata = %s' % (ut.repr3(metadata),))
>>> print(result)
ibeis.other.ibsfuncs.get_annot_occurrence_text(ibs, aids)[source]

Occurrence identifier for annotations

ibeis.other.ibsfuncs.get_annot_pair_lazy_dict(ibs, qaid, daid, qconfig2_=None, dconfig2_=None)[source]
Parameters:
  • ibs (IBEISController) – ibeis controller object
  • qaid (int) – query annotation id
  • daid
  • qconfig2 (dict) – (default = None)
  • dconfig2 (dict) – (default = None)

CommandLine:

python -m ibeis.other.ibsfuncs --exec-get_annot_pair_lazy_dict

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='testdb1')
>>> qaid, daid = ibs.get_valid_aids()[0:2]
>>> qconfig2_ = None
>>> dconfig2_ = None
>>> result = get_annot_pair_lazy_dict(ibs, qaid, daid, qconfig2_, dconfig2_)
>>> print(result)
ibeis.other.ibsfuncs.get_annot_per_name_stats(ibs, aid_list)[source]

stats about this set of aids

ibeis.other.ibsfuncs.get_annot_primary_imageset(ibs, aid_list=None)[source]
ibeis.other.ibsfuncs.get_annot_qual_stats(ibs, aid_list)[source]
ibeis.other.ibsfuncs.get_annot_quality_viewpoint_subset(ibs, aid_list=None, annots_per_view=2, verbose=False)[source]

CommandLine:

python -m ibeis.other.ibsfuncs --exec-get_annot_quality_viewpoint_subset --show

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb('testdb2')
>>> aid_list = ibs.get_valid_aids()
>>> annots_per_view = 2
>>> new_aid_list, new_flag_list = get_annot_quality_viewpoint_subset(ibs)
>>> result = sum(new_flag_list)
>>> print(result)
38
ibeis.other.ibsfuncs.get_annot_stats_dict(ibs, aids, prefix=u'', forceall=False, old=True, **kwargs)[source]

stats for a set of annots

Parameters:
  • ibs (ibeis.IBEISController) – ibeis controller object
  • aids (list) – list of annotation rowids
  • prefix (str) – (default = ‘’)
Kwargs:
hashid, per_name, per_qual, per_vp, per_name_vpedge, per_image, min_name_hourdist
Returns:aid_stats_dict
Return type:dict

CommandLine:

python -m ibeis.other.ibsfuncs --exec-get_annot_stats_dict
python -m ibeis.other.ibsfuncs --exec-get_annot_stats_dict --db PZ_Master1 --per_name_vpedge=True
python -m ibeis.other.ibsfuncs --exec-get_annot_stats_dict --db PZ_Master1 --min_name_hourdist=True
python -m ibeis.other.ibsfuncs --exec-get_annot_stats_dict --db GZ_ALL --min_name_hourdist=True --all
python -m ibeis.other.ibsfuncs --exec-get_annot_stats_dict --db PZ_Master1 --min_name_hourdist=True --all
python -m ibeis.other.ibsfuncs --exec-get_annot_stats_dict --db NNP_MasterGIRM_core --min_name_hourdist=True --all

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='testdb1')
>>> aids = ibs.get_valid_aids()
>>> prefix = ''
>>> kwkeys = ut.parse_func_kwarg_keys(get_annot_stats_dict)
>>> #default = True if ut.get_argflag('--all') else None
>>> default = None if ut.get_argflag('--notall') else True
>>> kwargs = ut.argparse_dict(dict(zip(kwkeys, [default] * len(kwkeys))))
>>> print('kwargs = %r' % (kwargs,))
>>> aid_stats_dict = get_annot_stats_dict(ibs, aids, prefix, **kwargs)
>>> result = ('aid_stats_dict = %s' % (ut.dict_str(aid_stats_dict, strvals=True, nl=True),))
>>> print(result)
ibeis.other.ibsfuncs.get_annot_vecs_cache(ibs, aids)[source]

When you have a list with duplicates and you dont want to copy data creates a reference to each data object indexed by a dict

ibeis.other.ibsfuncs.get_annot_vecs_subset(ibs, aid_list, fxs_list, config2_=None)[source]
ibeis.other.ibsfuncs.get_annot_yaw_stats(ibs, aid_list)[source]
ibeis.other.ibsfuncs.get_annotconfig_stats(ibs, qaids, daids, verbose=True, combined=False, **kwargs)[source]

Gets statistics about a query / database set of annotations

USEFUL DEVELOPER FUNCTION

TODO: this function should return non-string values in dictionaries. The print function should do string conversions

Parameters:
  • ibs (IBEISController) – ibeis controller object
  • qaids (list) – query annotation ids
  • daids (list) – database annotation ids
SeeAlso:
ibeis.dbinfo.print_qd_info ibs.get_annot_stats_dict ibs.print_annotconfig_stats(qaid_list, daid_list)

CommandLine:

python -m ibeis.other.ibsfuncs --exec-get_annotconfig_stats --db PZ_MTEST -a default
python -m ibeis.other.ibsfuncs --exec-get_annotconfig_stats --db testdb1  -a default
python -m ibeis.other.ibsfuncs --exec-get_annotconfig_stats --db PZ_MTEST -a controlled
python -m ibeis.other.ibsfuncs --exec-get_annotconfig_stats --db PZ_FlankHack -a default:qaids=allgt
python -m ibeis.other.ibsfuncs --exec-get_annotconfig_stats --db PZ_MTEST -a controlled:per_name=2,min_gt=4

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> from ibeis.init import main_helpers
>>> kwargs = {'per_enc': True, 'enc_per_name': True}
>>> ibs, qaids, daids = main_helpers.testdata_expanded_aids(defaultdb='testdb1')
>>> _ = get_annotconfig_stats(ibs, qaids, daids, **kwargs)
ibeis.other.ibsfuncs.get_annots_per_name_stats(ibs, aid_list, **kwargs)[source]
ibeis.other.ibsfuncs.get_consecutive_newname_list_via_species(ibs, imgsetid=None)[source]

Just creates the nams, but does not set them

Parameters:ibs (IBEISController) – ibeis controller object

CommandLine:

python -m ibeis.other.ibsfuncs --test-get_consecutive_newname_list_via_species

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> # build test data
>>> ibs = ibeis.opendb('testdb1')
>>> ibs._clean_species()
>>> # execute function
>>> imgsetid = None
>>> new_nid_list, new_name_list = get_consecutive_newname_list_via_species(ibs, imgsetid=imgsetid)
>>> result = ut.list_str((new_nid_list, new_name_list))
>>> # verify results
>>> print(result)
(
    [1, 2, 3, 4, 5, 6, 7],
    ['IBEIS_PZ_0001', 'IBEIS_PZ_0002', 'IBEIS_UNKNOWN_0001', 'IBEIS_UNKNOWN_0002', 'IBEIS_GZ_0001', 'IBEIS_PB_0001', 'IBEIS_UNKNOWN_0003'],
)

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> # build test data
>>> ibs = ibeis.opendb('testdb1')
>>> ibs._clean_species()
>>> ibs.delete_all_imagesets()
>>> ibs.compute_occurrences()
>>> # execute function
>>> imgsetid = ibs.get_valid_imgsetids()[1]
>>> new_nid_list, new_name_list = get_consecutive_newname_list_via_species(ibs, imgsetid=imgsetid)
>>> result = ut.list_str((new_nid_list, new_name_list))
>>> # verify results
>>> print(result)
(
    [4, 5, 6, 7],
    ['IBEIS_UNKNOWN_Occurrence_1_0001', 'IBEIS_GZ_Occurrence_1_0001', 'IBEIS_PB_Occurrence_1_0001', 'IBEIS_UNKNOWN_Occurrence_1_0002'],
)
ibeis.other.ibsfuncs.get_database_species(ibs, aid_list=None)[source]

CommandLine:

python -m ibeis.other.ibsfuncs --test-get_database_species
Example1:
>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis  # NOQA
>>> ibs = ibeis.opendb('testdb1')
>>> result = ut.list_str(ibs.get_database_species(), nl=False)
>>> print(result)
['____', 'bear_polar', 'zebra_grevys', 'zebra_plains']
Example2:
>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis  # NOQA
>>> ibs = ibeis.opendb('PZ_MTEST')
>>> result = ut.list_str(ibs.get_database_species(), nl=False)
>>> print(result)
['zebra_plains']
ibeis.other.ibsfuncs.get_database_species_count(ibs, aid_list=None)[source]

CommandLine:

python -m ibeis.other.ibsfuncs --test-get_database_species_count

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis  # NOQA
>>> #print(ut.dict_str(ibeis.opendb('PZ_Master0').get_database_species_count()))
>>> ibs = ibeis.opendb('testdb1')
>>> result = ut.dict_str(ibs.get_database_species_count(), nl=False)
>>> print(result)
{'____': 3, 'bear_polar': 2, 'zebra_grevys': 2, 'zebra_plains': 6}
ibeis.other.ibsfuncs.get_dbinfo_str(ibs)[source]
ibeis.other.ibsfuncs.get_dbname_alias(ibs)[source]

convinience for plots

ibeis.other.ibsfuncs.get_dbnotes(ibs)[source]

sets notes for an entire database

ibeis.other.ibsfuncs.get_dbnotes_fpath(ibs, ensure=False)[source]
ibeis.other.ibsfuncs.get_dominant_species(ibs, aid_list)[source]
Parameters:aid_list (int) – list of annotation ids

CommandLine:

python -m ibeis.other.ibsfuncs --test-get_dominant_species

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb('testdb1')
>>> aid_list = ibs.get_valid_aids()
>>> result = get_dominant_species(ibs, aid_list)
>>> print(result)
zebra_plains
ibeis.other.ibsfuncs.get_easy_annot_rowids(ibs)[source]
ibeis.other.ibsfuncs.get_empty_gids(ibs, imgsetid=None)[source]

returns gid list without any chips

ibeis.other.ibsfuncs.get_extended_viewpoints(base_yaw_text, towards=u'front', num1=0, num2=None, include_base=True)[source]

Given a viewpoint returns the acceptable viewpoints around it

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> yaw_text_list = ['left', 'right', 'back', 'front']
>>> towards = 'front'
>>> num1 = 1
>>> num2 = 0
>>> include_base = False
>>> extended_yaws_list = [get_extended_viewpoints(base_yaw_text, towards, num1, num2, include_base)
>>>                       for base_yaw_text in yaw_text_list]
>>> result = ('extended_yaws_list = %s' % (ut.list_str(extended_yaws_list),))
>>> print(result)
ibeis.other.ibsfuncs.get_hard_annot_rowids(ibs)[source]
ibeis.other.ibsfuncs.get_image_annotation_bboxes(ibs, gid_list)[source]
ibeis.other.ibsfuncs.get_image_annotation_thetas(ibs, gid_list)[source]
ibeis.other.ibsfuncs.get_image_time_statstr(ibs, gid_list=None)[source]
ibeis.other.ibsfuncs.get_infostr(ibs)[source]

Returns sort printable database information

Parameters:ibs (IBEISController) – ibeis controller object
Returns:infostr
Return type:str
ibeis.other.ibsfuncs.get_match_text(ibs, aid1, aid2)[source]
ibeis.other.ibsfuncs.get_match_truth(ibs, aid1, aid2)[source]
ibeis.other.ibsfuncs.get_missing_gids(ibs, gid_list=None)[source]

Finds gids with broken links to the original data.

Parameters:
  • ibs (IBEISController) – ibeis controller object
  • gid_list (list) – (default = None)

CommandLine:

python -m ibeis.other.ibsfuncs --exec-get_missing_gids --db GZ_Master1

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='testdb1')
>>> #ibs = ibeis.opendb('GZ_Master1')
>>> gid_list = ibs.get_valid_gids()
>>> bad_gids = ibs.get_missing_gids(gid_list)
>>> print('#bad_gids = %r / %r' % (len(bad_gids), len(gid_list)))
ibeis.other.ibsfuncs.get_name_gps_tracks(ibs, nid_list=None, aid_list=None)[source]

CommandLine:

python -m ibeis.other.ibsfuncs --test-get_name_gps_tracks

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> # build test data
>>> #ibs = ibeis.opendb('PZ_Master0')
>>> ibs = ibeis.opendb('testdb1')
>>> #nid_list = ibs.get_valid_nids()
>>> aid_list = ibs.get_valid_aids()
>>> nid_list, gps_track_list, aid_track_list = ibs.get_name_gps_tracks(aid_list=aid_list)
>>> nonempty_list = list(map(lambda x: len(x) > 0, gps_track_list))
>>> ut.compress(nid_list, nonempty_list)
>>> ut.compress(gps_track_list, nonempty_list)
>>> ut.compress(aid_track_list, nonempty_list)
>>> result = str(aid_track_list)
>>> print(result)
[[11], [], [4], [1], [2, 3], [5, 6], [7], [8], [10], [12], [13]]
ibeis.other.ibsfuncs.get_name_hourdiffs(ibs, nid_list)[source]

CommandLine:

python -m ibeis.other.ibsfuncs --test-get_name_hourdiffs

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> ibs = testdata_ibs('NNP_Master3')
>>> nid_list = ibs.filter_nids_custom(ibs._get_all_known_nids())
>>> hourdiffs_list = ibs.get_name_hourdiffs(nid_list)
>>> result = hourdiffs_list
>>> print(hourdiffs_list)
ibeis.other.ibsfuncs.get_name_max_hourdiff(ibs, nid_list)[source]
ibeis.other.ibsfuncs.get_name_max_speed(ibs, nid_list)[source]

CommandLine:

python -m ibeis.other.ibsfuncs --test-get_name_max_speed

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> ibs = testdata_ibs('NNP_Master3')
>>> nid_list = ibs.filter_nids_custom(ibs._get_all_known_nids())
>>> maxspeed_list = ibs.get_name_max_speed(nid_list)
>>> result = maxspeed_list
>>> print(maxspeed_list)
ibeis.other.ibsfuncs.get_name_speeds(ibs, nid_list)[source]

CommandLine:

python -m ibeis.other.ibsfuncs --test-get_name_speeds

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> ibs = testdata_ibs('NNP_Master3')
>>> nid_list = get_valid_multiton_nids_custom(ibs)
>>> speeds_list = get_name_speeds(ibs, nid_list)
>>> result = str(speeds_list)
>>> print(result)
ibeis.other.ibsfuncs.get_num_annots_per_name(ibs, aid_list)[source]

Returns the number of annots per name (IN THIS LIST)

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

CommandLine:

python -m ibeis.other.ibsfuncs --exec-get_num_annots_per_name
python -m ibeis.other.ibsfuncs --exec-get_num_annots_per_name --db PZ_Master1

Example

>>> # UNSTABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='testdb1')
>>> aid_list = ibs.get_valid_aids(is_known=True)
>>> num_annots_per_name, unique_nids = get_num_annots_per_name(ibs, aid_list)
>>> per_name_hist = ut.dict_hist(num_annots_per_name)
>>> items = per_name_hist.items()
>>> items = sorted(items)[::-1]
>>> key_list = ut.get_list_column(items, 0)
>>> val_list = ut.get_list_column(items, 1)
>>> min_per_name = dict(zip(key_list, np.cumsum(val_list)))
>>> result = ('per_name_hist = %s' % (ut.dict_str(per_name_hist),))
>>> print(result)
>>> print('min_per_name = %s' % (ut.dict_str(min_per_name),))
per_name_hist = {
    1: 5,
    2: 2,
}
ibeis.other.ibsfuncs.get_primary_database_species(ibs, aid_list=None)[source]
Parameters:aid_list (list) – list of annotation ids (default = None)

CommandLine:

python -m ibeis.other.ibsfuncs --test-get_primary_database_species

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='testdb1')
>>> aid_list = None
>>> primary_species = get_primary_database_species(ibs, aid_list)
>>> result = primary_species
>>> print('primary_species = %r' % (primary_species,))
>>> print(result)
zebra_plains
ibeis.other.ibsfuncs.get_primary_species_viewpoint(species, plus=0)[source]
Parameters:
Returns:

primary_viewpoint

Return type:

str

CommandLine:

python -m ibeis.other.ibsfuncs --exec-get_primary_species_viewpoint

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> species = ibeis.const.TEST_SPECIES.ZEB_PLAIN
>>> aid_subset = get_primary_species_viewpoint(species, 0)
>>> result = ('aid_subset = %s' % (str(aid_subset),))
>>> print(result)
aid_subset = left
ibeis.other.ibsfuncs.get_prioritized_name_subset(ibs, aid_list=None, annots_per_name=None)[source]

TODO: this needs to be integrated more cleanly with a nonhacky way of getting a subset of exemplars. Currently ther is duplicate code in guiback and here to use left side only when custom filter is on.

CommandLine:

python -m ibeis.other.ibsfuncs --test-get_prioritized_name_subset

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb('testdb2')
>>> aid_list = ibs.get_valid_aids()
>>> annots_per_name = 2
>>> aid_subset = get_prioritized_name_subset(ibs, aid_list, annots_per_name)
>>> qualtexts = ibs.get_annot_quality_texts(aid_subset)
>>> yawtexts = ibs.get_annot_yaw_texts(aid_subset)
>>> assert 'junk' not in qualtexts
>>> assert 'right' not in yawtexts
>>> result = len(aid_subset)
>>> print(result)
28
Exeample:
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb('testdb2')
>>> aid_list = ibs.get_valid_aids()
>>> aid_list = ut.compress(aid_list, ibs.is_aid_unknown(aid_list))
>>> annots_per_name = 2
>>> aid_subset = get_prioritized_name_subset(ibs, aid_list, annots_per_name)
>>> qualtexts = ibs.get_annot_quality_texts(aid_list)
>>> yawtexts = ibs.get_annot_yaw_texts(aid_list)
ibeis.other.ibsfuncs.get_quality_filterflags(ibs, aid_list, minqual, unknown_ok=True)[source]
Parameters:
  • ibs (IBEISController) – ibeis controller object
  • aid_list (int) – list of annotation ids
  • minqual (str) – qualtext
  • unknown_ok (bool) – (default = False)
Returns:

qual_flags

Return type:

iter

CommandLine:

python -m ibeis.other.ibsfuncs --exec-get_quality_filterflags

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='testdb1')
>>> aid_list = ibs.get_valid_aids()[0:20]
>>> minqual = 'junk'
>>> unknown_ok = False
>>> qual_flags = list(get_quality_filterflags(ibs, aid_list, minqual, unknown_ok))
>>> result = ('qual_flags = %s' % (str(qual_flags),))
>>> print(result)
ibeis.other.ibsfuncs.get_quality_viewpoint_filterflags(ibs, aid_list, minqual, valid_yaws)[source]
ibeis.other.ibsfuncs.get_special_imgsetids(ibs)[source]
ibeis.other.ibsfuncs.get_species_dbs(species_prefix)[source]
ibeis.other.ibsfuncs.get_title(ibs)[source]
ibeis.other.ibsfuncs.get_two_annots_per_name_and_singletons(ibs, onlygt=False)[source]

makes controlled subset of data

DEPRICATE

CONTROLLED TEST DATA

Build data for experiment that tries to rule out as much bad data as possible

Returns a controlled set of annotations that conforms to
  • number of annots per name
  • uniform species
  • viewpoint restrictions
  • quality restrictions
  • time delta restrictions

CommandLine:

python -m ibeis.other.ibsfuncs --test-get_two_annots_per_name_and_singletons
python -m ibeis.other.ibsfuncs --test-get_two_annots_per_name_and_singletons --db GZ_ALL
python -m ibeis.other.ibsfuncs --test-get_two_annots_per_name_and_singletons --db PZ_Master0 --onlygt

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='PZ_Master0')
>>> aid_subset = get_two_annots_per_name_and_singletons(ibs, onlygt=ut.get_argflag('--onlygt'))
>>> ibeis.other.dbinfo.get_dbinfo(ibs, aid_list=aid_subset, with_contrib=False)
>>> result = str(aid_subset)
>>> print(result)
ibeis.other.ibsfuncs.get_unflat_annots_hourdists_list(ibs, aids_list)[source]

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> ibs = testdata_ibs('NNP_Master3')
>>> nid_list = get_valid_multiton_nids_custom(ibs)
>>> aids_list_ = ibs.get_name_aids(nid_list)
>>> aids_list = [ibs.filter_aids_custom(aids) for aids in aids_list_]
ibeis.other.ibsfuncs.get_unflat_annots_kmdists_list(ibs, aids_list)[source]
ibeis.other.ibsfuncs.get_unflat_annots_speeds_list(ibs, aids_list)[source]
ibeis.other.ibsfuncs.get_unflat_annots_timedelta_list(ibs, aids_list)[source]

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> ibs = testdata_ibs('NNP_Master3')
>>> nid_list = get_valid_multiton_nids_custom(ibs)
>>> aids_list_ = ibs.get_name_aids(nid_list)
>>> aids_list = [ibs.filter_aids_custom(aids) for aids in aids_list_]
ibeis.other.ibsfuncs.get_ungrouped_gids(ibs)[source]

CommandLine:

python -m ibeis.other.ibsfuncs --test-get_ungrouped_gids

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis  # NOQA
>>> # build test data
>>> ibs = ibeis.opendb('testdb1')
>>> ibs.delete_all_imagesets()
>>> ibs.compute_occurrences()
>>> ibs.update_special_imagesets()
>>> # Now we want to remove some images from a non-special imageset
>>> nonspecial_imgsetids = [i for i in ibs.get_valid_imgsetids() if i not in ibs.get_special_imgsetids()]
>>> print("Nonspecial EIDs %r" % nonspecial_imgsetids)
>>> images_to_remove = ibs.get_imageset_gids(nonspecial_imgsetids[0:1])[0][0:1]
>>> print("Removing %r" % images_to_remove)
>>> ibs.unrelate_images_and_imagesets(images_to_remove,nonspecial_imgsetids[0:1] * len(images_to_remove))
>>> ibs.update_special_imagesets()
>>> ungr_imgsetid = ibs.get_imageset_imgsetids_from_text(const.UNGROUPED_IMAGES_IMAGESETTEXT)
>>> print("Ungrouped gids %r" % ibs.get_ungrouped_gids())
>>> print("Ungrouped imgsetid %d contains %r" % (ungr_imgsetid, ibs.get_imageset_gids([ungr_imgsetid])))
>>> ungr_gids = ibs.get_imageset_gids([ungr_imgsetid])[0]
>>> assert(sorted(images_to_remove) == sorted(ungr_gids))
ibeis.other.ibsfuncs.get_valid_multiton_nids_custom(ibs)[source]
ibeis.other.ibsfuncs.get_viewpoint_filterflags(ibs, aid_list, valid_yaws, unknown_ok=True)[source]
Parameters:
  • ibs (IBEISController) – ibeis controller object
  • aid_list (int) – list of annotation ids
  • valid_yaws
  • unknown_ok (bool) – (default = True)
Returns:

aid_list - list of annotation ids

Return type:

int

CommandLine:

python -m ibeis.other.ibsfuncs --exec-get_viewpoint_filterflags
python -m ibeis.other.ibsfuncs --exec-get_viewpoint_filterflags --db NNP_Master3

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='testdb1')
>>> aid_list = ibs.get_valid_aids()[0:20]
>>> valid_yaws = None
>>> unknown_ok = False
>>> yaw_flags = list(get_viewpoint_filterflags(ibs, aid_list, valid_yaws, unknown_ok))
>>> result = ('yaw_flags = %s' % (str(yaw_flags),))
>>> print(result)
ibeis.other.ibsfuncs.get_yaw_viewtexts(yaw_list)[source]
Parameters:yaw_list (list of angles) –

CommandLine:

python -m ibeis.other.ibsfuncs --test-get_yaw_viewtexts
TODO:

rhombicubeoctehedron

https://en.wikipedia.org/wiki/Rhombicuboctahedron

up, down, front, left, back, right, front-left, back-left, back-right, front-right, up-front, up-left, up-back, up-right, up-front-left, up-back-left, up-back-right, up-front-right, down-front, down-left, down-back, down-right, down-front-left, down-back-left, down-back-right, down-front-right,

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import numpy as np
>>> # build test data
>>> yaw_list = [0.0, np.pi / 2, np.pi / 4, np.pi, 3.15, -.4, -8, .2, 4, 7, 20, None]
>>> # execute function
>>> text_list = get_yaw_viewtexts(yaw_list)
>>> result = ut.list_str(text_list, nl=False)
>>> # verify results
>>> print(result)
['right', 'front', 'frontright', 'left', 'left', 'backright', 'back', 'right', 'backleft', 'frontright', 'frontright', None]
ibeis.other.ibsfuncs.group_annots_by_known_names(ibs, aid_list, checks=True)[source]

FIXME; rectify this #>>> import ibeis # NOQA

CommandLine:

python -m ibeis.other.ibsfuncs --test-group_annots_by_known_names

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(db='testdb1')
>>> aid_list = ibs.get_valid_aids()
>>> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
>>> known_aids_list, unknown_aids = group_annots_by_known_names(ibs, aid_list)
>>> result = str(known_aids_list) + '\n'
>>> result += str(unknown_aids)
>>> print(result)
[[2, 3], [5, 6], [7], [8], [10], [12], [13]]
[11, 9, 4, 1]
ibeis.other.ibsfuncs.group_annots_by_known_names_nochecks(ibs, aid_list)[source]
ibeis.other.ibsfuncs.group_annots_by_multi_prop(ibs, aids, getter_list)[source]

Performs heirachical grouping of annotations based on properties

Parameters:
  • ibs (IBEISController) – ibeis controller object
  • aids (list) – list of annotation rowids
  • getter_list (list) –
Returns:

multiprop2_aids

Return type:

dict

CommandLine:

python -m ibeis.other.ibsfuncs --exec-group_annots_by_multi_prop --db PZ_Master1 --props=yaw_texts,name_rowids --keys1 frontleft
python -m ibeis.other.ibsfuncs --exec-group_annots_by_multi_prop

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='testdb1')
>>> aids = ibs.get_valid_aids(is_known=True)
>>> #getter_list = [ibs.get_annot_name_rowids, ibs.get_annot_yaw_texts]
>>> props = ut.get_argval('--props', type_=list, default=['yaw_texts', 'name_rowids'])
>>> getter_list = [getattr(ibs, 'get_annot_' + prop) for prop in props]
>>> print('getter_list = %r' % (getter_list,))
>>> #getter_list = [ibs.get_annot_yaw_texts, ibs.get_annot_name_rowids]
>>> multiprop2_aids = group_annots_by_multi_prop(ibs, aids, getter_list)
>>> get_dict_values = lambda x: list(x.values())
>>> # a bit convoluted
>>> keys1 = ut.get_argval('--keys1', type_=list, default=list(multiprop2_aids.keys()))
>>> multiprop2_num_aids = ut.hmap_vals(len, multiprop2_aids)
>>> prop2_num_aids = ut.hmap_vals(get_dict_values, multiprop2_num_aids, max_depth=len(props) - 2)
>>> #prop2_num_aids_stats = ut.hmap_vals(ut.get_stats, prop2_num_aids)
>>> prop2_num_aids_hist = ut.hmap_vals(ut.dict_hist, prop2_num_aids)
>>> prop2_num_aids_cumhist = ut.map_dict_vals(ut.dict_hist_cumsum, prop2_num_aids_hist)
>>> print('prop2_num_aids_hist[%s] = %s' % (keys1,  ut.dict_str(ut.dict_subset(prop2_num_aids_hist, keys1))))
>>> print('prop2_num_aids_cumhist[%s] = %s' % (keys1,  ut.dict_str(ut.dict_subset(prop2_num_aids_cumhist, keys1))))
ibeis.other.ibsfuncs.group_annots_by_name(ibs, aid_list, distinguish_unknowns=True)[source]

This function is probably the fastest of its siblings

Parameters:
  • ibs (IBEISController) – ibeis controller object
  • aid_list (list) –
  • distinguish_unknowns (bool) –
Returns:

grouped_aids_, unique_nids

Return type:

tuple

CommandLine:

python -m ibeis.other.ibsfuncs --test-group_annots_by_name

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> # build test data
>>> ibs = ibeis.opendb('testdb1')
>>> aid_list = ibs.get_valid_aids()
>>> distinguish_unknowns = True
>>> # execute function
>>> grouped_aids_, unique_nids = group_annots_by_name(ibs, aid_list, distinguish_unknowns)
>>> result = str([aids.tolist() for aids in grouped_aids_])
>>> result += '\n' + str(unique_nids.tolist())
>>> # verify results
>>> print(result)
[[11], [9], [4], [1], [2, 3], [5, 6], [7], [8], [10], [12], [13]]
[-11, -9, -4, -1, 1, 2, 3, 4, 5, 6, 7]
ibeis.other.ibsfuncs.group_annots_by_name_dict(ibs, aids)[source]
ibeis.other.ibsfuncs.group_annots_by_prop(ibs, aids, getter_func)[source]
ibeis.other.ibsfuncs.group_annots_by_prop_and_name(ibs, aids, getter_func)[source]
ibeis.other.ibsfuncs.group_prop_edges(prop2_nid2_aids, prop_basis, size=2, wrap=True)[source]

from ibeis.other.ibsfuncs import * # NOQA getter_func = ibs.get_annot_yaw_texts prop_basis = list(const.VIEWTEXT_TO_YAW_RADIANS.keys()) size = 2 wrap = True

ibeis.other.ibsfuncs.inspect_nonzero_yaws(ibs)[source]

python dev.py –dbdir /raid/work2/Turk/PZ_Master –cmd –show

ibeis.other.ibsfuncs.is_aid_unknown(ibs, aid_list)[source]

Returns if an annotation has been given a name (even if that name is temporary)

ibeis.other.ibsfuncs.is_nid_unknown(ibs, nid_list)[source]
ibeis.other.ibsfuncs.is_special_imageset(ibs, imgsetid_list)[source]
ibeis.other.ibsfuncs.lookup_annot_vecs_subset(ibs, unflat_aids, unflat_fxs, annots=None, config2_=None)[source]

unflat_aids = naids_list unflat_fxs = nfxs_list annots = data_annots config2_ = data_config2_

unflat_aids = cm.filtnorm_aids[0] unflat_fxs = cm.filtnorm_fxs[0]

ibeis.other.ibsfuncs.make_imagesettext_list(imgsetid_list, occur_cfgstr)[source]
ibeis.other.ibsfuncs.make_next_imageset_text(ibs)[source]

Creates what the next imageset name would be but does not add it to the database

Parameters:ibs (IBEISController) – ibeis controller object

CommandLine:

python -m ibeis.other.ibsfuncs --test-make_next_imageset_text

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb('testdb1')
>>> new_imagesettext = make_next_imageset_text(ibs)
>>> result = new_imagesettext
>>> print(result)
New ImageSet 0
ibeis.other.ibsfuncs.make_next_name(ibs, num=None, str_format=2, species_text=None, location_text=None)[source]

Creates a number of names which are not in the database, but does not add them

Parameters:
  • ibs (IBEISController) – ibeis controller object
  • num (None) –
  • str_format (int) – either 1 or 2
Returns:

next_name

Return type:

str

CommandLine:

python -m ibeis.other.ibsfuncs --test-make_next_name

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> # build test data
>>> ibs1 = ibeis.opendb('testdb1')
>>> ibs2 = ibeis.opendb('PZ_MTEST')
>>> ibs3 = ibeis.opendb('NAUT_test')
>>> #ibs5 = ibeis.opendb('GIR_Tanya')
>>> ibs1._clean_species()
>>> ibs2._clean_species()
>>> ibs3._clean_species()
>>> num = None
>>> str_format = 2
>>> # execute function
>>> next_name1 = make_next_name(ibs1, num, str_format)
>>> next_name2 = make_next_name(ibs2, num, str_format)
>>> next_name3 = make_next_name(ibs3, num, str_format)
>>> next_name4 = make_next_name(ibs1, num, str_format, const.TEST_SPECIES.ZEB_GREVY)
>>> name_list = [next_name1, next_name2, next_name3, next_name4]
>>> next_name_list1 = make_next_name(ibs2, 5, str_format)
>>> temp_nids = ibs2.add_names(['IBEIS_PZ_0045', 'IBEIS_PZ_0048'])
>>> next_name_list2 = make_next_name(ibs2, 5, str_format)
>>> ibs2.delete_names(temp_nids)
>>> next_name_list3 = make_next_name(ibs2, 5, str_format)
>>> # verify results
>>> # FIXME: nautiluses are not working right
>>> result = ut.list_str((name_list, next_name_list1, next_name_list2, next_name_list3))
>>> print(result)
(
    ['IBEIS_UNKNOWN_0008', 'IBEIS_PZ_0042', 'IBEIS_UNKNOWN_0004', 'IBEIS_GZ_0008'],
    ['IBEIS_PZ_0042', 'IBEIS_PZ_0043', 'IBEIS_PZ_0044', 'IBEIS_PZ_0045', 'IBEIS_PZ_0046'],
    ['IBEIS_PZ_0044', 'IBEIS_PZ_0046', 'IBEIS_PZ_0047', 'IBEIS_PZ_0049', 'IBEIS_PZ_0050'],
    ['IBEIS_PZ_0042', 'IBEIS_PZ_0043', 'IBEIS_PZ_0044', 'IBEIS_PZ_0045', 'IBEIS_PZ_0046'],
)
ibeis.other.ibsfuncs.make_next_nids(ibs, *args, **kwargs)[source]

makes name and adds it to the database returning the newly added name rowid(s)

CAUTION; changes database state

SeeAlso:
make_next_name
ibeis.other.ibsfuncs.merge_names(ibs, merge_name, other_names)[source]
Parameters:
  • ibs (IBEISController) – ibeis controller object
  • merge_name (str) –
  • other_names (list) –

CommandLine:

python -m ibeis.other.ibsfuncs --test-merge_names

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis  # NOQA
>>> # build test data
>>> ibs = ibeis.opendb('testdb1')
>>> merge_name = 'zebra'
>>> other_names = ['occl', 'jeff']
>>> # execute function
>>> result = merge_names(ibs, merge_name, other_names)
>>> # verify results
>>> print(result)
>>> ibs.print_names_table()
ibeis.other.ibsfuncs.new_imagesets_from_images(ibs, gids_list)[source]
Parameters:gids_list (list) –
ibeis.other.ibsfuncs.partition_annots_into_corresponding_groups(ibs, aid_list1, aid_list2)[source]

Used for grouping one-vs-one training pairs and corerspondence filtering

Parameters:
Returns:

4 lists of lists. In the first two each list is a list of aids grouped by names and the names correspond with each other. In the last two are the annots that did not correspond with anything in the other list.

Return type:

tuple

CommandLine:

python -m ibeis.other.ibsfuncs --exec-partition_annots_into_corresponding_groups

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='PZ_MTEST')
>>> grouped_aids = list(map(list, ibs.group_annots_by_name(ibs.get_valid_aids())[0]))
>>> grouped_aids = [aids for aids in grouped_aids if len(aids) > 3]
>>> # Get some overlapping groups
>>> import copy
>>> aids_group1 = copy.deepcopy((ut.get_list_column_slice(grouped_aids[0:5], slice(0, 2))))
>>> aids_group2 = copy.deepcopy((ut.get_list_column_slice(grouped_aids[2:7], slice(2, None))))
>>> # Ensure there is a singleton in each
>>> ut.delete_items_by_index(aids_group1[0], [0])
>>> ut.delete_items_by_index(aids_group2[-1], [0])
>>> aid_list1 = ut.flatten(aids_group1)
>>> aid_list2 = ut.flatten(aids_group2)
>>> #aid_list1 = [1, 2, 8, 9, 60]
>>> #aid_list2 = [3, 7, 20]
>>> groups = partition_annots_into_corresponding_groups(ibs, aid_list1, aid_list2)
>>> result = ut.list_str(groups, label_list=['gt_grouped_aids1', 'gt_grouped_aids2', 'gf_grouped_aids1', 'gf_gropued_aids2'])
>>> print(result)
gt_grouped_aids1 = [[10, 11], [17, 18], [22, 23]]
gt_grouped_aids2 = [[12, 13, 14, 15], [19, 20, 21], [24, 25, 26]]
gf_grouped_aids1 = [[2], [5, 6]]
gf_gropued_aids2 = [[29, 30, 31, 32], [49]]
ibeis.other.ibsfuncs.partition_annots_into_singleton_multiton(ibs, aid_list)[source]

aid_list = aid_list_

ibeis.other.ibsfuncs.postinject_func(ibs)[source]
Parameters:ibs (IBEISController) –

CommandLine:

python -m ibeis.other.ibsfuncs --test-postinject_func

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis  # NOQA
>>> ibs = ibeis.opendb('testdb1')
>>> ibs.delete_empty_nids()  # a test run before this forgot to do this
>>> aids_list = ibs.get_name_aids(ibs.get_valid_nids())
>>> # indirectly test postinject_func
>>> thetas_list = ibs.get_unflat_annot_thetas(aids_list)
>>> result = str(thetas_list)
>>> print(result)
[[0.0, 0.0], [0.0, 0.0], [0.0], [0.0], [0.0], [0.0], [0.0]]
ibeis.other.ibsfuncs.prepare_annotgroup_review(ibs, aid_list)[source]
Parameters:
  • ibs (IBEISController) – ibeis controller object
  • aid_list (int) – list of annotation ids
Returns:

(src_ag_rowid, dst_ag_rowid) - source and dest annot groups

Return type:

tuple

CommandLine:

python -m ibeis.other.ibsfuncs --test-prepare_annotgroup_review

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb('testdb1')
>>> aid_list = ibs.get_valid_aids()
>>> result = prepare_annotgroup_review(ibs, aid_list)
>>> print(result)
ibeis.other.ibsfuncs.print_alr_table(ibs, **kwargs)[source]

Dumps alr table to stdout

ibeis.other.ibsfuncs.print_annot_stats(ibs, aids, prefix=u'', label=u'', **kwargs)[source]
ibeis.other.ibsfuncs.print_annotation_table(ibs, verbosity=1, exclude_columns=[], include_columns=[])[source]

Dumps annotation table to stdout

Parameters:

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis  # NOQA
>>> ibs = ibeis.opendb('testdb1')
>>> verbosity = 1
>>> print_annotation_table(ibs, verbosity)
ibeis.other.ibsfuncs.print_annotconfig_stats(ibs, qaids, daids, **kwargs)[source]
SeeAlso:
ibs.get_annotconfig_stats
ibeis.other.ibsfuncs.print_annotmatch_table(ibs)[source]

Dumps annotation match table to stdout

Parameters:ibs (IBEISController) – ibeis controller object

CommandLine:

python -m ibeis.other.ibsfuncs --exec-print_annotmatch_table
python -m ibeis.other.ibsfuncs --exec-print_annotmatch_table --db PZ_Master1

Example

>>> # SCRIPT
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(defaultdb='testdb1')
>>> result = print_annotmatch_table(ibs)
>>> print(result)
ibeis.other.ibsfuncs.print_chip_table(ibs)[source]

Dumps chip table to stdout

ibeis.other.ibsfuncs.print_config_table(ibs, **kwargs)[source]

Dumps config table to stdout

ibeis.other.ibsfuncs.print_contributor_table(ibs, verbosity=1, exclude_columns=[])[source]

Dumps annotation table to stdout

Parameters:

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis  # NOQA
>>> ibs = ibeis.opendb('testdb1')
>>> verbosity = 1
>>> print_contributor_table(ibs, verbosity)
ibeis.other.ibsfuncs.print_dbinfo(ibs, **kwargs)[source]
ibeis.other.ibsfuncs.print_egpairs_table(ibs, **kwargs)[source]

Dumps egpairs table to stdout

ibeis.other.ibsfuncs.print_feat_table(ibs)[source]

Dumps chip table to stdout

ibeis.other.ibsfuncs.print_flann_cachedir(ibs)[source]
ibeis.other.ibsfuncs.print_image_table(ibs, **kwargs)[source]

Dumps chip table to stdout

ibeis.other.ibsfuncs.print_imageset_table(ibs, **kwargs)[source]

Dumps imageset table to stdout

Kwargs:
exclude_columns (list):
ibeis.other.ibsfuncs.print_infostr(ibs, **kwargs)[source]
ibeis.other.ibsfuncs.print_lblannot_table(ibs, **kwargs)[source]

Dumps lblannot table to stdout

ibeis.other.ibsfuncs.print_name_table(ibs, **kwargs)[source]

Dumps name table to stdout

ibeis.other.ibsfuncs.print_party_table(ibs, **kwargs)[source]

Dumps chip table to stdout

ibeis.other.ibsfuncs.print_species_table(ibs, **kwargs)[source]

Dumps species table to stdout

ibeis.other.ibsfuncs.print_tables(ibs, exclude_columns=None, exclude_tables=None)[source]
ibeis.other.ibsfuncs.refresh(ibs)[source]

DEPRICATE

ibeis.other.ibsfuncs.remove_aids_of_viewpoint(ibs, aid_list, invalid_yaws)[source]

Removes aids that do not have a valid yaw

TODO; rename to valid_viewpoint because this func uses category labels

ibeis.other.ibsfuncs.remove_groundtrue_aids(ibs, aid_list, ref_aid_list)[source]

removes any aids that are known to match

ibeis.other.ibsfuncs.report_sightings(ibs, complete=True, include_images=False, **kwargs)[source]
ibeis.other.ibsfuncs.report_sightings_str(ibs, **kwargs)[source]
ibeis.other.ibsfuncs.run_integrity_checks(ibs, embed=False)[source]

Function to run all database consistency checks

ibeis.other.ibsfuncs.search_annot_notes(ibs, pattern, aid_list=None)[source]

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb('PZ_Master0')
>>> pattern = ['gash', 'injury', 'scar', 'wound']
>>> valid_aid_list = ibs.search_annot_notes(pattern)
>>> print(valid_aid_list)
>>> print(ibs.get_annot_notes(valid_aid_list))
ibeis.other.ibsfuncs.set_annot_is_hard(ibs, aid_list, flag_list)[source]

Hack to mark hard cases in the notes column

Example

>>> pz_mothers_hard_aids = [27, 43, 44, 49, 50, 51, 54, 66, 89, 97]
>>> aid_list = pz_mothers_hard_aids
>>> flag_list = [True] * len(aid_list)
ibeis.other.ibsfuncs.set_annot_names_to_different_new_names(ibs, aid_list)[source]
ibeis.other.ibsfuncs.set_annot_names_to_next_name(ibs, aid_list)[source]
ibeis.other.ibsfuncs.set_annot_names_to_same_new_name(ibs, aid_list)[source]
ibeis.other.ibsfuncs.set_dbnotes(ibs, notes)[source]

sets notes for an entire database

ibeis.other.ibsfuncs.set_exemplars_from_quality_and_viewpoint(ibs, aid_list=None, exemplars_per_view=None, imgsetid=None, dry_run=False, verbose=False)[source]

Automatic exemplar selection algorithm based on viewpoint and quality

References

# implement maximum diversity approximation instead http://www.csbio.unc.edu/mcmillan/pubs/ICDM07_Pan.pdf

CommandLine:

python -m ibeis.other.ibsfuncs --test-set_exemplars_from_quality_and_viewpoint
python -m ibeis.other.ibsfuncs --test-set_exemplars_from_quality_and_viewpoint:1

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> # build test data
>>> #ibs = ibeis.opendb('PZ_MUGU_19')
>>> ibs = ibeis.opendb('PZ_MTEST')
>>> dry_run = True
>>> verbose = False
>>> old_sum = sum(ibs.get_annot_exemplar_flags(ibs.get_valid_aids()))
>>> new_aid_list, new_flag_list = ibs.set_exemplars_from_quality_and_viewpoint(dry_run=dry_run)
>>> new_sum = sum(new_flag_list)
>>> print('old_sum = %r' % (old_sum,))
>>> print('new_sum = %r' % (new_sum,))
>>> zero_aid_list, zero_flag_list = ibs.set_exemplars_from_quality_and_viewpoint(exemplars_per_view=0, dry_run=dry_run)
>>> assert sum(zero_flag_list) == 0
>>> result = new_sum
Example1:
>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb('testdb1')
>>> dry_run = True
>>> verbose = False
>>> old_sum = sum(ibs.get_annot_exemplar_flags(ibs.get_valid_aids()))
>>> new_aid_list, new_flag_list = ibs.set_exemplars_from_quality_and_viewpoint(dry_run=dry_run)
>>> assert len(new_aid_list) == len(new_flag_list)
>>> # 2 of the 11 annots are unknown and should not be exemplars
>>> ut.assert_eq(len(new_aid_list), 9)
Example2:
>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb('testdb2')
>>> dry_run = True
>>> verbose = False
>>> imgsetid = None
>>> new_aid_list, new_flag_list = ibs.set_exemplars_from_quality_and_viewpoint(dry_run=dry_run)
>>> old_flag_list = ibs.get_annot_exemplar_flags(new_aid_list)
>>> new_exemplar_aids = ut.compress(new_aid_list, new_flag_list)
>>> new_exemplar_qualtexts = ibs.get_annot_quality_texts(new_exemplar_aids)
>>> assert 'junk' not in new_exemplar_qualtexts, 'should not have junk exemplars'
>>> assert 'poor' not in new_exemplar_qualtexts, 'should not have poor exemplars'
>>> #assert len(new_aid_list) == len(new_flag_list)
>>> # 2 of the 11 annots are unknown and should not be exemplars
>>> #ut.assert_eq(len(new_aid_list), 9)
ibeis.other.ibsfuncs.temp_group_annot_occurrences(ibs, aid_list)[source]
ibeis.other.ibsfuncs.testdata_ibs(defaultdb=u'testdb1')[source]
ibeis.other.ibsfuncs.unflat_dict_map(method, dict_rowids, **kwargs)[source]

maps dictionaries of rowids to a function

ibeis.other.ibsfuncs.unflat_map(method, unflat_rowids, **kwargs)[source]

Uses an ibeis lookup function with a non-flat rowid list. In essence this is equivilent to map(method, unflat_rowids). The utility of this function is that it only calls method once. This is more efficient for calls that can take a list of inputs

Parameters:
  • method (method) – ibeis controller method
  • unflat_rowids (list) – list of rowid lists
Returns:

unflat_vals

Return type:

list of values

CommandLine:

python -m ibeis.other.ibsfuncs --test-unflat_map

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis  # NOQA
>>> ibs = ibeis.opendb('testdb1')
>>> method = ibs.get_annot_name_rowids
>>> unflat_rowids = ibs.get_name_aids(ibs.get_valid_nids())
>>> unflat_vals = unflat_map(method, unflat_rowids)
>>> result = str(unflat_vals)
>>> print(result)
[[1, 1], [2, 2], [3], [4], [5], [6], [7]]
ibeis.other.ibsfuncs.unflat_multimap(method_list, unflat_rowids, **kwargs)[source]

unflat_map, but allows multiple methods

ibeis.other.ibsfuncs.update_all_image_special_imageset(ibs)[source]
ibeis.other.ibsfuncs.update_exemplar_special_imageset(ibs)[source]
ibeis.other.ibsfuncs.update_reviewed_unreviewed_image_special_imageset(ibs)[source]

Creates imageset of images that have not been reviewed and that have been reviewed

ibeis.other.ibsfuncs.update_special_imagesets(ibs)[source]
ibeis.other.ibsfuncs.update_ungrouped_special_imageset(ibs)[source]
Parameters:ibs (IBEISController) – ibeis controller object

CommandLine:

python -m ibeis.other.ibsfuncs --test-update_ungrouped_special_imageset

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.other.ibsfuncs import *  # NOQA
>>> import ibeis  # NOQA
>>> # build test data
>>> ibs = ibeis.opendb('testdb9')
>>> # execute function
>>> result = update_ungrouped_special_imageset(ibs)
>>> # verify results
>>> print(result)
ibeis.other.ibsfuncs.use_images_as_annotations(ibs, gid_list, name_list=None, nid_list=None, notes_list=None, adjust_percent=0.0)[source]

Adds an annotation the size of the entire image to each image. adjust_percent - shrinks the ANNOTATION by percentage on each side

ibeis.other.ibsfuncs.vd(ibs)[source]
ibeis.other.ibsfuncs.view_dbdir(ibs)[source]
ibeis.other.ibsfuncs.viewpoint_diff(ori1, ori2)[source]

convert distance in radians to distance in viewpoint category

ibeis.other.ibsfuncs.vsstr(qaid, aid, lite=False)[source]

Module contents

ibeis.other.reassign_submodule_attributes(verbose=True)[source]

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

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

Reloads ibeis.other and submodules

ibeis.other.rrrr(verbose=True)

Reloads ibeis.other and submodules