wbia.scripts package

Submodules

wbia.scripts._neighbor_experiment module

wbia.scripts._neighbor_experiment.augment_nnindexer_experiment()[source]

References

http://answers.opencv.org/question/44592/flann-index-training-fails-with-segfault/

CommandLine:

utprof.py -m wbia.algo.hots._neighbor_experiment –test-augment_nnindexer_experiment python -m wbia.algo.hots._neighbor_experiment –test-augment_nnindexer_experiment

python -m wbia.algo.hots._neighbor_experiment –test-augment_nnindexer_experiment –db PZ_MTEST –diskshow –adjust=.1 –save “augment_experiment_{db}.png” –dpath=’.’ –dpi=180 –figsize=9,6 python -m wbia.algo.hots._neighbor_experiment –test-augment_nnindexer_experiment –db PZ_Master0 –diskshow –adjust=.1 –save “augment_experiment_{db}.png” –dpath=’.’ –dpi=180 –figsize=9,6 –nosave-flann –show python -m wbia.algo.hots._neighbor_experiment –test-augment_nnindexer_experiment –db PZ_Master0 –diskshow –adjust=.1 –save “augment_experiment_{db}.png” –dpath=’.’ –dpi=180 –figsize=9,6 –nosave-flann –show

python -m wbia.algo.hots._neighbor_experiment –test-augment_nnindexer_experiment –db PZ_Master0 –diskshow –adjust=.1 –save “augment_experiment_{db}.png” –dpath=’.’ –dpi=180 –figsize=9,6 –nosave-flann –no-api-cache –nocache-uuids

python -m wbia.algo.hots._neighbor_experiment –test-augment_nnindexer_experiment –db PZ_MTEST –show python -m wbia.algo.hots._neighbor_experiment –test-augment_nnindexer_experiment –db PZ_Master0 –show

# RUNS THE SEGFAULTING CASE python -m wbia.algo.hots._neighbor_experiment –test-augment_nnindexer_experiment –db PZ_Master0 –show # Debug it gdb python run -m wbia.algo.hots._neighbor_experiment –test-augment_nnindexer_experiment –db PZ_Master0 –show gdb python run -m wbia.algo.hots._neighbor_experiment –test-augment_nnindexer_experiment –db PZ_Master0 –diskshow –adjust=.1 –save “augment_experiment_{db}.png” –dpath=’.’ –dpi=180 –figsize=9,6

Example

>>> # DISABLE_DOCTEST
>>> from wbia.algo.hots._neighbor_experiment import *  # NOQA
>>> # execute function
>>> augment_nnindexer_experiment()
>>> # verify results
>>> ut.show_if_requested()
wbia.scripts._neighbor_experiment.flann_add_time_experiment()[source]

builds plot of number of annotations vs indexer build time.

TODO: time experiment

CommandLine:

python -m wbia.algo.hots._neighbor_experiment –test-flann_add_time_experiment –db PZ_MTEST –show python -m wbia.algo.hots._neighbor_experiment –test-flann_add_time_experiment –db PZ_Master0 –show utprof.py -m wbia.algo.hots._neighbor_experiment –test-flann_add_time_experiment –show

valgrind –tool=memcheck –suppressions=valgrind-python.supp python -m wbia.algo.hots._neighbor_experiment –test-flann_add_time_experiment –db PZ_MTEST –no-with-reindex

Example

>>> # DISABLE_DOCTEST
>>> from wbia.algo.hots._neighbor_experiment import *  # NOQA
>>> import wbia
>>> #ibs = wbia.opendb('PZ_MTEST')
>>> result = flann_add_time_experiment()
>>> # verify results
>>> print(result)
>>> ut.show_if_requested()
wbia.scripts._neighbor_experiment.pyflann_remove_and_save()[source]

References

# Logic goes here ~/code/flann/src/cpp/flann/algorithms/kdtree_index.h

~/code/flann/src/cpp/flann/util/serialization.h ~/code/flann/src/cpp/flann/util/dynamic_bitset.h

# Bindings go here ~/code/flann/src/cpp/flann/flann.cpp ~/code/flann/src/cpp/flann/flann.h

# Contains stuff for the flann namespace like flann::log_level # Also has Index with # Matrix<ElementType> features; SEEMS USEFUL ~/code/flann/src/cpp/flann/flann.hpp

# Wrappers go here ~/code/flann/src/python/pyflann/flann_ctypes.py ~/code/flann/src/python/pyflann/index.py

~/local/build_scripts/flannscripts/autogen_bindings.py

Greping:
cd ~/code/flann/src grep -ER cleanRemovedPoints * grep -ER removed_points_ *
CommandLine:
python -m wbia.algo.hots._neighbor_experiment –exec-pyflann_remove_and_save

Example

>>> # DISABLE_DOCTEST
>>> from wbia.algo.hots._neighbor_experiment import *  # NOQA
>>> pyflann_remove_and_save()
wbia.scripts._neighbor_experiment.pyflann_test_remove_add()[source]
CommandLine:
python -m wbia.algo.hots._neighbor_experiment –exec-pyflann_test_remove_add

Example

>>> # DISABLE_DOCTEST
>>> from wbia.algo.hots._neighbor_experiment import *  # NOQA
>>> pyflann_test_remove_add()
wbia.scripts._neighbor_experiment.pyflann_test_remove_add2()[source]
CommandLine:
python -m wbia.algo.hots._neighbor_experiment –exec-pyflann_test_remove_add2

Example

>>> # DISABLE_DOCTEST
>>> from wbia.algo.hots._neighbor_experiment import *  # NOQA
>>> pyflann_test_remove_add2()
wbia.scripts._neighbor_experiment.subindexer_time_experiment()[source]

builds plot of number of annotations vs indexer build time.

TODO: time experiment

wbia.scripts._neighbor_experiment.trytest_incremental_add(ibs)[source]
Parameters:ibs (IBEISController) –
CommandLine:
python -m wbia.algo.hots._neighbor_experiment –test-test_incremental_add

Example

>>> # DISABLE_DOCTEST
>>> from wbia.algo.hots.neighbor_index_cache import *  # NOQA
>>> import wbia
>>> ibs = wbia.opendb('PZ_MTEST')
>>> result = test_incremental_add(ibs)
>>> print(result)
wbia.scripts._neighbor_experiment.trytest_multiple_add_removes()[source]
CommandLine:
python -m wbia.algo.hots._neighbor_experiment –exec-test_multiple_add_removes

Example

>>> # DISABLE_DOCTEST
>>> from wbia.algo.hots._neighbor_experiment import *  # NOQA
>>> result = test_multiple_add_removes()
>>> print(result)

wbia.scripts._thesis_helpers module

class wbia.scripts._thesis_helpers.DBInputs(dbname=None)[source]

Bases: object

classmethod draw(expt_name, dbnames, *args)[source]
CommandLine:

python -m wbia Chap3.draw nsum –dbs=GZ_Master1,PZ_Master1 python -m wbia Chap3.draw foregroundness –dbs=GZ_Master1,PZ_Master1 –diskshow python -m wbia Chap3.draw kexpt –dbs=GZ_Master1 –diskshow

python -m wbia Chap4.draw importance GZ_Master1

python -m wbia Chap4.draw hard_cases GZ_Master1,PZ_Master1 match_state,photobomb_state –diskshow

# Example: # >>> # Script # >>> from wbia.scripts.thesis import * # NOQA # >>> expt_name = ut.get_argval(’–expt’, type_=str, pos=1) # >>> dbnames = ut.get_argval((’–dbs’, ‘–db’), type_=list, default=[]) # >>> Chap3.draw(expt_name, dbnames)

classmethod draw_serial(expt_name, dbnames, *args)[source]
ensure_results(expt_name=None, nocompute=None)[source]

Subclasses must obey the measure_<expt_name>, draw_<expt_name> contract

ensure_setup()[source]
classmethod measure(expt_name, dbnames, *args)[source]
CommandLine:

python -m wbia Chap3.measure all –dbs=GZ_Master1 python -m wbia Chap3.measure all –dbs=PZ_Master1

python -m wbia Chap3.measure nsum –dbs=GZ_Master1,PZ_Master1 python -m wbia Chap3.measure foregroundness –dbs=GZ_Master1,PZ_Master1

# Example: # >>> # Script # >>> from wbia.scripts.thesis import * # NOQA # >>> expt_name = ut.get_argval(’–expt’, type_=str, pos=1) # >>> dbnames = ut.get_argval((’–dbs’, ‘–db’), type_=list, default=[]) # >>> ChapX.measure(expt_name, dbnames)

rrr(verbose=True, reload_module=True)

special class reloading function This function is often injected as rrr of classes

classmethod vd()[source]
CommandLine:
python -m wbia Chap3.vd
class wbia.scripts._thesis_helpers.ExpandingSample(qaids, dname_encs, confusor_pool)[source]

Bases: utool.util_dev.NiceRepr

expand(denc_per_name=[1], extra_dbsize_fracs=[0])[source]
class wbia.scripts._thesis_helpers.Tabular(data=None, colfmt=None, hline=None, caption='', index=True, escape=True)[source]

Bases: object

add_multicolumn_header(size_col_name)[source]

size_col_name is a list of tuples indicating the number of columns, column format, and text.

as_parts()[source]
as_table(caption=None)[source]
as_tabular()[source]
as_text()[source]
rrr(verbose=True, reload_module=True)

special class reloading function This function is often injected as rrr of classes

wbia.scripts._thesis_helpers.ave_str(mean, std, precision=2)[source]
wbia.scripts._thesis_helpers.dbname_to_species_nice(dbname)[source]
wbia.scripts._thesis_helpers.find_minority_class_ccs(infr)[source]
wbia.scripts._thesis_helpers.join_tabular(parts, hline=False, align=True)[source]
wbia.scripts._thesis_helpers.split_tabular(text)[source]
wbia.scripts._thesis_helpers.test_mcc()[source]
wbia.scripts._thesis_helpers.upper_one(s)[source]

wbia.scripts.classify_shark module

class wbia.scripts.classify_shark.ClfProblem(ds)[source]

Bases: object

Harness for researching a classification problem

classifier_test(clf, test_idx)[source]
fit_new_classifier(train_idx)[source]

References

http://leon.bottou.org/research/stochastic http://blog.explainmydata.com/2012/06/ntrain-24853-ntest-25147-ncorrupt.html http://scikit-learn.org/stable/modules/svm.html#svm-classification http://scikit-learn.org/stable/modules/grid_search.html

fit_new_linear_svm(train_idx)[source]
gen_crossval_idxs(n_folds=2)[source]
gridsearch_linear_svm_params(train_idx)[source]

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.classify_shark import *  # NOQA
>>> from wbia.scripts import classify_shark
>>> ds = classify_shark.get_sharks_dataset('binary')
>>> problem = classify_shark.ClfProblem(ds)
>>> problem.print_support_info()
print_support_info()[source]
stratified_2sample_idxs(frac=0.2, split_frac=0.75)[source]
class wbia.scripts.classify_shark.ClfSingleResult(ds=None, test_idx=None, y_true=None, y_pred=None, y_conf=None)[source]

Bases: object

Reports the results of a classification problem

Example

>>> # DISABLE_DOCTEST
>>> result = ClfSingleResult()
compile_results()[source]
print_report()[source]
class wbia.scripts.classify_shark.WhaleSharkInjuryModel[source]

Bases: object

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.classify_shark import *  # NOQA
>>> from wbia.scripts import classify_shark
>>> ds = classify_shark.get_sharks_dataset('binary', 'chip')
>>> problem = classify_shark.ClfProblem(ds)
>>> problem.print_support_info()
>>> ibs = ds.ibs
augment(Xb, yb=None)[source]

X_valid, y_valid = dataset.subset(‘valid’) num = 10 Xb = X_valid[:num] Xb = Xb / 255.0 if ut.is_int(Xb) else Xb Xb = Xb.astype(np.float32, copy=True) yb = None if yb is None else yb.astype(np.int32, copy=True) # Rescale the batch data to the range 0 to 1 Xb_, yb_ = model.augment(Xb) yb_ = None >>> ut.quit_if_noshow() >>> import wbia.plottool as pt >>> pt.qt4ensure() >>> from wbia_cnn import augment >>> augment.show_augmented_patches(Xb, Xb_, yb, yb_, data_per_label=1) >>> ut.show_if_requested()

def_inception()[source]
def_lenet()[source]
def_resnet()[source]
init_arch(verbose=False, **kwargs)[source]
CommandLine:

python -m wbia.scripts.classify_shark WhaleSharkInjuryModel.init_arch python -m wbia.scripts.classify_shark WhaleSharkInjuryModel.init_arch –show

python -m wbia.scripts.classify_shark shark_net –dry –show python -m wbia.scripts.classify_shark shark_net –vd

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.classify_shark import *  # NOQA
>>> verbose = True
>>> data_shape = tuple(ut.get_argval('--datashape', type_=list,
>>>                                  default=(224, 224, 3)))
>>> model = WhaleSharkInjuryModel(batch_size=64, output_dims=2,
>>>                               data_shape=data_shape)
>>> model.init_arch()
>>> model.print_model_info_str()
>>> ut.quit_if_noshow()
>>> model.show_arch(fullinfo=False)
>>> ut.show_if_requested()
special_output()[source]
wbia.scripts.classify_shark.get_model_state(clf)[source]
wbia.scripts.classify_shark.get_shark_dataset(target_type='binary', data_type='chip')[source]
>>> from wbia.scripts.classify_shark import *  # NOQA
>>> target_type = 'binary'
>>> data_type = 'hog'
>>> dataset = get_shark_dataset(target_type)
wbia.scripts.classify_shark.get_shark_labels_and_metadata(target_type=None, ibs=None, config=None)[source]
>>> from wbia.scripts.classify_shark import *  # NOQA
>>> target_type = 'multiclass3'
>>> data_type = 'hog'
wbia.scripts.classify_shark.inspect_results(ds, result_list)[source]
wbia.scripts.classify_shark.predict_svc_ovr(clf, data)[source]
wbia.scripts.classify_shark.predict_ws_injury_interim_svm(ibs, aids, **kwargs)[source]

Returns relative confidence

wbia.scripts.classify_shark.set_model_state(clf, model_state)[source]
wbia.scripts.classify_shark.shark_net(dry=False)[source]
CommandLine:
python -m wbia.scripts.classify_shark shark_net python -m wbia.scripts.classify_shark shark_net –dry python -m wbia.scripts.classify_shark shark_net –vd –monitor

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.classify_shark import *  # NOQA
>>> shark_net()
wbia.scripts.classify_shark.shark_svm()[source]

References

http://scikit-learn.org/stable/model_selection.html

Todo

  • Change unreviewed healthy tags to healthy-likely
CommandLine:
python -m wbia.scripts.classify_shark shark_svm –show python -m wbia.scripts.classify_shark shark_svm

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.classify_shark import *  # NOQA
>>> shark_svm()
>>> ut.show_if_requested()

wbia.scripts.fix_annotation_orientation_issue module

wbia.scripts.fix_annotation_orientation_issue.fix_annotation_orientation(ibs, min_percentage=0.95)[source]

Fixes the annotations that are outside the bounds of the image due to a changed image orientation flag in the database

CommandLine:
python -m wbia.scripts.fix_annotation_orientation_issue fix_annotation_orientation

Example

>>> # ENABLE_DOCTEST
>>> import wbia
>>> from wbia.scripts.fix_annotation_orientation_issue import *  # NOQA
>>> ibs = wbia.opendb()
>>> unfixable_gid_list = fix_annotation_orientation(ibs)
>>> assert len(unfixable_gid_list) == 0

wbia.scripts.getshark module

wbia.scripts.getshark.add_new_images(ibs, miss_info, species)[source]
wbia.scripts.getshark.check_annot_disagree(single_info, single_annots, key1, prop2, repl2, is_set, key2=None, DRY=True)[source]
wbia.scripts.getshark.download_missing_images(parsed, num=None)[source]
wbia.scripts.getshark.get_injur_categories(single_annots, verbose=False)[source]
wbia.scripts.getshark.get_injured_tags(tags_list, include_healthy=False, invert=False)[source]

tags_list = single_info[‘tags’] tags_list = single_annots.case_tags info_injur_tags = parse_injury_categories() annot_injur_tags = parse_injury_categories(single_annots.case_tags)

wbia.scripts.getshark.parse_shark_fname_tags(orig_fname_list, dev=False)[source]

Parses potential tags from the filename. If dev mode is on, then it prints out other potential tags you might add.

>>> orig_fname_list = parsed['orig_fname']
>>> dev = True
>>> tags = parse_shark_fname_tags(orig_fname_list, dev=dev)
wbia.scripts.getshark.parse_whaleshark_org()[source]

Read list of all images from wildbook

Combines old and new

>>> from wbia.scripts.getshark import *  # NOQA
wbia.scripts.getshark.parse_whaleshark_org_keywords()[source]
wbia.scripts.getshark.parse_whaleshark_org_old()[source]
wbia.scripts.getshark.parse_wildbook(images_url, keyword_url=None)[source]

Read list of all images from wildbook

Combines old and new

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.getshark import *  # NOQA
>>> url = images_url = 'http://www.mantamatcher.org/listImages.jsp'

Example

>>> # DISABLE_DOCTEST
>>> images_url = 'http://www.whaleshark.org/listImages.jsp'
>>> keyword_url = 'http://www.whaleshark.org/getKeywordImages.jsp'
wbia.scripts.getshark.parse_wildbook_images(url)[source]

Example

>>> # DISABLE_DOCTEST
>>> url = 'www.whaleshark.org/listImages.jsp'
>>> url = images_url = 'http://www.mantamatcher.org/listImages.jsp'
>>> parse_wildbook_images(url)
wbia.scripts.getshark.postprocess_corrupted(parsed_dl)[source]
wbia.scripts.getshark.postprocess_extfilter(parsed)[source]
wbia.scripts.getshark.postprocess_filenames(parsed, download_dir)[source]
wbia.scripts.getshark.postprocess_rectify_duplicates(unmerged)[source]

Rectify duplicate uuid information

wbia.scripts.getshark.postprocess_tags_build(parsed)[source]
wbia.scripts.getshark.postprocess_tags_filter(parsed)[source]
wbia.scripts.getshark.postprocess_uuids(parsed_dl)[source]
wbia.scripts.getshark.sync_annot_info(ibs, single_annots, single_info, species, DRY)[source]

sync info from wildbook into annots from IA.

wbia.scripts.getshark.sync_existing_images(ibs, hit_info, species, DRY)[source]
wbia.scripts.getshark.sync_wildbook()[source]

MAIN ENTRY POINT

Syncronizes our wbia database with a wildbook database like whaleshark.org

#cd ~/work/WS_ALL python -m wbia.scripts.getshark

cd /media/raid/raw/WhaleSharks_WB/

>>> from wbia.scripts.getshark import *  # NOQA

wbia.scripts.getshark_old module

wbia.scripts.getshark_old.detect_sharks(ibs, gids)[source]
wbia.scripts.getshark_old.get_injured_sharks()[source]
>>> from wbia.scripts.getshark import *  # NOQA
wbia.scripts.getshark_old.purge_ensure_one_annot_per_images(ibs)[source]

pip install Pipe

wbia.scripts.getshark_old.shark_misc()[source]
wbia.scripts.getshark_old.train_part_detector()[source]
Problem:
healthy sharks usually have a mostly whole body shot injured sharks usually have a close up shot. This distribution of images is likely what the injur-shark net is picking up on.

The goal is to train a detector that looks for things that look like the distribution of injured sharks.

We will run this on healthy sharks to find the parts of

wbia.scripts.labelShark module

wbia.scripts.labelShark.classifyShark(ibs, gid_list)[source]

wbia.scripts.name_recitifer module

wbia.scripts.name_recitifer.find_consistent_labeling(grouped_oldnames, extra_prefix='_extra_name', verbose=False)[source]

Solves a a maximum bipirtite matching problem to find a consistent name assignment that minimizes the number of annotations with different names. For each new grouping of annotations we assign

For each group of annotations we must assign them all the same name, either from

To reduce the running time

Parameters:gropued_oldnames (list) –

A group of old names where the grouping is based on new names. For instance:

Given:
aids = [1, 2, 3, 4, 5] old_names = [0, 1, 1, 1, 0] new_names = [0, 0, 1, 1, 0]
The grouping is
[[0, 1, 0], [1, 1]]

This lets us keep the old names in a split case and re-use exising names and make minimal changes to current annotation names while still being consistent with the new and improved grouping.

The output will be:
[0, 1]

Meaning that all annots in the first group are assigned the name 0 and all annots in the second group are assigned the name 1.

References

http://stackoverflow.com/questions/1398822/assignment-problem-numpy

CommandLine:
python -m wbia.scripts.name_recitifer find_consistent_labeling

Example

>>> # ENABLE_DOCTEST
>>> from wbia.scripts.name_recitifer import *  # NOQA
>>> grouped_oldnames = testdata_oldnames(25, 15,  5, n_per_incon=5)
>>> new_names = find_consistent_labeling(grouped_oldnames, verbose=1)
>>> grouped_oldnames = testdata_oldnames(0, 15,  5, n_per_incon=1)
>>> new_names = find_consistent_labeling(grouped_oldnames, verbose=1)
>>> grouped_oldnames = testdata_oldnames(0, 0, 0, n_per_incon=1)
>>> new_names = find_consistent_labeling(grouped_oldnames, verbose=1)

Example

>>> # ENABLE_DOCTEST
>>> from wbia.scripts.name_recitifer import *  # NOQA
>>> ydata = []
>>> xdata = list(range(10, 150, 50))
>>> for x in xdata:
>>>     print('x = %r' % (x,))
>>>     grouped_oldnames = testdata_oldnames(x, 15,  5, n_per_incon=5)
>>>     t = ut.Timerit(3, verbose=1)
>>>     for timer in t:
>>>         with timer:
>>>             new_names = find_consistent_labeling(grouped_oldnames)
>>>     ydata.append(t.ave_secs)
>>> ut.quit_if_noshow()
>>> import wbia.plottool as pt
>>> pt.qtensure()
>>> pt.multi_plot(xdata, [ydata])
>>> ut.show_if_requested()

Example

>>> # ENABLE_DOCTEST
>>> from wbia.scripts.name_recitifer import *  # NOQA
>>> grouped_oldnames = [['a', 'b', 'c'], ['b', 'c'], ['c', 'e', 'e']]
>>> new_names = find_consistent_labeling(grouped_oldnames, verbose=1)
>>> result = ut.repr2(new_names)
>>> print(new_names)
['a', 'b', 'e']

Example

>>> # ENABLE_DOCTEST
>>> from wbia.scripts.name_recitifer import *  # NOQA
>>> grouped_oldnames = [['a', 'b'], ['a', 'a', 'b'], ['a']]
>>> new_names = find_consistent_labeling(grouped_oldnames)
>>> result = ut.repr2(new_names)
>>> print(new_names)
['b', 'a', '_extra_name0']

Example

>>> # ENABLE_DOCTEST
>>> from wbia.scripts.name_recitifer import *  # NOQA
>>> grouped_oldnames = [['a', 'b'], ['e'], ['a', 'a', 'b'], [], ['a'], ['d']]
>>> new_names = find_consistent_labeling(grouped_oldnames)
>>> result = ut.repr2(new_names)
>>> print(new_names)
['b', 'e', 'a', '_extra_name0', '_extra_name1', 'd']

Example

>>> # ENABLE_DOCTEST
>>> from wbia.scripts.name_recitifer import *  # NOQA
>>> grouped_oldnames = [[], ['a', 'a'], [],
>>>                     ['a', 'a', 'a', 'a', 'a', 'a', 'a', 'b'], ['a']]
>>> new_names = find_consistent_labeling(grouped_oldnames)
>>> result = ut.repr2(new_names)
>>> print(new_names)
['_extra_name0', 'a', '_extra_name1', 'b', '_extra_name2']
wbia.scripts.name_recitifer.find_consistent_labeling_old(grouped_oldnames, extra_prefix='_extra_name', verbose=False)[source]
wbia.scripts.name_recitifer.reasign_names1(ibs, aid_list=None, old_img2_names=None, common_prefix='')[source]

Changes the names in the IA-database to correspond to an older naming convention. If splits and merges were preformed tries to find the maximally consistent renaming scheme.

Notes

For each annotation: * get the image * get the image full path * strip the full path down to the file name prefix:

[ example /foo/bar/pic.jpg -> pic ]
  • make the name of the individual associated with that annotation be the file name prefix
  • save the new names to the image analysis database
  • wildbook will make a request to get all of the annotations, image file names, image names and animal ids
CommandLine:
python -m wbia.scripts.name_recitifer rectify_names –show

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.name_recitifer import *  # NOQA
>>> import wbia
>>> ibs = wbia.opendb(defaultdb='testdb1')
>>> aid_list = None
>>> common_prefix = ''
>>> old_img2_names = None #['img_fred.png', ']
>>> result = reasign_names1(ibs, aid_list, img_list, name_list)
wbia.scripts.name_recitifer.reasign_names2(ibs, gname_name_pairs, aid_list=None)[source]

Notes

  • Given a list of pairs: image file names (full path), animal name.
  • Go through all the images in the database and create a dictionary

that associates the file name (full path) of the image in the database with the

annotation or annotations associated with that image.
  • Go through the list of pairs: For each image file name, look up in the dictionary the image file name and assign the annotation associated with the image file name the animal name
  • Throughout this, keep a list of annotations that have been changed
  • Wildbook will issue a pull request to get these annotation.

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.name_recitifer import *  # NOQA
>>> import wbia
>>> ibs = wbia.opendb(defaultdb='testdb1')
>>> aid_list = None
>>> common_prefix = ''
>>> gname_name_pairs = [
>>>     ('easy1.JPG', 'easy'),
>>>     ('easy2.JPG', 'easy'),
>>>     ('easy3.JPG', 'easy'),
>>>     ('hard1.JPG', 'hard')
>>> ]
>>> changed_pairs = reasign_names2(gname_name_pairs)
wbia.scripts.name_recitifer.simple_munkres(part_oldnames)[source]

Defines a munkres problem to solve name rectification.

Notes

We create a matrix where each rows represents a group of annotations in the same PCC and each column represents an original name. If there are more PCCs than original names the columns are padded with extra values. The matrix is first initialized to be negative infinity representing impossible assignments. Then for each column representing a padded name, we set we its value to $1$ indicating that each new name could be assigned to a padded name for some small profit. Finally, let $f_{rc}$ be the the number of annotations in row $r$ with an original name of $c$. Each matrix value $(r, c)$ is set to $f_{rc} + 1$ if $f_{rc} > 0$, to represent how much each name ``wants’’ to be labeled with a particular original name, and the extra one ensures that these original names are always preferred over padded names.

CommandLine:
python -m wbia.scripts.name_recitifer simple_munkres

Example

>>> # ENABLE_DOCTEST
>>> from wbia.scripts.name_recitifer import *  # NOQA
>>> part_oldnames = [['a', 'b'], ['b', 'c'], ['c', 'a', 'a']]
>>> new_names = simple_munkres(part_oldnames)
>>> result = ut.repr2(new_names)
>>> print(new_names)
['b', 'c', 'a']

Example

>>> # ENABLE_DOCTEST
>>> from wbia.scripts.name_recitifer import *  # NOQA
>>> part_oldnames = [[], ['a', 'a'], [],
>>>                  ['a', 'a', 'a', 'a', 'a', 'a', 'a', 'b'], ['a']]
>>> new_names = simple_munkres(part_oldnames)
>>> result = ut.repr2(new_names)
>>> print(new_names)
[None, 'a', None, 'b', None]

Example

>>> # ENABLE_DOCTEST
>>> from wbia.scripts.name_recitifer import *  # NOQA
>>> part_oldnames = [[], ['b'], ['a', 'b', 'c'], ['b', 'c'], ['c', 'e', 'e']]
>>> new_names = find_consistent_labeling(part_oldnames)
>>> result = ut.repr2(new_names)
>>> print(new_names)
['_extra_name0', 'b', 'a', 'c', 'e']
Profit Matrix
b a c e _0

0 -10 -10 -10 -10 1 1 2 -10 -10 -10 1 2 2 2 2 -10 1 3 2 -10 2 -10 1 4 -10 -10 2 3 1

wbia.scripts.name_recitifer.testdata_oldnames(n_incon_groups=10, n_con_groups=2, n_per_con=5, n_per_incon=5, con_sep=4, n_empty_groups=0)[source]

wbia.scripts.postdoc module

class wbia.scripts.postdoc.GraphExpt(dbname=None)[source]

Bases: wbia.scripts._thesis_helpers.DBInputs

Todo

  • [ ] Experimental analysis of duration of each phase and state of
    graph.
  • [ ] Experimental analysis of phase 3, including how far we can get
    with automatic decision making and do we discover new merges? If there are potential merges, can we run phase iii with exactly the same ordering as before: ordering by probability for automatically decidable and then by positive probability for others. This should work for phase 3 and therefore allow a clean combination of the three phases and our termination criteria. I just thought of this so don’t really have it written cleanly above.
  • [ ] Experimental analysis of choice of automatic decision thresholds.
    by lowering the threshold we increase the risk of mistakes. Each mistake costs some number of manual reviews (perhaps 2-3), but if the frequency of errors is low then we could be saving ourselves a lot of manual reviews.

item OTHER SPECIES

CommandLine:
python -m wbia GraphExpt.measure all PZ_MTEST
Ignore:
>>> from wbia.scripts.postdoc import *
>>> self = GraphExpt('PZ_MTEST')
>>> self._precollect()
>>> self._setup()
base_dpath = '/home/docs/Desktop/graph_expt'
draw_graphsim()[source]

CommandLine:

python -m wbia GraphExpt.measure graphsim GZ_Master1 python -m wbia GraphExpt.draw graphsim GZ_Master1 –diskshow

python -m wbia GraphExpt.draw graphsim PZ_MTEST –diskshow python -m wbia GraphExpt.draw graphsim GZ_Master1 –diskshow python -m wbia GraphExpt.draw graphsim PZ_Master1 –diskshow

Ignore:
>>> from wbia.scripts.postdoc import *
>>> self = GraphExpt('GZ_Master1')
>>> self = GraphExpt('PZ_MTEST')
draw_graphsim2()[source]
CommandLine:
python -m wbia GraphExpt.draw graphsim2 –db PZ_MTEST –diskshow python -m wbia GraphExpt.draw graphsim2 GZ_Master1 –diskshow python -m wbia GraphExpt.draw graphsim2 PZ_Master1 –diskshow

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.thesis import *
>>> dbname = ut.get_argval('--db', default='GZ_Master1')
>>> self = GraphExpt(dbname)
>>> self.draw_graphsim2()
>>> ut.show_if_requested()
measure_all()[source]
measure_graphsim()[source]
CommandLine:
python -m wbia GraphExpt.measure graphsim GZ_Master1 1
Ignore:
>>> from wbia.scripts.postdoc import *
>>> #self = GraphExpt('PZ_MTEST')
>>> #self = GraphExpt('GZ_Master1')
>>> self = GraphExpt.measure('graphsim', 'PZ_Master1')
>>> self = GraphExpt.measure('graphsim', 'GZ_Master1')
>>> self = GraphExpt.measure('graphsim', 'PZ_MTEST')
rrr(verbose=True, reload_module=True)

special class reloading function This function is often injected as rrr of classes

class wbia.scripts.postdoc.VerifierExpt(dbname=None)[source]

Bases: wbia.scripts._thesis_helpers.DBInputs

Collect data from experiments to visualize

python -m wbia VerifierExpt.measure all PZ_Master1.GZ_Master1,GIRM_Master1,MantaMatcher,RotanTurtles,humpbacks_fb,LF_ALL python -m wbia VerifierExpt.measure all GIRM_Master1,PZ_Master1,LF_ALL python -m wbia VerifierExpt.measure all LF_ALL python -m wbia VerifierExpt.measure all PZ_Master1

python -m wbia VerifierExpt.measure all MantaMatcher python -m wbia VerifierExpt.draw all MantaMatcher

python -m wbia VerifierExpt.draw rerank PZ_Master1

python -m wbia VerifierExpt.measure all RotanTurtles python -m wbia VerifierExpt.draw all RotanTurtles

Ignore:
>>> from wbia.scripts.postdoc import *
>>> fpath = ut.glob(ut.truepath('~/Desktop/mtest_plots'), '*.pkl')[0]
>>> self = ut.load_data(fpath)
agg_dbnames = ['PZ_Master1', 'GZ_Master1', 'MantaMatcher', 'RotanTurtles', 'humpbacks_fb', 'GIRM_Master1']
classmethod agg_dbstats()[source]
CommandLine:
python -m wbia VerifierExpt.agg_dbstats python -m wbia VerifierExpt.measure_dbstats

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.postdoc import *  # NOQA
>>> result = VerifierExpt.agg_dbstats()
>>> print(result)
classmethod agg_results(task_key)[source]

python -m wbia VerifierExpt.agg_results python -m wbia VerifierExpt.agg_results –link link-paper-final

GZ_Master1,LF_ALL,MantaMatcher,RotanTurtles,humpbacks_fb,GIRM_Master1

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.postdoc import *  # NOQA
>>> task_key = 'match_state'
>>> result = VerifierExpt.agg_results(task_key)
>>> print(result)
base_dpath = '/home/docs/latex/crall-iccvw-2017/figures'
custom_single_hard_case()[source]

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.postdoc import *
>>> defaultdb = 'PZ_PB_RF_TRAIN'
>>> #defaultdb = 'GZ_Master1'
>>> defaultdb = 'PZ_MTEST'
>>> self = VerifierExpt.collect(defaultdb)
>>> self.dbname = 'PZ_PB_RF_TRAIN'
draw_all()[source]
CommandLine:
python -m wbia VerifierExpt.draw_all –db PZ_MTEST python -m wbia VerifierExpt.draw_all –db PZ_PB_RF_TRAIN python -m wbia VerifierExpt.draw_all –db GZ_Master1 python -m wbia VerifierExpt.draw_all –db PZ_Master1

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.postdoc import *
>>> dbname = ut.get_argval('--db', default='PZ_MTEST')
>>> dbnames = ut.get_argval('--dbs', type_=list, default=[dbname])
>>> for dbname in dbnames:
>>>     print('dbname = %r' % (dbname,))
>>>     self = VerifierExpt(dbname)
>>>     self.draw_all()
draw_class_score_hist()[source]

Plots distribution of positive and negative scores

draw_hard_cases(task_key='match_state')[source]

draw hard cases with and without overlay

python -m wbia VerifierExpt.draw hard_cases GZ_Master1 match_state python -m wbia VerifierExpt.draw hard_cases PZ_Master1 match_state python -m wbia VerifierExpt.draw hard_cases PZ_Master1 photobomb_state python -m wbia VerifierExpt.draw hard_cases GZ_Master1 photobomb_state

python -m wbia VerifierExpt.draw hard_cases RotanTurtles match_state

>>> from wbia.scripts.postdoc import *
>>> self = VerifierExpt('PZ_MTEST')
>>> task_key = 'match_state'
>>> self.draw_hard_cases(task_key)
draw_mcc_thresh(task_key)[source]

python -m wbia VerifierExpt.draw mcc_thresh GZ_Master1 match_state python -m wbia VerifierExpt.draw mcc_thresh PZ_Master1 match_state

python -m wbia VerifierExpt.draw mcc_thresh GZ_Master1 photobomb_state python -m wbia VerifierExpt.draw mcc_thresh PZ_Master1 photobomb_state

draw_rerank()[source]
draw_roc(task_key='match_state')[source]

python -m wbia VerifierExpt.draw roc GZ_Master1 photobomb_state python -m wbia VerifierExpt.draw roc GZ_Master1 match_state

python -m wbia VerifierExpt.draw roc PZ_MTEST

classmethod draw_tagged_pair()[source]
measure_all()[source]
CommandLine:
python -m wbia VerifierExpt.measure all GZ_Master1,MantaMatcher,RotanTurtles,LF_ALL python -m wbia VerifierExpt.measure all GZ_Master1
Ignore:
from wbia.scripts.postdoc import * self = VerifierExpt(‘PZ_MTEST’) self.measure_all()
measure_dbstats()[source]

python -m wbia VerifierExpt.measure dbstats GZ_Master1 python -m wbia VerifierExpt.measure dbstats PZ_Master1 python -m wbia VerifierExpt.measure dbstats MantaMatcher python -m wbia VerifierExpt.measure dbstats RotanTurtles

Ignore:
>>> from wbia.scripts.postdoc import *
>>> #self = VerifierExpt('GZ_Master1')
>>> self = VerifierExpt('MantaMatcher')
measure_hard_cases(task_key)[source]

Find a failure case for each class

CommandLine:

python -m wbia VerifierExpt.measure hard_cases GZ_Master1 match_state python -m wbia VerifierExpt.measure hard_cases GZ_Master1 photobomb_state python -m wbia VerifierExpt.draw hard_cases GZ_Master1 match_state python -m wbia VerifierExpt.draw hard_cases GZ_Master1 photobomb_state

python -m wbia VerifierExpt.measure hard_cases PZ_Master1 match_state python -m wbia VerifierExpt.measure hard_cases PZ_Master1 photobomb_state python -m wbia VerifierExpt.draw hard_cases PZ_Master1 match_state python -m wbia VerifierExpt.draw hard_cases PZ_Master1 photobomb_state

python -m wbia VerifierExpt.measure hard_cases PZ_MTEST match_state python -m wbia VerifierExpt.draw hard_cases PZ_MTEST photobomb_state

python -m wbia VerifierExpt.draw hard_cases RotanTurtles match_state python -m wbia VerifierExpt.draw hard_cases MantaMatcher match_state

Ignore:
>>> task_key = 'match_state'
>>> task_key = 'photobomb_state'
>>> from wbia.scripts.postdoc import *
>>> self = VerifierExpt('GZ_Master1')
>>> self._setup()
measure_rerank()[source]
>>> from wbia.scripts.postdoc import *
>>> defaultdb = 'PZ_Master1'
>>> defaultdb = 'GZ_Master1'
>>> self = VerifierExpt(defaultdb)
>>> self._setup()
>>> self.measure_rerank()
measure_thresh(pblm)[source]
>>> from wbia.scripts.postdoc import *
>>> self = VerifierExpt('humpbacks_fb')
>>> self = VerifierExpt('MantaMatcher')
>>> self = VerifierExpt('RotanTurtles')
rrr(verbose=True, reload_module=True)

special class reloading function This function is often injected as rrr of classes

task_nice_lookup = {'match_state': {'match': 'Positive', 'nomatch': 'Negative', 'notcomp': 'Incomparable', 'unknown': 'Unknown', 'unreviewed': 'Unreviewed'}, 'photobomb_state': {'notpb': 'Not Photobomb', 'pb': 'Photobomb'}}
write_metrics(task_key='match_state')[source]

Writes confusion matricies

CommandLine:

python -m wbia VerifierExpt.draw metrics PZ_PB_RF_TRAIN match_state python -m wbia VerifierExpt.draw metrics GZ_Master1 photobomb_state

python -m wbia VerifierExpt.draw metrics PZ_Master1,GZ_Master1 photobomb_state,match_state

Ignore:
>>> from wbia.scripts.postdoc import *
>>> self = VerifierExpt('PZ_Master1')
>>> task_key = 'match_state'
write_sample_info()[source]

python -m wbia VerifierExpt.draw sample_info GZ_Master1

wbia.scripts.postdoc.draw_match_states()[source]
wbia.scripts.postdoc.entropy_potential(infr, u, v, decision)[source]

Returns the number of edges this edge would invalidate

from wbia.algo.graph import demo infr = demo.demodata_infr(pcc_sizes=[5, 2, 4, 2, 2, 1, 1, 1]) infr.refresh_candidate_edges() infr.params[‘redun.neg’] = 1 infr.params[‘redun.pos’] = 1 infr.apply_nondynamic_update()

ut.qtensure() infr.show(show_cand=True, groupby=’name_label’)

u, v = 1, 7 decision = ‘positive’

wbia.scripts.postdoc.plot_cmcs(cdfs, labels, fnum=1, pnum=(1, 1, 1), ymin=0.4)[source]
wbia.scripts.postdoc.prepare_cdfs(cdfs, labels)[source]
wbia.scripts.postdoc.review_pz()[source]

wbia.scripts.rsync_wbiadb module

CommandLine:
python -m wbia.scripts.rsync_wbiadb python -m wbia.scripts.rsync_wbiadb –dryrun
wbia.scripts.rsync_wbiadb.rsync_ibsdb_main()[source]
wbia.scripts.rsync_wbiadb.sync_wbiadb(remote_uri, dbname, mode='pull', workdir=None, port=22, dryrun=False)[source]

syncs an wbiadb without syncing the cache or the chip directory (or the top level image directory because it shouldnt exist unlese it is an old hots database)

wbia.scripts.specialdraw module

wbia.scripts.specialdraw.double_depcache_graph()[source]
CommandLine:

python -m wbia.scripts.specialdraw double_depcache_graph –show –testmode

python -m wbia.scripts.specialdraw double_depcache_graph –save=figures5/doubledepc.png –dpath ~/latex/cand/ –diskshow –figsize=8,20 –dpi=220 –testmode –show –clipwhite python -m wbia.scripts.specialdraw double_depcache_graph –save=figures5/doubledepc.png –dpath ~/latex/cand/ –diskshow –figsize=8,20 –dpi=220 –testmode –show –clipwhite –arrow-width=.5

python -m wbia.scripts.specialdraw double_depcache_graph –save=figures5/doubledepc.png –dpath ~/latex/cand/ –diskshow –figsize=8,20 –dpi=220 –testmode –show –clipwhite –arrow-width=5

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.specialdraw import *  # NOQA
>>> result = double_depcache_graph()
>>> print(result)
>>> ut.quit_if_noshow()
>>> import wbia.plottool as pt
>>> ut.show_if_requested()
wbia.scripts.specialdraw.draw_graph_id()[source]
CommandLine:
python -m wbia.scripts.specialdraw draw_graph_id –show
wbia.scripts.specialdraw.draw_inconsistent_pcc()[source]
CommandLine:
python -m wbia.scripts.specialdraw draw_inconsistent_pcc –show
wbia.scripts.specialdraw.event_space()[source]

pip install matplotlib-venn

wbia.scripts.specialdraw.featweight_fig()[source]
CommandLine:
python -m wbia.scripts.specialdraw featweight_fig –show

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.specialdraw import *  # NOQA
>>> featweight_fig()
>>> ut.show_if_requested()
wbia.scripts.specialdraw.general_identify_flow()[source]
CommandLine:

python -m wbia.scripts.specialdraw general_identify_flow –show –save pairsim.png –dpi=100 –diskshow –clipwhite

python -m wbia.scripts.specialdraw general_identify_flow –dpi=200 –diskshow –clipwhite –dpath ~/latex/cand/ –figsize=20,10 –save figures4/pairprob.png –arrow-width=2.0

Example

>>> # SCRIPT
>>> from wbia.scripts.specialdraw import *  # NOQA
>>> general_identify_flow()
>>> ut.quit_if_noshow()
>>> ut.show_if_requested()
wbia.scripts.specialdraw.graph_iden_cut_demo()[source]
CommandLine:

python -m wbia.scripts.specialdraw graph_iden_cut_demo –show –precut python -m wbia.scripts.specialdraw graph_iden_cut_demo –show –postcut

python -m wbia.scripts.specialdraw graph_iden_cut_demo –precut –save=precut.png –clipwhite python -m wbia.scripts.specialdraw graph_iden_cut_demo –postcut –save=postcut.png –clipwhite

Example

>>> # SCRIPT
>>> from wbia.scripts.specialdraw import *  # NOQA
>>> graph_iden_cut_demo()
>>> ut.quit_if_noshow()
>>> import wbia.plottool as pt
>>> ut.show_if_requested()
wbia.scripts.specialdraw.graphcut_flow()[source]
Returns:name
Return type:?
CommandLine:
python -m wbia.scripts.specialdraw graphcut_flow –show python -m wbia.scripts.specialdraw graphcut_flow –show –save cutflow.png –diskshow –clipwhite python -m wbia.scripts.specialdraw graphcut_flow –save figures4/cutiden.png –diskshow –clipwhite –dpath ~/latex/crall-candidacy-2015/ –figsize=24,10 –arrow-width=2.0

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.specialdraw import *  # NOQA
>>> graphcut_flow()
>>> ut.quit_if_noshow()
>>> import wbia.plottool as pt
>>> ut.show_if_requested()
wbia.scripts.specialdraw.intraoccurrence_connected()[source]
CommandLine:

python -m wbia.scripts.specialdraw intraoccurrence_connected –show python -m wbia.scripts.specialdraw intraoccurrence_connected –show –smaller

python -m wbia.scripts.specialdraw intraoccurrence_connected –precut –save=precut.jpg python -m wbia.scripts.specialdraw intraoccurrence_connected –postcut –save=postcut.jpg

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.specialdraw import *  # NOQA
>>> result = intraoccurrence_connected()
>>> print(result)
>>> ut.quit_if_noshow()
>>> import wbia.plottool as pt
>>> ut.show_if_requested()
wbia.scripts.specialdraw.k_redun_demo()[source]

python -m wbia.scripts.specialdraw k_redun_demo –save=kredun.png python -m wbia.scripts.specialdraw k_redun_demo –show

Example

>>> # SCRIPT
>>> from wbia.scripts.specialdraw import *  # NOQA
>>> k_redun_demo()
>>> ut.quit_if_noshow()
>>> import wbia.plottool as pt
>>> ut.show_if_requested()
wbia.scripts.specialdraw.lighten_hex(hexcolor, amount)[source]
wbia.scripts.specialdraw.merge_viewpoint_graph()[source]
CommandLine:
python -m wbia.scripts.specialdraw merge_viewpoint_graph –show

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.specialdraw import *  # NOQA
>>> result = merge_viewpoint_graph()
>>> print(result)
>>> ut.quit_if_noshow()
>>> import wbia.plottool as pt
>>> ut.show_if_requested()
wbia.scripts.specialdraw.multidb_montage()[source]
CommandLine:
python -m wbia.scripts.specialdraw multidb_montage –save montage.jpg –dpath ~/slides –diskshow –show

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.specialdraw import *  # NOQA
>>> multidb_montage()
wbia.scripts.specialdraw.nx_makenode(graph, name, **attrkw)[source]
wbia.scripts.specialdraw.redun_demo2()[source]

python -m wbia.scripts.specialdraw redun_demo2 –show

wbia.scripts.specialdraw.redun_demo3()[source]

python -m wbia.scripts.specialdraw redun_demo3 –show python -m wbia.scripts.specialdraw redun_demo3 –saveparts=~/slides/incon_redun.jpg –dpi=300

wbia.scripts.specialdraw.scalespace()[source]

THIS DOES NOT SHOW A REAL SCALE SPACE PYRAMID YET. FIXME.

Returns:imgBGRA_warped
Return type:?
CommandLine:
python -m wbia.scripts.specialdraw scalespace –show

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.specialdraw import *  # NOQA
>>> imgBGRA_warped = scalespace()
>>> result = ('imgBGRA_warped = %s' % (ut.repr2(imgBGRA_warped),))
>>> print(result)
>>> ut.quit_if_noshow()
>>> import wbia.plottool as pt
>>> ut.show_if_requested()
wbia.scripts.specialdraw.setcover_example()[source]
CommandLine:
python -m wbia.scripts.specialdraw setcover_example –show

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.specialdraw import *  # NOQA
>>> result = setcover_example()
>>> print(result)
>>> ut.quit_if_noshow()
>>> import wbia.plottool as pt
>>> ut.show_if_requested()
wbia.scripts.specialdraw.show_id_graph()[source]
CommandLine:
python -m wbia.scripts.specialdraw show_id_graph –show python -m wbia.scripts.specialdraw show_id_graph –show

Example

>>> # SCRIPT
>>> from wbia.scripts.specialdraw import *  # NOQA
>>> show_id_graph()
>>> ut.quit_if_noshow()
>>> import wbia.plottool as pt
>>> ut.show_if_requested()
wbia.scripts.specialdraw.simple_vsone_matches()[source]
CommandLine:
python -m wbia.scripts.specialdraw simple_vsone_matches –show
–db GZ_Master1 –aids=2811,2810

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.specialdraw import *  # NOQA
>>> simple_vsone_matches()
>>> ut.show_if_requested()
wbia.scripts.specialdraw.system_diagram()[source]
CommandLine:
python -m wbia.scripts.specialdraw system_diagram –show

wbia.scripts.thesis module

class wbia.scripts.thesis.Chap3(dbname=None)[source]

Bases: wbia.scripts._thesis_helpers.DBInputs, wbia.scripts.thesis.Chap3Draw, wbia.scripts.thesis.Chap3Measures

classmethod agg_dbstats()[source]
CommandLine:
python -m wbia Chap3.agg_dbstats python -m wbia Chap3.measure_dbstats

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.thesis import *  # NOQA
>>> result = Chap3.agg_dbstats()
>>> print(result)
base_dpath = '/home/docs/latex/crall-thesis-2017/figures3'
classmethod draw_agg_baseline()[source]
CommandLine:
python -m wbia Chap3.draw_agg_baseline –diskshow

Example

>>> # SCRIPT
>>> from wbia.scripts.thesis import *  # NOQA
>>> Chap3.draw_agg_baseline()
measure_all()[source]

Example

from wbia.scripts.thesis import * self = Chap3(‘PZ_Master1’) self.measure_all() self = Chap3(‘GZ_Master1’) self.measure_all() self = Chap3(‘GIRM_Master1’) self.measure_all()

rrr(verbose=True, reload_module=True)

special class reloading function This function is often injected as rrr of classes

classmethod run_all()[source]
CommandLine:
python -m wbia Chap3.run_all
class wbia.scripts.thesis.Chap3Draw[source]

Bases: object

draw_all()[source]
CommandLine:
python -m wbia Chap3.draw_all –dbs=GZ_Master1,PZ_Master1,GIRM_Master1

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.thesis import *  # NOQA
>>> dbname = ut.get_argval('--db', default='PZ_MTEST')
>>> dbnames = ut.get_argval('--dbs', type_=list, default=[dbname])
>>> for dbname in dbnames:
>>>     print('dbname = %r' % (dbname,))
>>>     self = Chap3(dbname)
>>>     self.draw_all()
draw_baseline()[source]
draw_foregroundness()[source]

wbia Chap3.measure foregroundness –dbs=GZ_Master1,PZ_Master1 wbia Chap3.draw foregroundness –dbs=GZ_Master1,PZ_Master1

draw_invar()[source]

wbia Chap3.measure invar –dbs=GZ_Master1,PZ_Master1 wbia Chap3.draw invar –dbs=GZ_Master1,PZ_Master1

draw_kexpt()[source]

wbia Chap3.measure kexpt –dbs=GZ_Master1,PZ_Master1 wbia Chap3.draw kexpt –dbs=GZ_Master1,PZ_Master1 –diskshow

draw_nsum()[source]

wbia Chap3.measure nsum –dbs=GZ_Master1,PZ_Master1 wbia Chap3.draw nsum –dbs=GZ_Master1,PZ_Master1

draw_nsum_simple()[source]

wbia Chap3.measure nsum –dbs=GZ_Master1,PZ_Master1 wbia Chap3.draw nsum –dbs=GZ_Master1,PZ_Master1

Ignore:
>>> from wbia.scripts.thesis import *  # NOQA
>>> self = Chap3('PZ_Master1')
draw_smk()[source]

wbia Chap3.measure smk –dbs=GZ_Master1,PZ_Master1 wbia Chap3.draw smk –dbs=GZ_Master1,PZ_Master1

draw_time_distri()[source]
CommandLine:
python -m wbia Chap3.draw_time_distri –dbs=GZ_Master1,PZ_Master1,GIRM_MasterV python -m wbia Chap3.draw_time_distri –dbs=GIRM_Master1 python -m wbia Chap3.draw_time_distri –dbs=GZ_Master1 python -m wbia Chap3.draw_time_distri –dbs=PZ_Master1 python -m wbia Chap3.draw_time_distri –dbs=humpbacks_fb

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.thesis import *  # NOQA
>>> dbname = ut.get_argval('--db', default='PZ_MTEST')
>>> dbnames = ut.get_argval('--dbs', type_=list, default=[dbname])
>>> for dbname in dbnames:
>>>     print('dbname = %r' % (dbname,))
>>>     self = Chap3(dbname)
>>>     self.draw_time_distri()
rrr(verbose=True, reload_module=True)

special class reloading function This function is often injected as rrr of classes

class wbia.scripts.thesis.Chap3Measures[source]

Bases: object

draw_foregroundness_intra()[source]

python -m wbia Chap3.measure foregroundness_intra –dbs=GZ_Master1,PZ_Master1 python -m wbia Chap3.draw foregroundness_intra –dbs=GZ_Master1,PZ_Master1 –diskshow

measure_baseline()[source]
>>> from wbia.scripts.thesis import *
>>> self = Chap3('GZ_Master1')
>>> self._precollect()
measure_dbsize()[source]
measure_dbstats()[source]
measure_foregroundness()[source]
measure_foregroundness_intra()[source]
measure_invar()[source]
measure_kexpt()[source]
measure_nsum()[source]

python -m wbia Chap3.measure nsum –dbs=GZ_Master1,PZ_Master1 python -m wbia Chap3.draw nsum –dbs=GZ_Master1,PZ_Master1 –diskshow

from wbia.scripts.thesis import * self = Chap3(‘GZ_Master1’) self = Chap3(‘PZ_Master1’) self = Chap3(‘PZ_MTEST’) self._precollect()

measure_smk()[source]

python -m wbia Chap3.measure smk –dbs=GZ_Master1,PZ_Master1 python -m wbia Chap3.draw smk –dbs=GZ_Master1,PZ_Master1 –diskshow

rrr(verbose=True, reload_module=True)

special class reloading function This function is often injected as rrr of classes

class wbia.scripts.thesis.Chap4(dbname=None)[source]

Bases: wbia.scripts._thesis_helpers.DBInputs

Collect data from experiments to visualize

TODO: redo save/loading of measurments

Ignore:
>>> from wbia.scripts.thesis import *
>>> fpath = ut.glob(ut.truepath('~/Desktop/mtest_plots'), '*.pkl')[0]
>>> self = ut.load_data(fpath)
base_dpath = '/home/docs/latex/crall-thesis-2017/figures4'
custom_single_hard_case()[source]

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.thesis import *
>>> defaultdb = 'PZ_PB_RF_TRAIN'
>>> #defaultdb = 'GZ_Master1'
>>> defaultdb = 'PZ_MTEST'
>>> self = Chap4.collect(defaultdb)
>>> self.dbname = 'PZ_PB_RF_TRAIN'
draw_all()[source]
CommandLine:
python -m wbia Chap4.draw_all –db PZ_MTEST python -m wbia Chap4.draw_all –db PZ_PB_RF_TRAIN python -m wbia Chap4.draw_all –db GZ_Master1 python -m wbia Chap4.draw_all –db PZ_Master1

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.thesis import *
>>> dbname = ut.get_argval('--db', default='PZ_MTEST')
>>> dbnames = ut.get_argval('--dbs', type_=list, default=[dbname])
>>> for dbname in dbnames:
>>>     print('dbname = %r' % (dbname,))
>>>     self = Chap4(dbname)
>>>     self.draw_all()
draw_class_score_hist()[source]

Plots distribution of positive and negative scores

draw_hard_cases(task_key)[source]

draw hard cases with and without overlay

python -m wbia Chap4.draw hard_cases GZ_Master1 match_state python -m wbia Chap4.draw hard_cases PZ_Master1 match_state python -m wbia Chap4.draw hard_cases PZ_Master1 photobomb_state python -m wbia Chap4.draw hard_cases GZ_Master1 photobomb_state

>>> from wbia.scripts.thesis import *
>>> self = Chap4('PZ_MTEST')
>>> task_key = 'match_state'
>>> self.draw_hard_cases(task_key)
draw_mcc_thresh(task_key)[source]

python -m wbia Chap4.draw mcc_thresh GZ_Master1 match_state python -m wbia Chap4.draw mcc_thresh PZ_Master1 match_state

python -m wbia Chap4.draw mcc_thresh GZ_Master1 photobomb_state python -m wbia Chap4.draw mcc_thresh PZ_Master1 photobomb_state

draw_prune()[source]
CommandLine:

python -m wbia Chap4.draw importance GZ_Master1

python -m wbia Chap4.draw importance PZ_Master1 photobomb_state python -m wbia Chap4.draw importance PZ_Master1 match_state

python -m wbia Chap4.draw prune GZ_Master1,PZ_Master1 python -m wbia Chap4.draw prune PZ_Master1

>>> from wbia.scripts.thesis import *
>>> self = Chap4('PZ_Master1')
>>> self = Chap4('GZ_Master1')
>>> self = Chap4('PZ_MTEST')
draw_rerank()[source]
draw_roc(task_key)[source]

python -m wbia Chap4.draw roc GZ_Master1 photobomb_state python -m wbia Chap4.draw roc GZ_Master1 match_state

classmethod draw_tagged_pair()[source]
draw_wordcloud(task_key)[source]
measure_all()[source]
CommandLine:

python -m wbia Chap4.measure_all –db PZ_PB_RF_TRAIN python -m wbia Chap4.measure_all –db PZ_MTEST python -m wbia Chap4.measure_all

python -m wbia Chap4.measure_all –db GZ_Master1

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.thesis import *
>>> dbname = ut.get_argval('--db', default='PZ_MTEST')
>>> dbnames = ut.get_argval('--dbs', type_=list, default=[dbname])
>>> for dbname in dbnames:
>>>     print('dbname = %r' % (dbname,))
>>>     self = Chap4(dbname)
>>>     self.measure_all()
measure_hard_cases(task_key)[source]

Find a failure case for each class

CommandLine:

python -m wbia Chap4.measure hard_cases GZ_Master1 match_state python -m wbia Chap4.measure hard_cases GZ_Master1 photobomb_state python -m wbia Chap4.draw hard_cases GZ_Master1 match_state python -m wbia Chap4.draw hard_cases GZ_Master1 photobomb_state

python -m wbia Chap4.measure hard_cases PZ_Master1 match_state python -m wbia Chap4.measure hard_cases PZ_Master1 photobomb_state python -m wbia Chap4.draw hard_cases PZ_Master1 match_state python -m wbia Chap4.draw hard_cases PZ_Master1 photobomb_state

python -m wbia Chap4.measure hard_cases PZ_MTEST match_state python -m wbia Chap4.draw hard_cases PZ_MTEST photobomb_state

python -m wbia Chap4.measure hard_cases MantaMatcher match_state

Ignore:
>>> task_key = 'match_state'
>>> task_key = 'photobomb_state'
>>> from wbia.scripts.thesis import *
>>> self = Chap4('GZ_Master1')
>>> self._setup()
measure_prune()[source]
>>> from wbia.scripts.thesis import *
>>> self = Chap4('GZ_Master1')
>>> self = Chap4('PZ_Master1')
>>> self = Chap4('PZ_MTEST')
measure_rerank()[source]
>>> from wbia.scripts.thesis import *
>>> defaultdb = 'PZ_Master1'
>>> defaultdb = 'GZ_Master1'
>>> self = Chap4(defaultdb)
>>> self._setup()
>>> self.measure_rerank()
measure_thresh(pblm)[source]
rrr(verbose=True, reload_module=True)

special class reloading function This function is often injected as rrr of classes

task_nice_lookup = {'match_state': {'match': 'Positive', 'nomatch': 'Negative', 'notcomp': 'Incomparable', 'unknown': 'Unknown', 'unreviewed': 'Unreviewed'}, 'photobomb_state': {'notpb': 'Not Photobomb', 'pb': 'Photobomb'}}
write_importance(task_key)[source]

python -m wbia Chap4.draw importance GZ_Master1,PZ_Master1 match_state

python -m wbia Chap4.draw importance GZ_Master1 match_state python -m wbia Chap4.draw importance PZ_Master1 match_state

python -m wbia Chap4.draw importance GZ_Master1 photobomb_state python -m wbia Chap4.draw importance PZ_Master1 photobomb_state

write_metrics(task_key='match_state')[source]
CommandLine:

python -m wbia Chap4.draw metrics PZ_PB_RF_TRAIN match_state python -m wbia Chap4.draw metrics GZ_Master1 photobomb_state

python -m wbia Chap4.draw metrics PZ_Master1,GZ_Master1 photobomb_state,match_state

Ignore:
>>> from wbia.scripts.thesis import *
>>> self = Chap4('PZ_Master1')
>>> task_key = 'match_state'
write_metrics2(task_key='match_state')[source]
CommandLine:

python -m wbia Chap4.draw metrics PZ_PB_RF_TRAIN match_state python -m wbia Chap4.draw metrics2 PZ_Master1 photobomb_state python -m wbia Chap4.draw metrics2 GZ_Master1 photobomb_state

python -m wbia Chap4.draw metrics2 GZ_Master1 photobomb_state

write_sample_info()[source]

python -m wbia Chap4.draw sample_info GZ_Master1

class wbia.scripts.thesis.Chap5(dbname=None)[source]

Bases: wbia.scripts._thesis_helpers.DBInputs

python -m wbia Chap5.measure all GZ_Master1 python -m wbia Chap5.measure all PZ_Master1 python -m wbia Chap5.draw all GZ_Master1 python -m wbia Chap5.draw all PZ_Master1 –comp Leviathan

python -m wbia Chap5.draw error_graph_analysis GZ_Master1 python -m wbia Chap5.draw error_graph_analysis PZ_Master1 –comp Leviathan

base_dpath = '/home/docs/latex/crall-thesis-2017/figures5'
draw_all()[source]
CommandLine:

python -m wbia Chap5.draw all GZ_Master1 python -m wbia Chap5.draw error_graph_analysis GZ_Master1

python -m wbia Chap5.draw all PZ_Master1 python -m wbia Chap5.draw error_graph_analysis PZ_Master1

Ignore:
>>> from wbia.scripts.thesis import *
>>> self = Chap4('GZ_Master1')
draw_error_graph_analysis()[source]
CommandLine:
python -m wbia Chap5.draw error_graph_analysis GZ_Master1 python -m wbia Chap5.draw error_graph_analysis PZ_Master1
Ignore:
>>> from wbia.scripts.thesis import *
>>> self = Chap5('GZ_Master1')
>>> self = Chap5('PZ_Master1')
draw_refresh()[source]
CommandLine:
python -m wbia Chap5.draw refresh GZ_Master1 –diskshow python -m wbia Chap5.draw refresh PZ_Master1 –diskshow
draw_simulation()[source]
CommandLine:
python -m wbia Chap5.draw simulation PZ_MTEST –diskshow python -m wbia Chap5.draw simulation GZ_Master1 –diskshow python -m wbia Chap5.draw simulation PZ_Master1 –diskshow
Ignore:
>>> from wbia.scripts.thesis import *
>>> self = Chap5('GZ_Master')
draw_simulation2()[source]
CommandLine:
python -m wbia Chap5.draw_simulation2 –db PZ_MTEST –show python -m wbia Chap5.draw_simulation2 –db GZ_Master1 –show python -m wbia Chap5.draw_simulation2 –db PZ_Master1 –show

Example

>>> # DISABLE_DOCTEST
>>> from wbia.scripts.thesis import *
>>> dbname = ut.get_argval('--db', default='GZ_Master1')
>>> self = Chap5(dbname)
>>> self.draw_simulation2()
>>> ut.show_if_requested()
measure_all()[source]
measure_dbstats()[source]

python -m wbia Chap5.draw dbstats GZ_Master1

python -m wbia Chap5.measure dbstats PZ_Master1 python -m wbia Chap5.draw dbstats PZ_Master1

Ignore:
>>> from wbia.scripts.thesis import *
>>> self = Chap5('GZ_Master1')
measure_simulation()[source]
CommandLine:
python -m wbia Chap5.measure simulation GZ_Master1 python -m wbia Chap5.measure simulation PZ_Master1
Ignore:
>>> from wbia.scripts.thesis import *
>>> self = Chap5('GZ_Master1')
print_error_analysis()[source]
Ignore:
>>> from wbia.scripts.thesis import *
>>> self = Chap5('GZ_Master1')
>>> self = Chap5('PZ_Master1')
rrr(verbose=True, reload_module=True)

special class reloading function This function is often injected as rrr of classes

write_dbstats()[source]

# TODO: write info about what dataset was used

CommandLine:

python -m wbia Chap5.measure dbstats PZ_Master1 python -m wbia Chap5.measure dbstats PZ_Master1

python -m wbia Chap5.measure simulation GZ_Master1 python -m wbia Chap5.draw dbstats –db GZ_Master1 –diskshow

Ignore:
>>> from wbia.scripts.thesis import *
>>> self = Chap5('GZ_Master1')
write_error_tables()[source]
CommandLine:
python -m wbia Chap5.draw error_tables PZ_Master1 python -m wbia Chap5.draw error_tables GZ_Master1
Ignore:
>>> from wbia.scripts.thesis import *
>>> from wbia.scripts.thesis import _ranking_hist, _ranking_cdf
>>> self = Chap5('GZ_Master1')
class wbia.scripts.thesis.Sampler[source]

Bases: object

class wbia.scripts.thesis.SplitSample(qaids, daids)[source]

Bases: utool.util_dev.NiceRepr

wbia.scripts.thesis.feat_alias(k)[source]
wbia.scripts.thesis.label_alias(k)[source]
wbia.scripts.thesis.plot_cmcs(cdfs, labels, fnum=1, pnum=(1, 1, 1), ymin=0.4)[source]
wbia.scripts.thesis.plot_cmcs2(cdfs, labels, fnum=1, **kwargs)[source]
wbia.scripts.thesis.prepare_cdfs(cdfs, labels)[source]

Module contents