wbia - Wildbook IA¶
Wildbook IA Packages
- wbia.algo package
- wbia.control package
- wbia.dbio package
- wbia.detecttools package
- wbia.dtool package
- wbia.expt package
- wbia.gui package
- wbia.guitool package
- wbia.init package
- wbia.other package
- wbia.plottool package
- wbia.scripts package
- wbia.templates package
- wbia.tests package
- wbia.viz package
- wbia.web package
IBEIS: main package init
- TODO: LAZY IMPORTS?
- http://code.activestate.com/recipes/473888-lazy-module-imports/
-
wbia.
rrrr
(verbose=True)¶ Reloads wbia and submodules
-
wbia.
run_experiment
(e='print', db='PZ_MTEST', dbdir=None, a=['unctrl'], t=['default'], initial_aids=None, qaid_override=None, daid_override=None, lazy=False, **kwargs)[source]¶ Convience function
- CommandLine:
- wbia -e print
Parameters: - e (str) – (default = ‘print’)
- db (str) – (default = ‘PZ_MTEST’)
- a (list) – (default = [‘unctrl’])
- t (list) – (default = [‘default’])
- qaid_override (None) – (default = None)
- lazy (bool) – (default = False)
Returns: func - live python function
Return type: function
- CommandLine:
- python -m wbia.__init__ –exec-run_experiment –show
Example
>>> # DISABLE_DOCTEST >>> from wbia import * # NOQA >>> e = 'rank_cmc' >>> db = 'testdb1' >>> a = ['default:species=primary'] >>> t = ['default'] >>> initial_aids = [2, 3, 4, 7, 9, 10, 11] >>> qaid_override = [1, 9, 10, 11, 2, 3] >>> testres = run_experiment(e, db, a, t, qaid_override=qaid_override, >>> initial_aids=initial_aids) >>> result = ('testres = %s' % (str(testres),)) >>> print(result) >>> ut.quit_if_noshow() >>> testres.draw_func() >>> ut.show_if_requested()
wbia.__main__¶
Runs IBIES gui
wbia._devcmds_wbia¶
DEPRICATE MOST OF THIS FILE IN FAVOR OF DOCTEST SCRIPTS
-
wbia._devcmds_wbia.
export
(ibs, aid_pairs=None)[source]¶ 3 - 4 different animals 2 views of each matching keypoint coordinates on each annotation
-
wbia._devcmds_wbia.
openworkdirs_test
()[source]¶ - problems:
- PZ_DanExt_All PZ_DanExt_Test GZ_March2012 Wildebeest_ONLY_MATCHES
python dev.py –convert –dbdir /raid/work/PZ_Marianne –force-delete python dev.py –convert –dbdir /raid/work/SL_Siva –force-delete python dev.py –convert –dbdir /raid/work/PZ_SweatwaterSmall –force-delete
wbia._devscript¶
wbia._wbia_object¶
-
class
wbia._wbia_object.
ObjectList1D
(rowids, ibs, config=None, caching=False, asarray=False)[source]¶ Bases:
utool.util_dev.NiceRepr
,utool.util_class.HashComparable2
An object that efficiently operates on a list of wbia objects using vectorized code. Single instances can be returned as ObjectScalar0D’s
-
class
wbia._wbia_object.
ObjectScalar0D
(obj1d)[source]¶ Bases:
utool.util_dev.NiceRepr
,utool.util_class.HashComparable2
This actually stores a ObjectList1D of length 1 and simply calls those functions where available
-
class
wbia._wbia_object.
ObjectView1D
(rowids, obj1d, cache=None)[source]¶ Bases:
utool.util_dev.NiceRepr
Allows for proxy caching.
Example
>>> # ENABLE_DOCTEST >>> from wbia._wbia_object import * # NOQA >>> import wbia >>> ibs = wbia.opendb(defaultdb='testdb1') >>> aids = ibs.get_valid_aids() >>> a = self = annots = ibs.annots(aids) >>> rowids = [1, 1, 3, 2, 1, 2] >>> self = v = a.view(rowids) >>> assert np.all(v.vecs[0] == v.vecs[1]) >>> assert v.vecs[0] is v.vecs[1] >>> assert v.vecs[0] is not v.vecs[2]
-
view
(rowids)[source]¶ returns a view of a view that uses the same per-item cache
Example
>>> # ENABLE_DOCTEST >>> from wbia._wbia_object import * # NOQA >>> import wbia >>> ibs = wbia.opendb(defaultdb='testdb1') >>> aids = ibs.get_valid_aids() >>> annots = ibs.annots(aids) >>> self = annots.view(annots._rowids) >>> v1 = self.view([1, 1, 2, 3, 1, 2]) >>> v2 = self.view([3, 4, 5]) >>> v3 = self.view([1, 4]) >>> v4 = self.view(3) >>> lazy4 = v4._make_lazy_dict() >>> assert v1.vecs[0] is v3.vecs[0] >>> assert v2._cache is self._cache >>> assert v2._cache is v1._cache
-
wbia.annotmatch_funcs¶
-
wbia.annotmatch_funcs.
get_annot_has_reviewed_matching_aids
(ibs, aid_list, eager=True, nInput=None)[source]¶
-
wbia.annotmatch_funcs.
get_annot_num_reviewed_matching_aids
(ibs, aid1_list, eager=True, nInput=None)[source]¶ Parameters: - aid_list (int) – list of annotation ids
- eager (bool) –
- nInput (None) –
Returns: num_annot_reviewed_list
Return type: list
- CommandLine:
- python -m wbia.annotmatch_funcs –test-get_annot_num_reviewed_matching_aids
Example
>>> # DISABLE_DOCTEST >>> from wbia.annotmatch_funcs import * # NOQA >>> import wbia >>> ibs = wbia.opendb('testdb2') >>> aid1_list = ibs.get_valid_aids() >>> eager = True >>> nInput = None >>> num_annot_reviewed_list = get_annot_num_reviewed_matching_aids(ibs, aid_list, eager, nInput) >>> result = str(num_annot_reviewed_list) >>> print(result)
-
wbia.annotmatch_funcs.
get_annot_pair_is_reviewed
(ibs, aid1_list, aid2_list)[source]¶ Parameters: - aid1_list (list) –
- aid2_list (list) –
Returns: annotmatch_reviewed_list
Return type: list
- CommandLine:
- python -m wbia.annotmatch_funcs –test-get_annot_pair_is_reviewed
Example
>>> # DISABLE_DOCTEST >>> from wbia.annotmatch_funcs import * # NOQA >>> import wbia >>> ibs = wbia.opendb('testdb2') >>> aid_list = ibs.get_valid_aids() >>> pairs = list(ut.product(aid_list, aid_list)) >>> aid1_list = ut.get_list_column(pairs, 0) >>> aid2_list = ut.get_list_column(pairs, 1) >>> annotmatch_reviewed_list = get_annot_pair_is_reviewed(ibs, aid1_list, aid2_list) >>> reviewed_pairs = ut.compress(pairs, annotmatch_reviewed_list) >>> result = len(reviewed_pairs) >>> print(result) 104
-
wbia.annotmatch_funcs.
get_annot_pair_timedelta
(ibs, aid_list1, aid_list2)[source]¶ Parameters: - ibs (IBEISController) – wbia controller object
- aid_list1 (int) – list of annotation ids
- aid_list2 (int) – list of annotation ids
Returns: timedelta_list
Return type: list
- CommandLine:
- python -m wbia.annotmatch_funcs –test-get_annot_pair_timedelta
Example
>>> # ENABLE_DOCTEST >>> from wbia.annotmatch_funcs import * # NOQA >>> import wbia >>> ibs = wbia.opendb('PZ_MTEST') >>> aid_list = ibs.get_valid_aids(hasgt=True) >>> unixtimes = ibs.get_annot_image_unixtimes_asfloat(aid_list) >>> aid_list = ut.compress(aid_list, ~np.isnan(unixtimes)) >>> gt_aids_list = ibs.get_annot_groundtruth(aid_list, daid_list=aid_list) >>> flags = np.array(list(map(len, gt_aids_list))) > 0 >>> aid_list1 = ut.compress(aid_list, flags)[0:5] >>> aid_list2 = ut.take_column(gt_aids_list, 0)[0:5] >>> timedelta_list = ibs.get_annot_pair_timedelta(aid_list1, aid_list2) >>> result = ut.repr2(timedelta_list, precision=1) >>> print(result) np.array([7.6e+07, 7.6e+07, 2.4e+06, 2.0e+08, 9.7e+07])
-
wbia.annotmatch_funcs.
get_annot_reviewed_matching_aids
(ibs, aid_list, eager=True, nInput=None)[source]¶ Returns a list of the aids that were reviewed as candidate matches to the input aid
-
wbia.annotmatch_funcs.
get_annotmatch_rowids_between
(ibs, aids1, aids2, method=None)[source]¶ Example
>>> # ENABLE_DOCTEST >>> from wbia.annotmatch_funcs import * # NOQA >>> import wbia >>> ibs = wbia.opendb('PZ_MTEST') >>> aids1 = aids2 = [1, 2, 3, 4, 5, 6] >>> rowids_between = ibs.get_annotmatch_rowids_between >>> ams1 = sorted(rowids_between(aids1, aids2, method=1)) >>> ams2 = sorted(rowids_between(aids1, aids2, method=2)) >>> assert len(ub.find_duplicates(ams1)) == 0 >>> assert len(ub.find_duplicates(ams2)) == 0 >>> assert sorted(ams2) == sorted(ams1)
-
wbia.annotmatch_funcs.
get_annotmatch_rowids_from_aid
(ibs, aid_list, eager=True, nInput=None, force_method=None)[source]¶ Undirected version Returns a list of the aids that were reviewed as candidate matches to the input aid aid_list = ibs.get_valid_aids()
- CommandLine:
- python -m wbia.annotmatch_funcs –exec-get_annotmatch_rowids_from_aid python -m wbia.annotmatch_funcs –exec-get_annotmatch_rowids_from_aid:1 –show
Example
>>> # DISABLE_DOCTEST >>> from wbia.annotmatch_funcs import * # NOQA >>> import wbia >>> ibs = wbia.opendb(defaultdb='testdb1') >>> ut.exec_funckw(ibs.get_annotmatch_rowids_from_aid, globals()) >>> aid_list = ibs.get_valid_aids()[0:4] >>> annotmatch_rowid_list = ibs.get_annotmatch_rowids_from_aid(aid_list, >>> eager, nInput) >>> result = ('annotmatch_rowid_list = %s' % (str(annotmatch_rowid_list),)) >>> print(result)
-
wbia.annotmatch_funcs.
get_annotmatch_rowids_from_aid1
(ibs, aid1_list, eager=True, nInput=None)[source]¶ TODO autogenerate
Returns a list of the aids that were reviewed as candidate matches to the input aid
aid_list = ibs.get_valid_aids() :param ibs: wbia controller object :type ibs: IBEISController :param aid1_list: :type aid1_list: list :param eager: (default = True) :type eager: bool :param nInput: (default = None) :type nInput: None
Returns: annotmatch_rowid_list Return type: list
-
wbia.annotmatch_funcs.
get_annotmatch_rowids_from_aid2
(ibs, aid2_list, eager=True, nInput=None, force_method=None)[source]¶ # This one is slow because aid2 is the second part of the index Returns a list of the aids that were reviewed as candidate matches to the input aid
-
wbia.annotmatch_funcs.
get_match_truths
(ibs, aids1, aids2)[source]¶ Uses NIDS to verify truth. TODO: rectify with annotmatch table
Parameters: - ibs (IBEISController) – wbia controller object
- aids1 (list) –
- aids2 (list) –
Returns: - truth_codes - see
wbia.constants.EVIDENCE_DECISION.INT_TO_CODE for code definitions
Return type: list[int]
- CommandLine:
- python -m wbia.other.ibsfuncs –test-get_match_truths
Example
>>> # ENABLE_DOCTEST >>> from wbia.annotmatch_funcs import * # NOQA >>> import wbia >>> ibs = wbia.opendb('testdb1') >>> aids1 = ibs.get_valid_aids() >>> aids2 = ut.list_roll(ibs.get_valid_aids(), -1) >>> truth_codes = get_match_truths(ibs, aids1, aids2) >>> print('truth_codes = %s' % ut.repr2(truth_codes)) >>> target = np.array([3, 1, 3, 3, 1, 0, 0, 3, 3, 3, 3, 0, 3]) >>> assert np.all(truth_codes == target)
-
wbia.annotmatch_funcs.
set_annot_pair_as_negative_match
(ibs, aid1, aid2, dryrun=False, on_nontrivial_split=None, logger=None)[source]¶ TODO: ELEVATE THIS FUNCTION
Parameters: - ibs (IBEISController) – wbia controller object
- aid1 (int) – annotation id
- aid2 (int) – annotation id
- dryrun (bool) –
- CommandLine:
- python -m wbia.annotmatch_funcs –test-set_annot_pair_as_negative_match
Example
>>> # ENABLE_DOCTEST >>> from wbia.annotmatch_funcs import * # NOQA >>> import wbia >>> ibs = wbia.opendb('testdb1') >>> aid1, aid2 = ibs.get_valid_aids()[0:2] >>> dryrun = True >>> result = set_annot_pair_as_negative_match(ibs, aid1, aid2, dryrun) >>> print(result)
-
wbia.annotmatch_funcs.
set_annot_pair_as_positive_match
(ibs, aid1, aid2, dryrun=False, on_nontrivial_merge=None, logger=None)[source]¶ Safe way to perform links. Errors on invalid operations.
TODO: ELEVATE THIS FUNCTION Change into make_task_set_annot_pair_as_positive_match and it returns what needs to be done.
- Need to test several cases:
- uknown, unknown knownA, knownA knownB, knownA unknown, knownA knownA, unknown
Parameters: - ibs (IBEISController) – wbia controller object
- aid1 (int) – query annotation id
- aid2 (int) – matching annotation id
- CommandLine:
- python -m wbia.annotmatch_funcs –test-set_annot_pair_as_positive_match
Example
>>> # ENABLE_DOCTEST >>> from wbia.annotmatch_funcs import * # NOQA >>> import wbia >>> ibs = wbia.opendb('testdb1') >>> aid1, aid2 = ibs.get_valid_aids()[0:2] >>> dryrun = True >>> status = set_annot_pair_as_positive_match(ibs, aid1, aid2, dryrun) >>> print(status)
wbia.annots¶
-
class
wbia.annots.
AnnotGroups
(annots_list, ibs)[source]¶ Bases:
utool.util_dev.NiceRepr
Effciently handle operations on multiple groups of annotations
-
age_months_est_max
¶
-
age_months_est_min
¶
-
aid
¶
-
aids
¶
-
bbox_area
¶
-
bboxes
¶
-
contact_aids
¶
-
detect_confidence
¶
-
encounter_text
¶
-
exemplar_flags
¶
-
gids
¶
-
groundfalse
¶
-
groundtruth
¶
-
has_groundtruth
¶
-
has_reviewed_matching_aids
¶
-
hashid_semantic_uuid
¶
-
hashid_uuid
¶
-
hashid_visual_uuid
¶
-
image_contributor_tag
¶
-
image_datetime_str
¶
-
image_gps
¶
-
image_gps2
¶
-
image_set_texts
¶
-
image_unixtimes_asfloat
¶
-
image_uuids
¶
-
images
¶
-
imgset_uuids
¶
-
imgsetids
¶
returns pairwise tags within the annotation group
-
multiple
¶
-
name_uuids
¶
-
names
¶
-
nids
¶
-
notes
¶
-
num_contact_aids
¶
-
num_groundtruth
¶
-
num_reviewed_matching_aids
¶
-
occurrence_text
¶
-
otherimage_aids
¶
-
parent_aid
¶
-
primary_imageset
¶
-
qualities
¶
-
quality_texts
¶
-
reviewed
¶
-
reviewed_matching_aids
¶
-
rrr
(verbose=True, reload_module=True)¶ special class reloading function This function is often injected as rrr of classes
-
semantic_uuids
¶
-
sex
¶
-
sex_texts
¶
-
species
¶
-
species_rowids
¶
-
species_texts
¶
-
species_uuids
¶
-
static_encounter
¶
-
thetas
¶
-
uuids
¶
-
verts
¶
-
viewpoint_code
¶
-
viewpoint_int
¶
-
visual_uuids
¶
-
yaw_texts
¶
-
yaws
¶
-
yaws_asfloat
¶
-
-
class
wbia.annots.
AnnotMatches
(rowids, ibs, config=None, caching=False, asarray=False)[source]¶ Bases:
wbia._wbia_object.ObjectList1D
Represents a group of annotations. Efficiently accesses properties from a database using lazy evaluation.
- CommandLine:
- python -m wbia.annots Annots
Example
>>> # ENABLE_DOCTEST >>> from wbia.annots import * # NOQA >>> import wbia >>> ibs = wbia.opendb(defaultdb='testdb1') >>> aids = ibs.get_valid_aids() >>> annots = Annots(aids, ibs) >>> ams = annots.get_am_rowids() >>> matches = self = ibs.matches() >>> ed1 = matches.evidence_decision >>> md2 = matches.meta_decision >>> table = ibs.db.get_table_as_pandas('annotmatch') >>> assert len(table) == len(matches)
-
aid1
¶
-
aid2
¶
-
confidence
¶
-
confidence_code
¶
-
count
¶
-
edges
¶
-
evidence_decision
¶
-
evidence_decision_code
¶
-
meta_decision
¶
-
meta_decision_code
¶
-
posixtime_modified
¶
-
reviewer
¶
-
rrr
()¶ Dynamic module reloading
-
tag_text
¶
-
class
wbia.annots.
Annots
(rowids, ibs, config=None, caching=False, asarray=False)[source]¶ Bases:
wbia._wbia_object.ObjectList1D
Represents a group of annotations. Efficiently accesses properties from a database using lazy evaluation.
- CommandLine:
- python -m wbia.annots Annots
Example
>>> # ENABLE_DOCTEST >>> from wbia.annots import * # NOQA >>> import wbia >>> ibs = wbia.opendb(defaultdb='testdb1') >>> aids = ibs.get_valid_aids() >>> a = self = annots = Annots(aids, ibs) >>> a.preload('vecs', 'kpts', 'nids') >>> print(Annots.mro()) >>> print(ut.depth_profile(a.vecs)) >>> print(a)
Example
>>> # ENABLE_DOCTEST >>> from wbia.annots import * # NOQA >>> import wbia >>> ibs = wbia.opendb(defaultdb='testdb1') >>> aids = ibs.get_valid_aids() >>> a = self = annots = Annots(aids, ibs) >>> a.preload('vecs', 'kpts', 'nids') >>> a.disconnect() >>> assert 'vecs' in a._internal_attrs.keys() >>> assert a._ibs is None >>> ut.assert_raises(KeyError, a._get_num_feats) >>> a._ibs = ibs >>> assert len(a._get_num_feats()) > 0
-
age_months_est_max
¶
-
age_months_est_min
¶
-
aid
¶
-
aids
¶
-
bbox_area
¶
-
bboxes
¶
-
chip_dlensqrd
¶
-
chip_fpath
¶
-
chip_size
¶
-
chip_sizes
¶
-
chip_thumbpath
¶
-
chip_thumbtup
¶
-
chips
¶
-
contact_aids
¶
-
detect_confidence
¶
-
encounter_text
¶
-
exemplar_flags
¶
-
feat_rowids
¶
-
featweight_rowids
¶
-
fgweights
¶
-
fgweights_subset
¶
-
get_am_rowids
(internal=True)[source]¶ if internal is True returns am rowids only between annotations in this Annots object, otherwise returns any am rowid that contains any aid in this Annots object.
-
gids
¶
-
gps
¶
-
groundfalse
¶
-
groundtruth
¶
-
group2
(by)[source]¶ self = annots by = annots.static_encounter encounters = annots.group2(annots.static_encounter)
-
has_groundtruth
¶
-
has_reviewed_matching_aids
¶
-
hashid_semantic_uuid
¶
-
hashid_uuid
¶
-
hashid_visual_uuid
¶
-
hog_hog
¶
-
hog_img
¶
-
image_contributor_tag
¶
-
image_datetime_str
¶
-
image_gps
¶
-
image_gps2
¶
-
image_set_texts
¶
-
image_unixtimes_asfloat
¶
-
image_uuids
¶
-
imgset_uuids
¶
-
imgsetids
¶
-
kpts
¶
-
kpts_distinctiveness
¶
-
multiple
¶
-
name
¶
-
name_uuids
¶
-
names
¶
-
nid
¶
-
nids
¶
-
notes
¶
-
num_contact_aids
¶
-
num_feats
¶
-
num_groundtruth
¶
-
num_reviewed_matching_aids
¶
-
occurrence_text
¶
-
otherimage_aids
¶
-
parent_aid
¶
-
primary_imageset
¶
-
probchip_img
¶
-
qual
¶
-
qualities
¶
-
quality_texts
¶
-
rchip
¶
-
rchip_fpath
¶
-
reviewed
¶
-
reviewed_matching_aids
¶
-
rrr
()¶ Dynamic module reloading
-
semantic_uuids
¶
-
sex
¶
-
sex_texts
¶
-
species
¶
-
species_rowids
¶
-
species_texts
¶
-
species_uuids
¶
-
static_encounter
¶
-
thetas
¶
-
time
¶
-
uuids
¶
-
vecs
¶
-
vecs_cache
¶
-
vecs_subset
¶
-
verts
¶
-
viewpoint_code
¶
-
viewpoint_int
¶
-
visual_uuids
¶
-
yaw
¶
-
yaw_texts
¶
-
yaws
¶
-
yaws_asfloat
¶
wbia.constants¶
It is better to use constant variables instead of hoping you spell the same string correctly every time you use it. (Also it makes it much easier if a string name changes)
-
class
wbia.constants.
CONFIDENCE
[source]¶ Bases:
object
-
ABSOLUTELY_SURE
= 4¶
-
class
CODE
¶ Bases:
object
-
ABSOLUTELY_SURE
= 'absolutely_sure'¶
-
GUESSING
= 'guessing'¶
-
NOT_SURE
= 'not_sure'¶
-
PRETTY_SURE
= 'pretty_sure'¶
-
UNKNOWN
= 'unspecified'¶
-
-
CODE_TO_INT
= {'absolutely_sure': 4, 'guessing': 1, 'not_sure': 2, 'pretty_sure': 3, 'unspecified': None}¶
-
CODE_TO_NICE
= {'absolutely_sure': 'Doubtless', 'guessing': 'Guessing', 'not_sure': 'Unsure', 'pretty_sure': 'Sure', 'unspecified': 'Unspecified'}¶
-
GUESSING
= 1¶
-
INT_TO_CODE
= OrderedDict([(4, 'absolutely_sure'), (3, 'pretty_sure'), (2, 'not_sure'), (1, 'guessing'), (None, 'unspecified')])¶
-
INT_TO_NICE
= OrderedDict([(4, 'Doubtless'), (3, 'Sure'), (2, 'Unsure'), (1, 'Guessing'), (None, 'Unspecified')])¶
-
class
NICE
¶ Bases:
object
-
ABSOLUTELY_SURE
= 'Doubtless'¶
-
GUESSING
= 'Guessing'¶
-
NOT_SURE
= 'Unsure'¶
-
PRETTY_SURE
= 'Sure'¶
-
UNKNOWN
= 'Unspecified'¶
-
-
NICE_TO_CODE
= {'Doubtless': 'absolutely_sure', 'Guessing': 'guessing', 'Sure': 'pretty_sure', 'Unspecified': 'unspecified', 'Unsure': 'not_sure'}¶
-
NICE_TO_INT
= {'Doubtless': 4, 'Guessing': 1, 'Sure': 3, 'Unspecified': None, 'Unsure': 2}¶
-
NOT_SURE
= 2¶
-
PRETTY_SURE
= 3¶
-
UNKNOWN
= None¶
-
-
class
wbia.constants.
EVIDENCE_DECISION
[source]¶ Bases:
object
TODO: change to EVIDENCE_DECISION / VISUAL_DECISION Enumerated types of review codes and texts
Notes
Unreviewed: Not comparared yet. nomatch: Visually comparable and the different match: Visually comparable and the same notcomp: Not comparable means it is actually impossible to determine. unknown: means that it was reviewed, but we just can’t figure it out.
-
class
CODE
¶ Bases:
object
-
INCOMPARABLE
= 'notcomp'¶
-
NEGATIVE
= 'nomatch'¶
-
POSITIVE
= 'match'¶
-
UNKNOWN
= 'unknown'¶
-
UNREVIEWED
= 'unreviewed'¶
-
-
CODE_TO_INT
= {'match': 1, 'nomatch': 0, 'notcomp': 2, 'unknown': 3, 'unreviewed': None}¶
-
CODE_TO_NICE
= {'match': 'Positive', 'nomatch': 'Negative', 'notcomp': 'Incomparable', 'unknown': 'Unknown', 'unreviewed': 'Unreviewed'}¶
-
INCOMPARABLE
= 2¶
-
INT_TO_CODE
= OrderedDict([(1, 'match'), (0, 'nomatch'), (2, 'notcomp'), (3, 'unknown'), (None, 'unreviewed')])¶
-
INT_TO_NICE
= OrderedDict([(1, 'Positive'), (0, 'Negative'), (2, 'Incomparable'), (3, 'Unknown'), (None, 'Unreviewed')])¶
-
MATCH_CODE
= {'match': 1, 'nomatch': 0, 'notcomp': 2, 'unknown': 3, 'unreviewed': None}¶
-
NEGATIVE
= 0¶
-
class
NICE
¶ Bases:
object
-
INCOMPARABLE
= 'Incomparable'¶
-
NEGATIVE
= 'Negative'¶
-
POSITIVE
= 'Positive'¶
-
UNKNOWN
= 'Unknown'¶
-
UNREVIEWED
= 'Unreviewed'¶
-
-
NICE_TO_CODE
= {'Incomparable': 'notcomp', 'Negative': 'nomatch', 'Positive': 'match', 'Unknown': 'unknown', 'Unreviewed': 'unreviewed'}¶
-
NICE_TO_INT
= {'Incomparable': 2, 'Negative': 0, 'Positive': 1, 'Unknown': 3, 'Unreviewed': None}¶
-
POSITIVE
= 1¶
-
UNKNOWN
= 3¶
-
UNREVIEWED
= None¶
-
class
-
class
wbia.constants.
META_DECISION
[source]¶ Bases:
object
Enumerated types of review codes and texts
Notes
unreviewed: we dont have a meta decision same: we know this is the same animal through non-visual means diff: we know this is the different animal through non-visual means
Example
>>> # ENABLE_DOCTEST >>> from wbia.constants import * # NOQA >>> assert hasattr(META_DECISION, 'CODE') >>> assert hasattr(META_DECISION, 'NICE') >>> code1 = META_DECISION.INT_TO_CODE[META_DECISION.NULL] >>> code2 = META_DECISION.CODE.NULL >>> assert code1 == code2 >>> nice1 = META_DECISION.INT_TO_NICE[META_DECISION.NULL] >>> nice2 = META_DECISION.NICE.NULL >>> assert nice1 == nice2
-
CODE_TO_INT
= {'diff': 0, 'null': None, 'same': 1}¶
-
CODE_TO_NICE
= {'diff': 'Different', 'null': 'NULL', 'same': 'Same'}¶
-
DIFF
= 0¶
-
INT_TO_CODE
= OrderedDict([(None, 'null'), (0, 'diff'), (1, 'same')])¶
-
INT_TO_NICE
= OrderedDict([(None, 'NULL'), (0, 'Different'), (1, 'Same')])¶
-
NICE_TO_CODE
= {'Different': 'diff', 'NULL': 'null', 'Same': 'same'}¶
-
NICE_TO_INT
= {'Different': 0, 'NULL': None, 'Same': 1}¶
-
NULL
= None¶
-
SAME
= 1¶
-
-
class
wbia.constants.
PATH_NAMES
[source]¶ Bases:
object
Path names for internal IBEIS database
-
backups
= '_wbia_backups'¶
-
bigcache
= 'qres_bigcache_new'¶
-
cache
= '_wbia_cache'¶
-
chips
= 'chips'¶
-
detectimg
= 'detectimg'¶
-
distinctdir
= 'distinctiveness_model'¶
-
figures
= 'figures'¶
-
flann
= 'flann'¶
-
images
= 'images'¶
-
logs
= '_wbia_logs'¶
-
nets
= 'nets'¶
-
qres
= 'qres_new'¶
-
scorenormdir
= 'scorenorm'¶
-
smartpatrol
= 'smart_patrol'¶
-
sqldb
= '_wbia_database.sqlite3'¶
-
sqlstaging
= '_wbia_staging.sqlite3'¶
-
thumbs
= 'thumbs'¶
-
trashdir
= 'trashed_images'¶
-
trees
= 'trees'¶
-
uploads
= 'uploads'¶
-
-
class
wbia.constants.
QUAL
[source]¶ Bases:
object
-
class
CODE
¶ Bases:
object
-
EXCELLENT
= 'excellent'¶
-
GOOD
= 'good'¶
-
JUNK
= 'junk'¶
-
OK
= 'ok'¶
-
POOR
= 'poor'¶
-
UNKNOWN
= 'unspecified'¶
-
-
CODE_TO_INT
= {'excellent': 5, 'good': 4, 'junk': 1, 'ok': 3, 'poor': 2, 'unspecified': None}¶
-
CODE_TO_NICE
= {'excellent': 'Excellent', 'good': 'Good', 'junk': 'Junk', 'ok': 'OK', 'poor': 'Poor', 'unspecified': 'Unspecified'}¶
-
EXCELLENT
= 5¶
-
GOOD
= 4¶
-
INT_TO_CODE
= OrderedDict([(5, 'excellent'), (4, 'good'), (3, 'ok'), (2, 'poor'), (1, 'junk'), (None, 'unspecified')])¶
-
INT_TO_NICE
= OrderedDict([(5, 'Excellent'), (4, 'Good'), (3, 'OK'), (2, 'Poor'), (1, 'Junk'), (None, 'Unspecified')])¶
-
JUNK
= 1¶
-
class
NICE
¶ Bases:
object
-
EXCELLENT
= 'Excellent'¶
-
GOOD
= 'Good'¶
-
JUNK
= 'Junk'¶
-
OK
= 'OK'¶
-
POOR
= 'Poor'¶
-
UNKNOWN
= 'Unspecified'¶
-
-
NICE_TO_CODE
= {'Excellent': 'excellent', 'Good': 'good', 'Junk': 'junk', 'OK': 'ok', 'Poor': 'poor', 'Unspecified': 'unspecified'}¶
-
NICE_TO_INT
= {'Excellent': 5, 'Good': 4, 'Junk': 1, 'OK': 3, 'Poor': 2, 'Unspecified': None}¶
-
OK
= 3¶
-
POOR
= 2¶
-
UNKNOWN
= None¶
-
class
-
class
wbia.constants.
REL_PATHS
[source]¶ Bases:
object
all paths are relative to ibs.dbdir
-
backups
= '_ibsdb/_wbia_backups'¶
-
bigcache
= '_ibsdb/_wbia_cache/qres_bigcache_new'¶
-
cache
= '_ibsdb/_wbia_cache'¶
-
chips
= '_ibsdb/_wbia_cache/chips'¶
-
distinctdir
= '_ibsdb/_wbia_cache/distinctiveness_model'¶
-
figures
= '_ibsdb/figures'¶
-
flann
= '_ibsdb/_wbia_cache/flann'¶
-
images
= '_ibsdb/images'¶
-
logs
= '_ibsdb/_wbia_logs'¶
-
nets
= '_ibsdb/nets'¶
-
qres
= '_ibsdb/_wbia_cache/qres_new'¶
-
thumbs
= '_ibsdb/_wbia_cache/thumbs'¶
-
trashdir
= 'trashed_images'¶
-
trees
= '_ibsdb/trees'¶
-
uploads
= '_ibsdb/uploads'¶
-
-
class
wbia.constants.
TEST_SPECIES
[source]¶ Bases:
object
-
BEAR_POLAR
= 'bear_polar'¶
-
GIR_MASAI
= 'giraffe_masai'¶
-
ZEB_GREVY
= 'zebra_grevys'¶
-
ZEB_PLAIN
= 'zebra_plains'¶
-
-
class
wbia.constants.
VIEW
[source]¶ Bases:
object
categorical viewpoint using the faces of a Rhombicuboctahedron
References
https://en.wikipedia.org/wiki/Rhombicuboctahedron
-
B
= 7¶
-
BL
= 6¶
-
BR
= 8¶
-
class
CODE
¶ Bases:
object
-
B
= 'back'¶
-
BL
= 'backleft'¶
-
BR
= 'backright'¶
-
D
= 'down'¶
-
DB
= 'downback'¶
-
DBL
= 'downbackleft'¶
-
DBR
= 'downbackright'¶
-
DF
= 'downfront'¶
-
DFL
= 'downfrontleft'¶
-
DFR
= 'downfrontright'¶
-
DL
= 'downleft'¶
-
DR
= 'downright'¶
-
F
= 'front'¶
-
FL
= 'frontleft'¶
-
FR
= 'frontright'¶
-
L
= 'left'¶
-
R
= 'right'¶
-
U
= 'up'¶
-
UB
= 'upback'¶
-
UBL
= 'upbackleft'¶
-
UBR
= 'upbackright'¶
-
UF
= 'upfront'¶
-
UFL
= 'upfrontleft'¶
-
UFR
= 'upfrontright'¶
-
UL
= 'upleft'¶
-
UNKNOWN
= 'unknown'¶
-
UR
= 'upright'¶
-
-
CODE_TO_INT
= {'back': 7, 'backleft': 6, 'backright': 8, 'down': 18, 'downback': 20, 'downbackleft': 25, 'downbackright': 26, 'downfront': 19, 'downfrontleft': 23, 'downfrontright': 24, 'downleft': 21, 'downright': 22, 'front': 3, 'frontleft': 4, 'frontright': 2, 'left': 5, 'right': 1, 'unknown': None, 'up': 9, 'upback': 11, 'upbackleft': 16, 'upbackright': 17, 'upfront': 10, 'upfrontleft': 14, 'upfrontright': 15, 'upleft': 12, 'upright': 13}¶
-
CODE_TO_NICE
= {'back': 'Back', 'backleft': 'Back-Left', 'backright': 'Back-Right', 'down': 'Down', 'downback': 'Down-Back', 'downbackleft': 'Down-Back-Left', 'downbackright': 'Down-Back-Right', 'downfront': 'Down-Front', 'downfrontleft': 'Down-Front-Left', 'downfrontright': 'Down-Front-Right', 'downleft': 'Down-Left', 'downright': 'Down-Right', 'front': 'Front', 'frontleft': 'Front-Left', 'frontright': 'Front-Right', 'left': 'Left', 'right': 'Right', 'unknown': 'Unknown', 'up': 'Up', 'upback': 'Up-Back', 'upbackleft': 'Up-Back-Left', 'upbackright': 'Up-Back-Right', 'upfront': 'Up-Front', 'upfrontleft': 'Up-Front-Left', 'upfrontright': 'Up-Front-Right', 'upleft': 'Up-Left', 'upright': 'Up-Right'}¶
-
D
= 18¶
-
DB
= 20¶
-
DBL
= 25¶
-
DBR
= 26¶
-
DF
= 19¶
-
DFL
= 23¶
-
DFR
= 24¶
-
DIST
= {(7, 7): 0, (6, 6): 0, (8, 8): 0, (18, 18): 0, (20, 20): 0, (25, 25): 0, (26, 26): 0, (19, 19): 0, (23, 23): 0, (24, 24): 0, (21, 21): 0, (22, 22): 0, (3, 3): 0, (4, 4): 0, (2, 2): 0, (5, 5): 0, (1, 1): 0, (9, 9): 0, (11, 11): 0, (16, 16): 0, (17, 17): 0, (10, 10): 0, (14, 14): 0, (15, 15): 0, (12, 12): 0, (13, 13): 0, (7, 6): 1, (7, 8): 1, (7, 20): 1, (7, 25): 1, (7, 26): 1, (7, 11): 1, (7, 16): 1, (7, 17): 1, (6, 25): 1, (6, 5): 1, (6, 16): 1, (8, 26): 1, (8, 1): 1, (8, 17): 1, (18, 20): 1, (18, 25): 1, (18, 26): 1, (18, 19): 1, (18, 23): 1, (18, 24): 1, (18, 21): 1, (18, 22): 1, (20, 25): 1, (20, 26): 1, (25, 21): 1, (25, 5): 1, (26, 22): 1, (26, 1): 1, (19, 23): 1, (19, 24): 1, (19, 3): 1, (23, 21): 1, (23, 3): 1, (23, 4): 1, (23, 5): 1, (24, 22): 1, (24, 3): 1, (24, 2): 1, (24, 1): 1, (21, 5): 1, (22, 1): 1, (3, 4): 1, (3, 2): 1, (3, 10): 1, (3, 14): 1, (3, 15): 1, (4, 5): 1, (4, 14): 1, (2, 1): 1, (2, 15): 1, (5, 16): 1, (5, 14): 1, (5, 12): 1, (1, 17): 1, (1, 15): 1, (1, 13): 1, (9, 11): 1, (9, 16): 1, (9, 17): 1, (9, 10): 1, (9, 14): 1, (9, 15): 1, (9, 12): 1, (9, 13): 1, (11, 16): 1, (11, 17): 1, (16, 12): 1, (17, 13): 1, (10, 14): 1, (10, 15): 1, (14, 12): 1, (15, 13): 1, (7, 18): 2, (7, 21): 2, (7, 22): 2, (7, 5): 2, (7, 1): 2, (7, 9): 2, (7, 12): 2, (7, 13): 2, (6, 8): 2, (6, 18): 2, (6, 20): 2, (6, 26): 2, (6, 23): 2, (6, 21): 2, (6, 4): 2, (6, 9): 2, (6, 11): 2, (6, 17): 2, (6, 14): 2, (6, 12): 2, (8, 18): 2, (8, 20): 2, (8, 25): 2, (8, 24): 2, (8, 22): 2, (8, 2): 2, (8, 9): 2, (8, 11): 2, (8, 16): 2, (8, 15): 2, (8, 13): 2, (18, 3): 2, (18, 4): 2, (18, 2): 2, (18, 5): 2, (18, 1): 2, (20, 19): 2, (20, 23): 2, (20, 24): 2, (20, 21): 2, (20, 22): 2, (20, 5): 2, (20, 1): 2, (20, 11): 2, (20, 16): 2, (20, 17): 2, (25, 26): 2, (25, 19): 2, (25, 23): 2, (25, 24): 2, (25, 22): 2, (25, 4): 2, (25, 11): 2, (25, 16): 2, (25, 17): 2, (25, 14): 2, (25, 12): 2, (26, 19): 2, (26, 23): 2, (26, 24): 2, (26, 21): 2, (26, 2): 2, (26, 11): 2, (26, 16): 2, (26, 17): 2, (26, 15): 2, (26, 13): 2, (19, 21): 2, (19, 22): 2, (19, 4): 2, (19, 2): 2, (19, 5): 2, (19, 1): 2, (19, 10): 2, (19, 14): 2, (19, 15): 2, (23, 24): 2, (23, 22): 2, (23, 2): 2, (23, 16): 2, (23, 10): 2, (23, 14): 2, (23, 15): 2, (23, 12): 2, (24, 21): 2, (24, 4): 2, (24, 17): 2, (24, 10): 2, (24, 14): 2, (24, 15): 2, (24, 13): 2, (21, 22): 2, (21, 3): 2, (21, 4): 2, (21, 16): 2, (21, 14): 2, (21, 12): 2, (22, 3): 2, (22, 2): 2, (22, 17): 2, (22, 15): 2, (22, 13): 2, (3, 5): 2, (3, 1): 2, (3, 9): 2, (3, 12): 2, (3, 13): 2, (4, 2): 2, (4, 9): 2, (4, 16): 2, (4, 10): 2, (4, 15): 2, (4, 12): 2, (2, 9): 2, (2, 17): 2, (2, 10): 2, (2, 14): 2, (2, 13): 2, (5, 9): 2, (5, 11): 2, (5, 10): 2, (1, 9): 2, (1, 11): 2, (1, 10): 2, (11, 10): 2, (11, 14): 2, (11, 15): 2, (11, 12): 2, (11, 13): 2, (16, 17): 2, (16, 10): 2, (16, 14): 2, (16, 15): 2, (16, 13): 2, (17, 10): 2, (17, 14): 2, (17, 15): 2, (17, 12): 2, (10, 12): 2, (10, 13): 2, (14, 15): 2, (14, 13): 2, (15, 12): 2, (12, 13): 2, (7, 19): 3, (7, 23): 3, (7, 24): 3, (7, 4): 3, (7, 2): 3, (7, 10): 3, (7, 14): 3, (7, 15): 3, (6, 19): 3, (6, 24): 3, (6, 22): 3, (6, 3): 3, (6, 1): 3, (6, 10): 3, (6, 15): 3, (6, 13): 3, (8, 19): 3, (8, 23): 3, (8, 21): 3, (8, 3): 3, (8, 5): 3, (8, 10): 3, (8, 14): 3, (8, 12): 3, (18, 11): 3, (18, 16): 3, (18, 17): 3, (18, 10): 3, (18, 14): 3, (18, 15): 3, (18, 12): 3, (18, 13): 3, (20, 3): 3, (20, 4): 3, (20, 2): 3, (20, 9): 3, (20, 14): 3, (20, 15): 3, (20, 12): 3, (20, 13): 3, (25, 3): 3, (25, 2): 3, (25, 1): 3, (25, 9): 3, (25, 10): 3, (25, 13): 3, (26, 3): 3, (26, 4): 3, (26, 5): 3, (26, 9): 3, (26, 10): 3, (26, 12): 3, (19, 9): 3, (19, 16): 3, (19, 17): 3, (19, 12): 3, (19, 13): 3, (23, 1): 3, (23, 9): 3, (23, 11): 3, (23, 13): 3, (24, 5): 3, (24, 9): 3, (24, 11): 3, (24, 12): 3, (21, 2): 3, (21, 1): 3, (21, 9): 3, (21, 11): 3, (21, 17): 3, (21, 10): 3, (21, 15): 3, (22, 4): 3, (22, 5): 3, (22, 9): 3, (22, 11): 3, (22, 16): 3, (22, 10): 3, (22, 14): 3, (3, 11): 3, (3, 16): 3, (3, 17): 3, (4, 1): 3, (4, 11): 3, (4, 17): 3, (4, 13): 3, (2, 5): 3, (2, 11): 3, (2, 16): 3, (2, 12): 3, (5, 17): 3, (5, 15): 3, (5, 13): 3, (1, 16): 3, (1, 14): 3, (1, 12): 3, (7, 3): 4, (6, 2): 4, (8, 4): 4, (18, 9): 4, (20, 10): 4, (25, 15): 4, (26, 14): 4, (19, 11): 4, (23, 17): 4, (24, 16): 4, (21, 13): 4, (22, 12): 4, (5, 1): 4, (7, None): None, (6, None): None, (8, None): None, (18, None): None, (20, None): None, (25, None): None, (26, None): None, (19, None): None, (23, None): None, (24, None): None, (21, None): None, (22, None): None, (3, None): None, (4, None): None, (2, None): None, (5, None): None, (1, None): None, (9, None): None, (11, None): None, (16, None): None, (17, None): None, (10, None): None, (14, None): None, (15, None): None, (12, None): None, (None, 7): None, (None, 6): None, (None, 8): None, (None, 18): None, (None, 20): None, (None, 25): None, (None, 26): None, (None, 19): None, (None, 23): None, (None, 24): None, (None, 21): None, (None, 22): None, (None, 3): None, (None, 4): None, (None, 2): None, (None, 5): None, (None, 1): None, (None, 9): None, (None, 11): None, (None, 16): None, (None, 17): None, (None, 10): None, (None, 14): None, (None, 15): None, (None, 12): None, (None, 13): None, (13, None): None, (None, None): None, (6, 7): 1, (8, 7): 1, (20, 7): 1, (25, 7): 1, (26, 7): 1, (11, 7): 1, (16, 7): 1, (17, 7): 1, (25, 6): 1, (5, 6): 1, (16, 6): 1, (26, 8): 1, (1, 8): 1, (17, 8): 1, (20, 18): 1, (25, 18): 1, (26, 18): 1, (19, 18): 1, (23, 18): 1, (24, 18): 1, (21, 18): 1, (22, 18): 1, (25, 20): 1, (26, 20): 1, (21, 25): 1, (5, 25): 1, (22, 26): 1, (1, 26): 1, (23, 19): 1, (24, 19): 1, (3, 19): 1, (21, 23): 1, (3, 23): 1, (4, 23): 1, (5, 23): 1, (22, 24): 1, (3, 24): 1, (2, 24): 1, (1, 24): 1, (5, 21): 1, (1, 22): 1, (4, 3): 1, (2, 3): 1, (10, 3): 1, (14, 3): 1, (15, 3): 1, (5, 4): 1, (14, 4): 1, (1, 2): 1, (15, 2): 1, (16, 5): 1, (14, 5): 1, (12, 5): 1, (17, 1): 1, (15, 1): 1, (13, 1): 1, (11, 9): 1, (16, 9): 1, (17, 9): 1, (10, 9): 1, (14, 9): 1, (15, 9): 1, (12, 9): 1, (13, 9): 1, (16, 11): 1, (17, 11): 1, (12, 16): 1, (13, 17): 1, (14, 10): 1, (15, 10): 1, (12, 14): 1, (13, 15): 1, (18, 7): 2, (21, 7): 2, (22, 7): 2, (5, 7): 2, (1, 7): 2, (9, 7): 2, (12, 7): 2, (13, 7): 2, (8, 6): 2, (18, 6): 2, (20, 6): 2, (26, 6): 2, (23, 6): 2, (21, 6): 2, (4, 6): 2, (9, 6): 2, (11, 6): 2, (17, 6): 2, (14, 6): 2, (12, 6): 2, (18, 8): 2, (20, 8): 2, (25, 8): 2, (24, 8): 2, (22, 8): 2, (2, 8): 2, (9, 8): 2, (11, 8): 2, (16, 8): 2, (15, 8): 2, (13, 8): 2, (3, 18): 2, (4, 18): 2, (2, 18): 2, (5, 18): 2, (1, 18): 2, (19, 20): 2, (23, 20): 2, (24, 20): 2, (21, 20): 2, (22, 20): 2, (5, 20): 2, (1, 20): 2, (11, 20): 2, (16, 20): 2, (17, 20): 2, (26, 25): 2, (19, 25): 2, (23, 25): 2, (24, 25): 2, (22, 25): 2, (4, 25): 2, (11, 25): 2, (16, 25): 2, (17, 25): 2, (14, 25): 2, (12, 25): 2, (19, 26): 2, (23, 26): 2, (24, 26): 2, (21, 26): 2, (2, 26): 2, (11, 26): 2, (16, 26): 2, (17, 26): 2, (15, 26): 2, (13, 26): 2, (21, 19): 2, (22, 19): 2, (4, 19): 2, (2, 19): 2, (5, 19): 2, (1, 19): 2, (10, 19): 2, (14, 19): 2, (15, 19): 2, (24, 23): 2, (22, 23): 2, (2, 23): 2, (16, 23): 2, (10, 23): 2, (14, 23): 2, (15, 23): 2, (12, 23): 2, (21, 24): 2, (4, 24): 2, (17, 24): 2, (10, 24): 2, (14, 24): 2, (15, 24): 2, (13, 24): 2, (22, 21): 2, (3, 21): 2, (4, 21): 2, (16, 21): 2, (14, 21): 2, (12, 21): 2, (3, 22): 2, (2, 22): 2, (17, 22): 2, (15, 22): 2, (13, 22): 2, (5, 3): 2, (1, 3): 2, (9, 3): 2, (12, 3): 2, (13, 3): 2, (2, 4): 2, (9, 4): 2, (16, 4): 2, (10, 4): 2, (15, 4): 2, (12, 4): 2, (9, 2): 2, (17, 2): 2, (10, 2): 2, (14, 2): 2, (13, 2): 2, (9, 5): 2, (11, 5): 2, (10, 5): 2, (9, 1): 2, (11, 1): 2, (10, 1): 2, (10, 11): 2, (14, 11): 2, (15, 11): 2, (12, 11): 2, (13, 11): 2, (17, 16): 2, (10, 16): 2, (14, 16): 2, (15, 16): 2, (13, 16): 2, (10, 17): 2, (14, 17): 2, (15, 17): 2, (12, 17): 2, (12, 10): 2, (13, 10): 2, (15, 14): 2, (13, 14): 2, (12, 15): 2, (13, 12): 2, (19, 7): 3, (23, 7): 3, (24, 7): 3, (4, 7): 3, (2, 7): 3, (10, 7): 3, (14, 7): 3, (15, 7): 3, (19, 6): 3, (24, 6): 3, (22, 6): 3, (3, 6): 3, (1, 6): 3, (10, 6): 3, (15, 6): 3, (13, 6): 3, (19, 8): 3, (23, 8): 3, (21, 8): 3, (3, 8): 3, (5, 8): 3, (10, 8): 3, (14, 8): 3, (12, 8): 3, (11, 18): 3, (16, 18): 3, (17, 18): 3, (10, 18): 3, (14, 18): 3, (15, 18): 3, (12, 18): 3, (13, 18): 3, (3, 20): 3, (4, 20): 3, (2, 20): 3, (9, 20): 3, (14, 20): 3, (15, 20): 3, (12, 20): 3, (13, 20): 3, (3, 25): 3, (2, 25): 3, (1, 25): 3, (9, 25): 3, (10, 25): 3, (13, 25): 3, (3, 26): 3, (4, 26): 3, (5, 26): 3, (9, 26): 3, (10, 26): 3, (12, 26): 3, (9, 19): 3, (16, 19): 3, (17, 19): 3, (12, 19): 3, (13, 19): 3, (1, 23): 3, (9, 23): 3, (11, 23): 3, (13, 23): 3, (5, 24): 3, (9, 24): 3, (11, 24): 3, (12, 24): 3, (2, 21): 3, (1, 21): 3, (9, 21): 3, (11, 21): 3, (17, 21): 3, (10, 21): 3, (15, 21): 3, (4, 22): 3, (5, 22): 3, (9, 22): 3, (11, 22): 3, (16, 22): 3, (10, 22): 3, (14, 22): 3, (11, 3): 3, (16, 3): 3, (17, 3): 3, (1, 4): 3, (11, 4): 3, (17, 4): 3, (13, 4): 3, (5, 2): 3, (11, 2): 3, (16, 2): 3, (12, 2): 3, (17, 5): 3, (15, 5): 3, (13, 5): 3, (16, 1): 3, (14, 1): 3, (12, 1): 3, (3, 7): 4, (2, 6): 4, (4, 8): 4, (9, 18): 4, (10, 20): 4, (15, 25): 4, (14, 26): 4, (11, 19): 4, (17, 23): 4, (16, 24): 4, (13, 21): 4, (12, 22): 4, (1, 5): 4}¶
-
DL
= 21¶
-
DR
= 22¶
-
F
= 3¶
-
FL
= 4¶
-
FR
= 2¶
-
INT_TO_CODE
= OrderedDict([(None, 'unknown'), (1, 'right'), (2, 'frontright'), (3, 'front'), (4, 'frontleft'), (5, 'left'), (6, 'backleft'), (7, 'back'), (8, 'backright'), (9, 'up'), (10, 'upfront'), (11, 'upback'), (12, 'upleft'), (13, 'upright'), (14, 'upfrontleft'), (15, 'upfrontright'), (16, 'upbackleft'), (17, 'upbackright'), (18, 'down'), (19, 'downfront'), (20, 'downback'), (21, 'downleft'), (22, 'downright'), (23, 'downfrontleft'), (24, 'downfrontright'), (25, 'downbackleft'), (26, 'downbackright')])¶
-
INT_TO_NICE
= OrderedDict([(None, 'Unknown'), (1, 'Right'), (2, 'Front-Right'), (3, 'Front'), (4, 'Front-Left'), (5, 'Left'), (6, 'Back-Left'), (7, 'Back'), (8, 'Back-Right'), (9, 'Up'), (10, 'Up-Front'), (11, 'Up-Back'), (12, 'Up-Left'), (13, 'Up-Right'), (14, 'Up-Front-Left'), (15, 'Up-Front-Right'), (16, 'Up-Back-Left'), (17, 'Up-Back-Right'), (18, 'Down'), (19, 'Down-Front'), (20, 'Down-Back'), (21, 'Down-Left'), (22, 'Down-Right'), (23, 'Down-Front-Left'), (24, 'Down-Front-Right'), (25, 'Down-Back-Left'), (26, 'Down-Back-Right')])¶
-
L
= 5¶
-
class
NICE
¶ Bases:
object
-
B
= 'Back'¶
-
BL
= 'Back-Left'¶
-
BR
= 'Back-Right'¶
-
D
= 'Down'¶
-
DB
= 'Down-Back'¶
-
DBL
= 'Down-Back-Left'¶
-
DBR
= 'Down-Back-Right'¶
-
DF
= 'Down-Front'¶
-
DFL
= 'Down-Front-Left'¶
-
DFR
= 'Down-Front-Right'¶
-
DL
= 'Down-Left'¶
-
DR
= 'Down-Right'¶
-
F
= 'Front'¶
-
FL
= 'Front-Left'¶
-
FR
= 'Front-Right'¶
-
L
= 'Left'¶
-
R
= 'Right'¶
-
U
= 'Up'¶
-
UB
= 'Up-Back'¶
-
UBL
= 'Up-Back-Left'¶
-
UBR
= 'Up-Back-Right'¶
-
UF
= 'Up-Front'¶
-
UFL
= 'Up-Front-Left'¶
-
UFR
= 'Up-Front-Right'¶
-
UL
= 'Up-Left'¶
-
UNKNOWN
= 'Unknown'¶
-
UR
= 'Up-Right'¶
-
-
NICE_TO_CODE
= {'Back': 'back', 'Back-Left': 'backleft', 'Back-Right': 'backright', 'Down': 'down', 'Down-Back': 'downback', 'Down-Back-Left': 'downbackleft', 'Down-Back-Right': 'downbackright', 'Down-Front': 'downfront', 'Down-Front-Left': 'downfrontleft', 'Down-Front-Right': 'downfrontright', 'Down-Left': 'downleft', 'Down-Right': 'downright', 'Front': 'front', 'Front-Left': 'frontleft', 'Front-Right': 'frontright', 'Left': 'left', 'Right': 'right', 'Unknown': 'unknown', 'Up': 'up', 'Up-Back': 'upback', 'Up-Back-Left': 'upbackleft', 'Up-Back-Right': 'upbackright', 'Up-Front': 'upfront', 'Up-Front-Left': 'upfrontleft', 'Up-Front-Right': 'upfrontright', 'Up-Left': 'upleft', 'Up-Right': 'upright'}¶
-
NICE_TO_INT
= {'Back': 7, 'Back-Left': 6, 'Back-Right': 8, 'Down': 18, 'Down-Back': 20, 'Down-Back-Left': 25, 'Down-Back-Right': 26, 'Down-Front': 19, 'Down-Front-Left': 23, 'Down-Front-Right': 24, 'Down-Left': 21, 'Down-Right': 22, 'Front': 3, 'Front-Left': 4, 'Front-Right': 2, 'Left': 5, 'Right': 1, 'Unknown': None, 'Up': 9, 'Up-Back': 11, 'Up-Back-Left': 16, 'Up-Back-Right': 17, 'Up-Front': 10, 'Up-Front-Left': 14, 'Up-Front-Right': 15, 'Up-Left': 12, 'Up-Right': 13}¶
-
R
= 1¶
-
U
= 9¶
-
UB
= 11¶
-
UBL
= 16¶
-
UBR
= 17¶
-
UF
= 10¶
-
UFL
= 14¶
-
UFR
= 15¶
-
UL
= 12¶
-
UNKNOWN
= None¶
-
UR
= 13¶
-
d
= None¶
-
f1
= None¶
-
f2
= None¶
-
-
class
wbia.constants.
ZIPPED_URLS
[source]¶ Bases:
object
-
DF_CURVRANK
= 'https://wildbookiarepository.azureedge.net/databases/testdb_curvrank.zip'¶
-
GZ_DISTINCTIVE
= 'https://wildbookiarepository.azureedge.net/models/distinctivness_zebra_grevys.zip'¶
-
ID_EXAMPLE
= 'https://wildbookiarepository.azureedge.net/databases/testdb_identification.zip'¶
-
K7_EXAMPLE
= 'https://wildbookiarepository.azureedge.net/databases/testdb_kaggle7.zip'¶
-
NAUTS
= 'https://wildbookiarepository.azureedge.net/databases/NAUT_test.zip'¶
-
ORIENTATION
= 'https://wildbookiarepository.azureedge.net/databases/testdb_orientation.zip'¶
-
PZ_DISTINCTIVE
= 'https://wildbookiarepository.azureedge.net/models/distinctivness_zebra_plains.zip'¶
-
PZ_MTEST
= 'https://wildbookiarepository.azureedge.net/databases/PZ_MTEST.zip'¶
-
WDS
= 'https://wildbookiarepository.azureedge.net/databases/wd_peter2.zip'¶
-
wbia.core_annots¶
IBEIS CORE Defines the core dependency cache supported by the image analysis api
Extracts annotation chips from imaages and applies optional image normalizations.
Notes
- HOW TO DESIGN INTERACTIVE PLOTS:
- decorate as interactive depc.get_property(recompute=True) instead of calling preproc as a generator and then adding, calls preproc and passes in a callback function. preproc spawns interaction and must call callback function when finished. callback function adds the rowids to the table.
- Needed Tables:
Chip NormChip Feats Keypoints Descriptors ProbChip
IdentifyQuery NeighborIndex QualityClassifier ViewpointClassifier
- CommandLine:
- python -m wbia.control.IBEISControl –test-show_depc_annot_graph –show
- Setup:
>>> from wbia.core_annots import * # NOQA >>> import wbia >>> import wbia.plottool as pt >>> ibs = wbia.opendb('testdb1') >>> depc = ibs.depc_annot >>> aid_list = ibs.get_valid_aids()[0:2]
-
class
wbia.core_annots.
AnnotMaskConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_annots.
AoIConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_annots.
CanonicalConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_annots.
ChipConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_annots.
ChipThumbConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_annots.
ClassifierConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_annots.
FeatConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
Example
>>> # DISABLE_DOCTEST >>> from wbia.core_annots import * # NOQA >>> feat_cfg = FeatConfig() >>> result = str(feat_cfg) >>> print(result) <FeatConfig(hesaff+sift)>
-
class
wbia.core_annots.
FeatWeightConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_annots.
HOGConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_annots.
IndexerConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
Example
>>> # DISABLE_DOCTEST >>> from wbia.core_annots import * # NOQA >>> cfg = VsOneConfig() >>> result = str(cfg) >>> print(result)
-
class
wbia.core_annots.
LabelerConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_annots.
OrienterConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_annots.
ProbchipConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_annots.
VsOneConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
Example
>>> # DISABLE_DOCTEST >>> from wbia.core_annots import * # NOQA >>> cfg = VsOneConfig() >>> result = str(cfg) >>> print(result)
-
wbia.core_annots.
cnn_probchips
(ibs, species, inputchip_fpaths, smooth_thresh, smooth_ksize)[source]¶
-
wbia.core_annots.
compute_annotmask
(depc, aid_list, config=None)[source]¶ Interaction dispatcher for annotation masks.
Parameters: - depc (wbia.depends_cache.DependencyCache) –
- aid_list (list) – list of annotation rowids
- config (AnnotMaskConfig) – (default = None)
Yields: (uri, int, int) – tup
- CommandLine:
- python -m wbia.core_annots –exec-compute_annotmask –show python -m wbia.core_annots –exec-compute_annotmask –show –edit
Example
>>> # DISABLE_DOCTEST >>> from wbia.core_annots import * # NOQA >>> ibs, depc, aid_list = testdata_core() >>> config = AnnotMaskConfig(dim_size=None) >>> chip_config = config.chip_cfg >>> edit = ut.get_argflag('--edit') >>> mask = depc.get_property('annotmask', aid_list, 'img', config, recompute=edit)[0] >>> chip = depc.get_property('chips', aid_list, 'img', config=chip_config)[0] >>> ut.quit_if_noshow() >>> import wbia.plottool as pt >>> resized = vt.resize_mask(mask, chip) >>> blended = vt.blend_images_multiply(chip, resized) >>> pt.imshow(blended, title='mask') >>> pt.show_if_requested()
-
wbia.core_annots.
compute_aoi2
(depc, aid_list, config=None)[source]¶ Extracts the Annotation of Interest (AoI) for a given input annotation
Parameters: - depc (wbia.depends_cache.DependencyCache) –
- aid_list (list) – list of annotation rowids
- config (dict) – (default = None)
Yields: (float, str) – tup
- CommandLine:
- wbia compute_aoi2
Example
>>> # DISABLE_DOCTEST >>> from wbia.core_images import * # NOQA >>> import wbia >>> defaultdb = 'PZ_MTEST' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> depc = ibs.depc_annot >>> aid_list = ibs.get_valid_aids()[0:8] >>> # depc.delete_property('aoi_two', aid_list) >>> results = depc.get_property('aoi_two', aid_list, None) >>> print(results)
-
wbia.core_annots.
compute_canonical
(depc, aid_list, config=None)[source]¶ Extracts the detections for a given input annotation
Parameters: - depc (wbia.depends_cache.DependencyCache) –
- gid_list (list) – list of image rowids
- config (dict) – (default = None)
Yields: (float, str) – tup
- CommandLine:
- wbia compute_canonical
Example
>>> # DISABLE_DOCTEST >>> from wbia.core_images import * # NOQA >>> import wbia >>> defaultdb = 'PZ_MTEST' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> depc = ibs.depc_image >>> gid_list = ibs.get_valid_gids()[0:8] >>> # depc.delete_property('canonical', gid_list) >>> results = depc.get_property('canonical', gid_list, None) >>> print(results)
-
wbia.core_annots.
compute_chip
(depc, aid_list, config=None)[source]¶ Extracts the annotation chip from the bounding box
Parameters: - depc (wbia.depends_cache.DependencyCache) –
- aid_list (list) – list of annotation rowids
- config (dict) – (default = None)
Yields: (uri, int, int) – tup
- CommandLine:
- python -m wbia.core_annots –exec-compute_chip:0 –show python -m wbia.core_annots –exec-compute_chip:0 –show –greyscale wbia –tf compute_chip –show –pad=64 –dim_size=256 –db PZ_MTEST wbia –tf compute_chip –show –pad=64 –dim_size=None –db PZ_MTEST wbia –tf compute_chip –show –db humpbacks wbia –tf compute_chip:1 –show
- Doctest:
>>> from wbia.core_annots import * # NOQA >>> import wbia >>> defaultdb = 'testdb1' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> depc = ibs.depc_annot >>> config = ChipConfig.from_argv_dict(dim_size=None) >>> aid_list = ibs.get_valid_aids()[0:8] >>> chips = depc.get_property('chips', aid_list, 'img', config={'dim_size': 256}) >>> ut.quit_if_noshow() >>> import wbia.plottool as pt >>> #interact_obj = pt.interact_multi_image.MultiImageInteraction(chips, nPerPage=4) >>> import wbia.viz.interact.interact_chip >>> interact_obj = wbia.viz.interact.interact_chip.interact_multichips(ibs, aid_list, config2_=config) >>> interact_obj.start() >>> pt.show_if_requested()
- Doctest:
>>> from wbia.core_annots import * # NOQA >>> import wbia >>> defaultdb = 'testdb1' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> depc = ibs.depc_annot >>> config = ChipConfig(**{'dim_size': (256, 256), 'resize_dim': 'wh'}) >>> #dlg = config.make_qt_dialog() >>> #config = dlg.widget.config >>> aid_list = ibs.get_valid_aids()[0:8] >>> chips = depc.get_property('chips', aid_list, 'img', config=config, recompute=True) >>> ut.quit_if_noshow() >>> import wbia.plottool as pt >>> pt.imshow(vt.stack_image_recurse(chips)) >>> pt.show_if_requested()
-
wbia.core_annots.
compute_chipthumb
(depc, aid_list, config=None)[source]¶ Yet another chip thumb computer
Example
>>> # DISABLE_DOCTEST >>> from wbia.core_annots import * # NOQA >>> import wbia >>> defaultdb = 'PZ_MTEST' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> depc = ibs.depc_annot >>> config = ChipThumbConfig.from_argv_dict(dim_size=None) >>> aid_list = ibs.get_valid_aids()[0:2] >>> compute_chipthumb(depc, aid_list, config) >>> chips = depc.get_property('chips', aid_list, 'img', config={'dim_size': 256}) >>> ut.quit_if_noshow() >>> import wbia.plottool as pt >>> import wbia.viz.interact.interact_chip >>> interact_obj = wbia.viz.interact.interact_chip.interact_multichips(ibs, aid_list, config2_=config) >>> interact_obj.start() >>> pt.show_if_requested()
-
wbia.core_annots.
compute_classifications
(depc, aid_list, config=None)[source]¶ Extracts the detections for a given input annotation
Parameters: - depc (wbia.depends_cache.DependencyCache) –
- gid_list (list) – list of image rowids
- config (dict) – (default = None)
Yields: (float, str) – tup
- CommandLine:
- wbia compute_classifications
Example
>>> # DISABLE_DOCTEST >>> from wbia.core_images import * # NOQA >>> import wbia >>> defaultdb = 'PZ_MTEST' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> depc = ibs.depc_image >>> gid_list = ibs.get_valid_gids()[0:8] >>> # depc.delete_property('classifier', gid_list) >>> results = depc.get_property('classifier', gid_list, None) >>> print(results)
-
wbia.core_annots.
compute_feats
(depc, cid_list, config=None)[source]¶ Computes features and yields results asynchronously: TODO: Remove IBEIS from this equation. Move the firewall towards the controller
Parameters: - depc (dtool.DependencyCache) –
- cid_list (list) –
- config (None) –
Returns: generates param tups
Return type: generator
- SeeAlso:
- ~/code/ibeis_cnn/ibeis_cnn/_plugin.py
- CommandLine:
- python -m wbia.core_annots –test-compute_feats:0 –show python -m wbia.core_annots –test-compute_feats:1
- Doctest:
>>> # DISABLE_DOCTEST >>> from wbia.core_annots import * # NOQA >>> ibs, depc, aid_list = testdata_core() >>> chip_config = {} >>> config = FeatConfig() >>> cid_list = depc.get_rowids('chips', aid_list, config=chip_config) >>> featgen = compute_feats(depc, cid_list, config) >>> feat_list = list(featgen) >>> assert len(feat_list) == len(aid_list) >>> (nFeat, kpts, vecs) = feat_list[0] >>> assert nFeat == len(kpts) and nFeat == len(vecs) >>> assert kpts.shape[1] == 6 >>> assert vecs.shape[1] == 128 >>> ut.quit_if_noshow() >>> import wbia.plottool as pt >>> chip = depc.get_native('chips', cid_list[0:1], 'img')[0] >>> pt.interact_keypoints.KeypointInteraction(chip, kpts, vecs, autostart=True) >>> ut.show_if_requested()
Example
>>> # DISABLE_DOCTEST >>> # TIMING >>> from wbia.core_annots import * # NOQA >>> ibs, depc, aid_list = testdata_core('PZ_MTEST', 100) >>> #config = {'dim_size': 450} >>> config = {} >>> cid_list = depc.get_rowids('chips', aid_list, config=config) >>> config = FeatConfig() >>> featgen = compute_feats(depc, cid_list, config) >>> feat_list = list(featgen) >>> idx = 5 >>> (nFeat, kpts, vecs) = feat_list[idx] >>> ut.quit_if_noshow() >>> import wbia.plottool as pt >>> chip = depc.get_native('chips', cid_list[idx:idx + 1], 'img')[0] >>> pt.interact_keypoints.KeypointInteraction(chip, kpts, vecs, autostart=True) >>> ut.show_if_requested()
>>> #num_feats = depc.get('feat', aid_list, 'num_feats', config=config, recompute=True)
ibs.delete_annot_feats(aid_list) ibs.get_annot_feat_rowids(aid_list)
-
wbia.core_annots.
compute_fgweights
(depc, fid_list, pcid_list, config=None)[source]¶ Parameters: - depc (dtool.DependencyCache) – depc
- fid_list (list) –
- config (None) – (default = None)
- CommandLine:
- python -m wbia.core_annots compute_fgweights
- Doctest:
>>> from wbia.core_annots import * # NOQA >>> ibs, depc, aid_list = testdata_core() >>> full_config = {} >>> config = FeatConfig() >>> fid_list = depc.get_rowids('feat', aid_list, config=full_config) >>> pcid_list = depc.get_rowids('probchip', aid_list, config=full_config) >>> prop_list = list(compute_fgweights(depc, fid_list, pcid_list)) >>> featweight_list = ut.take_column(prop_list, 0) >>> result = np.array_str(featweight_list[0][0:3], precision=3) >>> print(result)
-
wbia.core_annots.
compute_hog
(depc, cid_list, config=None)[source]¶ - Doctest:
>>> from wbia.core_annots import * # NOQA >>> ibs, depc, aid_list = testdata_core() >>> chip_config = {} >>> config = HOGConfig() >>> cid_list = depc.get_rowids('chips', aid_list, config=chip_config) >>> hoggen = compute_hog(depc, cid_list, config) >>> hog = list(hoggen)[0] >>> ut.quit_if_noshow() >>> import wbia.plottool as pt >>> hog_image = make_hog_block_image(hog, config) >>> ut.show_if_requested()
-
wbia.core_annots.
compute_labels_annotations
(depc, aid_list, config=None)[source]¶ Extracts the detections for a given input image
Parameters: - depc (wbia.depends_cache.DependencyCache) –
- gid_list (list) – list of image rowids
- config (dict) – (default = None)
Yields: (float, str) – tup
- CommandLine:
- python -m wbia.core_annots –exec-compute_labels_annotations
Example
>>> # DISABLE_DOCTEST >>> from wbia.core_images import * # NOQA >>> import wbia >>> defaultdb = 'PZ_MTEST' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> depc = ibs.depc_annot >>> aid_list = ibs.get_valid_aids()[0:8] >>> config = {'labeler_algo': 'densenet', 'labeler_weight_filepath': 'giraffe_v1'} >>> # depc.delete_property('labeler', aid_list) >>> results = depc.get_property('labeler', aid_list, None, config=config) >>> print(results) >>> config = {'labeler_weight_filepath': 'candidacy'} >>> # depc.delete_property('labeler', aid_list) >>> results = depc.get_property('labeler', aid_list, None, config=config) >>> print(results) >>> config = {'labeler_algo': 'azure'} >>> # depc.delete_property('labeler', aid_list) >>> results = depc.get_property('labeler', aid_list, None, config=config) >>> print(results) >>> # depc.delete_property('labeler', aid_list) >>> results = depc.get_property('labeler', aid_list, None) >>> print(results)
-
wbia.core_annots.
compute_neighbor_index
(depc, fids_list, config)[source]¶ Parameters: - depc (dtool.DependencyCache) –
- fids_list (list) –
- config (dtool.Config) –
- CommandLine:
- python -m wbia.core_annots –exec-compute_neighbor_index –show python -m wbia.control.IBEISControl –test-show_depc_annot_table_input –show –tablename=neighbor_index
Example
>>> # DISABLE_DOCTEST >>> from wbia.core_annots import * # NOQA >>> import wbia >>> ibs, aid_list = wbia.testdata_aids('testdb1') >>> depc = ibs.depc_annot >>> fid_list = depc.get_rowids('feat', aid_list) >>> aids_list = tuple([aid_list]) >>> fids_list = tuple([fid_list]) >>> # Compute directly from function >>> config = ibs.depc_annot['neighbor_index'].configclass() >>> result1 = list(compute_neighbor_index(depc, fids_list, config)) >>> nnindexer1 = result1[0][0] >>> # Compute using depcache >>> result2 = ibs.depc_annot.get('neighbor_index', [aids_list], 'indexer', config, recompute=False, _debug=True) >>> #result3 = ibs.depc_annot.get('neighbor_index', [tuple(fids_list)], 'indexer', config, recompute=False) >>> print(result2) >>> print(result3) >>> assert result2[0] is not result3[0] >>> assert nnindexer1.knn(ibs.get_annot_vecs(1), 1) is not None >>> assert result3[0].knn(ibs.get_annot_vecs(1), 1) is not None
-
wbia.core_annots.
compute_orients_annotations
(depc, aid_list, config=None)[source]¶ Extracts the detections for a given input image
Parameters: - depc (wbia.depends_cache.DependencyCache) –
- gid_list (list) – list of image rowids
- config (dict) – (default = None)
Yields: (float, str) – tup
- CommandLine:
- python -m wbia.core_annots –exec-compute_orients_annotations –deepsense
Example
>>> # DISABLE_DOCTEST >>> from wbia.core_images import * # NOQA >>> import wbia >>> defaultdb = 'testdb_identification' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> depc = ibs.depc_annot >>> aid_list = ibs.get_valid_aids()[-16:-8] >>> config = {'orienter_algo': 'deepsense'} >>> # depc.delete_property('orienter', aid_list) >>> result_list = depc.get_property('orienter', aid_list, None, config=config) >>> xtl_list = list(map(int, map(np.around, ut.take_column(result_list, 0)))) >>> ytl_list = list(map(int, map(np.around, ut.take_column(result_list, 1)))) >>> w_list = list(map(int, map(np.around, ut.take_column(result_list, 2)))) >>> h_list = list(map(int, map(np.around, ut.take_column(result_list, 3)))) >>> theta_list = ut.take_column(result_list, 4) >>> bbox_list = list(zip(xtl_list, ytl_list, w_list, h_list)) >>> ibs.set_annot_bboxes(aid_list, bbox_list, theta_list=theta_list) >>> result_list = depc.get_property('orienter', aid_list, None, config=config) >>> print(result_list)
-
wbia.core_annots.
compute_pairwise_vsone
(depc, qaids, daids, config)[source]¶ Executes one-vs-one matching between pairs of annotations using the vt.PairwiseMatch object.
- Doctest:
>>> from wbia.core_annots import * # NOQA >>> import wbia >>> ibs = wbia.opendb('PZ_MTEST') >>> match_config = ut.hashdict({}) >>> qaids = [1, 4, 2] >>> daids = [2, 5, 3] >>> match_list = ibs.depc.get('pairwise_match', (qaids, daids), >>> 'match', config=match_config) >>> m1, m2, m3 = match_list >>> assert (m1.annot1['aid'], m1.annot2['aid']) == (1, 2) >>> assert (m2.annot1['aid'], m2.annot2['aid']) == (4, 5) >>> assert m1.fs.sum() > m2.fs.sum()
-
wbia.core_annots.
compute_probchip
(depc, aid_list, config=None)[source]¶ Computes probability chips using pyrf
- CommandLine:
- python -m wbia.core_annots –test-compute_probchip –nocnn –show –db PZ_MTEST python -m wbia.core_annots –test-compute_probchip –show –fw_detector=cnn python -m wbia.core_annots –test-compute_probchip –show –fw_detector=rf –smooth_thresh=None
- Example1:
>>> # DISABLE_DOCTEST >>> from wbia.core_annots import * # NOQA >>> import wbia >>> ibs, depc, aid_list = testdata_core() >>> aid_list = ibs.get_valid_aids(species='zebra_plains')[0:10] >>> config = ProbchipConfig.from_argv_dict(fw_detector='cnn', smooth_thresh=None) >>> #probchip_fpath_list_ = ut.take_column(list(compute_probchip(depc, aid_list, config)), 0) >>> probchip_list_ = ut.take_column(list(compute_probchip(depc, aid_list, config)), 0) >>> #result = ut.repr2(probchip_fpath_list_) >>> #print(result) >>> ut.quit_if_noshow() >>> import wbia.plottool as pt >>> #xlabel_list = list(map(str, [vt.image.open_image_size(p) for p in probchip_fpath_list_])) >>> #iteract_obj = pt.interact_multi_image.MultiImageInteraction(probchip_fpath_list_, nPerPage=4, xlabel_list=xlabel_list) >>> xlabel_list = [str(vt.get_size(img)) for img in probchip_list_] >>> iteract_obj = pt.interact_multi_image.MultiImageInteraction(probchip_list_, nPerPage=4, xlabel_list=xlabel_list) >>> iteract_obj.start() >>> ut.show_if_requested()
-
wbia.core_annots.
gen_chip_configure_and_compute
(ibs, gid_list, rowid_list, bbox_list, theta_list, config)[source]¶
-
wbia.core_annots.
gen_feat_worker
(chip_fpath, probchip_fpath, hesaff_params)[source]¶ Function to be parallelized by multiprocessing / joblib / whatever. Must take in one argument to be used by multiprocessing.map_async
Parameters: - chip_fpath –
- probchip_fpath –
- hesaff_params –
Returns: (None, kpts, vecs)
Return type: tuple
- CommandLine:
- python -m wbia.core_annots –exec-gen_feat_worker –show python -m wbia.core_annots –exec-gen_feat_worker –show –aid 1988 –db GZ_Master1 –affine-invariance=False –scale_max=30 python -m wbia.core_annots –exec-gen_feat_worker –show –aid 1988 –db GZ_Master1 –affine-invariance=False –maskmethod=None –scale_max=30
- Doctest:
>>> from wbia.core_annots import * # NOQA >>> ibs, depc, aid_list = testdata_core() >>> aid = aid_list[0] >>> config = {} >>> feat_config = FeatConfig.from_argv_dict() >>> chip_fpath = ibs.depc_annot.get('chips', aid_list[0], 'img', config=config, read_extern=False) >>> maskmethod = ut.get_argval('--maskmethod', type_=str, default='cnn') >>> probchip_fpath = ibs.depc_annot.get('probchip', aid_list[0], 'img', config=config, read_extern=False) if feat_config['maskmethod'] == 'cnn' else None >>> hesaff_params = feat_config.asdict() >>> # Exec function source >>> masked_chip, num_kpts, kpts, vecs = ut.exec_func_src( >>> gen_feat_worker, key_list=['masked_chip', 'num_kpts', 'kpts', 'vecs'], >>> sentinal='num_kpts = kpts.shape[0]') >>> result = ('(num_kpts, kpts, vecs) = %s' % (ut.repr2((num_kpts, kpts, vecs)),)) >>> print(result) >>> ut.quit_if_noshow() >>> import wbia.plottool as pt >>> from wbia.plottool.interactions import ExpandableInteraction >>> interact = ExpandableInteraction() >>> interact.append_plot(pt.interact_keypoints.KeypointInteraction(masked_chip, kpts, vecs)) >>> interact.append_plot(lambda **kwargs: pt.plot_score_histograms([vt.get_scales(kpts)], **kwargs)) >>> interact.start() >>> ut.show_if_requested()
-
wbia.core_annots.
gen_featweight_worker
(kpts, probchip, chipsize)[source]¶ Function to be parallelized by multiprocessing / joblib / whatever. Must take in one argument to be used by multiprocessing.map_async
Parameters: - kpts –
- probchip –
- chipsize –
- CommandLine:
- python -m wbia.core_annots –test-gen_featweight_worker –show python -m wbia.core_annots –test-gen_featweight_worker –show –dpath figures –save ~/latex/crall-candidacy-2015/figures/gen_featweight.jpg python -m wbia.core_annots –test-gen_featweight_worker –show –db PZ_MTEST –qaid_list=1,2,3,4,5,6,7,8,9
- Doctest:
>>> from wbia.core_annots import * # NOQA >>> #test_featweight_worker() >>> ibs, depc, aid_list = testdata_core() >>> aid_list = aid_list[0:1] >>> config = {'dim_size': 450, 'resize_dim': 'area', 'smooth_thresh': 0, 'smooth_ksize': 0} >>> probchip = depc.get('probchip', aid_list, 'img', config=config)[0] >>> chipsize = depc.get('chips', aid_list, ('width', 'height'), config=config)[0] >>> kpts = depc.get('feat', aid_list, 'kpts', config=config)[0] >>> weights = gen_featweight_worker(kpts, probchip, chipsize) >>> assert np.all(weights <= 1.0), 'weights cannot be greater than 1' >>> chip = depc.get('chips', aid_list, 'img', config=config)[0] >>> ut.quit_if_noshow() >>> import wbia.plottool as pt >>> fnum = 1 >>> pnum_ = pt.make_pnum_nextgen(1, 3) >>> pt.figure(fnum=fnum, doclf=True) >>> pt.imshow(chip, pnum=pnum_(0), fnum=fnum) >>> pt.imshow(probchip, pnum=pnum_(2), fnum=fnum) >>> pt.imshow(chip, pnum=pnum_(1), fnum=fnum) >>> color_list = pt.draw_kpts2(kpts, weights=weights, ell_alpha=.3) >>> cb = pt.colorbar(weights, color_list) >>> cb.set_label('featweights') >>> pt.show_if_requested()
-
wbia.core_annots.
make_configured_annots
(ibs, qaids, daids, qannot_cfg, dannot_cfg, preload=False, return_view_cache=False)[source]¶ Configures annotations so they can be sent to the vsone vt.matching procedure.
- CommandLine:
- python -m wbia.core_annots make_configured_annots
- Doctest:
>>> from wbia.core_annots import * # NOQA >>> import wbia >>> ibs = wbia.opendb('testdb1') >>> qannot_cfg = dannot_cfg = ut.hashdict({}) >>> qaids = [1, 2] >>> daids = [3, 4] >>> preload = True >>> configured_lazy_annots, configured_annot_views = make_configured_annots( >>> ibs, qaids, daids, qannot_cfg, dannot_cfg, preload=False, >>> return_view_cache=True, >>> ) >>> aid_dict = configured_lazy_annots[qannot_cfg] >>> annot_views = configured_annot_views[qannot_cfg] >>> annot = aid_dict[1] >>> assert len(annot_views._cache) == 0 >>> view = annot['view'] >>> kpts = annot['kpts'] >>> assert len(annot_views._cache) == 2
-
wbia.core_annots.
make_hog_block_image
(hog, config=None)[source]¶ References
https://github.com/scikit-image/scikit-image/blob/master/skimage/feature/_hog.py
-
wbia.core_annots.
postprocess_mask
(mask, thresh=20, kernel_size=20)[source]¶ Parameters: mask (ndarray) – Returns: mask2 Return type: ndarray - CommandLine:
- python -m wbia.core_annots –exec-postprocess_mask –cnn –show –aid=1 –db PZ_MTEST python -m wbia –tf postprocess_mask –cnn –show –db PZ_MTEST –adapteq=True
- SeeAlso:
- python -m ibeis_cnn –tf generate_species_background_mask –show –db PZ_Master1 –aid 9970
- Ignore:
- input_tuple = aid_list tablename = ‘probchip’ config = full_config rowid_kw = dict(config=config)
- Doctest:
>>> from wbia.core_annots import * # NOQA >>> import wbia.plottool as pt >>> ibs, depc, aid_list = testdata_core() >>> config = ChipConfig.from_argv_dict() >>> probchip_config = ProbchipConfig(smooth_thresh=None) >>> chip = ibs.depc_annot.get('chips', aid_list, 'img', config)[0] >>> mask = ibs.depc_annot.get('probchip', aid_list, 'img', probchip_config)[0] >>> mask2 = postprocess_mask(mask) >>> ut.quit_if_noshow() >>> fnum = 1 >>> pt.imshow(chip, pnum=(1, 3, 1), fnum=fnum, xlabel=str(chip.shape)) >>> pt.imshow(mask, pnum=(1, 3, 2), fnum=fnum, title='before', xlabel=str(mask.shape)) >>> pt.imshow(mask2, pnum=(1, 3, 3), fnum=fnum, title='after', xlabel=str(mask2.shape)) >>> ut.show_if_requested()
wbia.core_images¶
IBEIS CORE IMAGE.
Defines the core dependency cache supported by the image analysis api
Extracts detection results from images and applies additional processing automatically
- Ex
- python -m wbia.control.IBEISControl –test-show_depc_image_graph –show python -m wbia.control.IBEISControl –test-show_depc_image_graph –show –reduced
TODO:
Notes
- HOW TO DESIGN INTERACTIVE PLOTS:
decorate as interactive
depc.get_property(recompute=True)
instead of calling preproc as a generator and then adding, calls preproc and passes in a callback function. preproc spawns interaction and must call callback function when finished.
callback function adds the rowids to the table.
- Needed Tables:
- Detections QualityClassifier ViewpointClassifier
-
class
wbia.core_images.
AoIConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_images.
CameraTrapEXIFConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_images.
Chip2Config
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_images.
Classifier2Config
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_images.
ClassifierConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_images.
ClassifierLocalizationsConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_images.
DetectorConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_images.
Feature2Config
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_images.
FeatureConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_images.
LabelerConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_images.
LocalizerConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_images.
LocalizerOriginalConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_images.
ThumbnailConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
class
wbia.core_images.
WebSrcConfig
(**kwargs)[source]¶ Bases:
wbia.dtool.base.Config
-
wbia.core_images.
compute_cameratrap_exif_worker
(gpath, orient, bottom=80, psm=7, oem=1, whitelist='0123456789°CF/:')[source]¶
-
wbia.core_images.
compute_classifications
(depc, gid_list, config=None)[source]¶ Extract the detections for a given input image.
Parameters: - depc (wbia.depends_cache.DependencyCache) –
- gid_list (list) – list of image rowids
- config (dict) – (default = None)
Yields: (float, str) – tup
- CommandLine:
- wbia compute_classifications
Example
>>> # DISABLE_DOCTEST >>> from wbia.core_images import * # NOQA >>> import wbia >>> defaultdb = 'PZ_MTEST' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> depc = ibs.depc_image >>> gid_list = ibs.get_valid_gids()[0:8] >>> # depc.delete_property('classifier', gid_list) >>> results = depc.get_property('classifier', gid_list, None) >>> print(results) >>> depc = ibs.depc_image >>> config = {'classifier_algo': 'svm'} >>> depc.delete_property('classifier', gid_list, config=config) >>> results = depc.get_property('classifier', gid_list, None, config=config) >>> print(results) >>> config = {'classifier_algo': 'svm', 'classifier_weight_filepath': 'localizer-zebra-10'} >>> depc.delete_property('classifier', gid_list, config=config) >>> results = depc.get_property('classifier', gid_list, None, config=config) >>> print(results)
-
wbia.core_images.
compute_classifications2
(depc, gid_list, config=None)[source]¶ Extract the multi-class classifications for a given input image.
Parameters: - depc (wbia.depends_cache.DependencyCache) –
- gid_list (list) – list of image rowids
- config (dict) – (default = None)
Yields: (np.ndarray, np.ndarray) – tup
- CommandLine:
- wbia compute_classifications2
Example
>>> # DISABLE_DOCTEST >>> from wbia.core_images import * # NOQA >>> import wbia >>> defaultdb = 'PZ_MTEST' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> depc = ibs.depc_image >>> gid_list = ibs.get_valid_gids()[0:8] >>> # depc.delete_property('classifier_two', gid_list) >>> results = depc.get_property('classifier_two', gid_list, None) >>> print(results)
-
wbia.core_images.
compute_detections
(depc, gid_list, config=None)[source]¶ Extract the detections for a given input image.
Parameters: - depc (wbia.depends_cache.DependencyCache) –
- gid_list (list) – list of image rowids
- config (dict) – (default = None)
Yields: (float, np.ndarray, np.ndarray, np.ndarray, np.ndarray) – tup
- CommandLine:
- wbia compute_detections
Example
>>> # SLOW_DOCTEST >>> # xdoctest: +SKIP >>> from wbia.core_images import * # NOQA >>> import wbia >>> defaultdb = 'PZ_MTEST' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> # dbdir = '/Users/bluemellophone/Desktop/GGR-IBEIS-TEST/' >>> # dbdir = '/media/danger/GGR/GGR-IBEIS-TEST/' >>> # ibs = wbia.opendb(dbdir=dbdir) >>> depc = ibs.depc_image >>> gid_list = ibs.get_valid_gids()[0:2] >>> depc.delete_property('detections', gid_list) >>> detects = depc.get_property('detections', gid_list, None) >>> print(detects)
-
wbia.core_images.
compute_features
(depc, gid_list, config=None)[source]¶ Compute features on images using pre-trained state-of-the-art models in Keras.
Parameters: - depc (wbia.depends_cache.DependencyCache) –
- gid_list (list) – list of image rowids
- config (dict) – (default = None)
Yields: (np.ndarray, ) – tup
- CommandLine:
- wbia compute_features
- CommandLine:
- python -m wbia.core_images compute_features –show
Example
>>> # DISABLE_DOCTEST >>> from wbia.core_images import * # NOQA >>> import wbia >>> defaultdb = 'PZ_MTEST' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> depc = ibs.depc_image >>> print(depc.get_tablenames()) >>> gid_list = ibs.get_valid_gids()[:16] >>> config = {'model': 'vgg16'} >>> depc.delete_property('features', gid_list, config=config) >>> features = depc.get_property('features', gid_list, 'vector', config=config) >>> print(features) >>> config = {'model': 'vgg19'} >>> depc.delete_property('features', gid_list, config=config) >>> features = depc.get_property('features', gid_list, 'vector', config=config) >>> print(features) >>> config = {'model': 'resnet'} >>> depc.delete_property('features', gid_list, config=config) >>> features = depc.get_property('features', gid_list, 'vector', config=config) >>> print(features) >>> config = {'model': 'inception'} >>> depc.delete_property('features', gid_list, config=config) >>> features = depc.get_property('features', gid_list, 'vector', config=config) >>> print(features)
-
wbia.core_images.
compute_localizations
(depc, loc_orig_id_list, config=None)[source]¶ Extract the localizations for a given input image.
Parameters: - depc (wbia.depends_cache.DependencyCache) –
- gid_list (list) – list of image rowids
- config (dict) – (default = None)
Yields: (float, np.ndarray, np.ndarray, np.ndarray, np.ndarray) – tup
- CommandLine:
- wbia compute_localizations
- CommandLine:
- python -m wbia.core_images compute_localizations –show
Example
>>> # DISABLE_DOCTEST >>> from wbia.core_images import * # NOQA >>> import wbia >>> defaultdb = 'PZ_MTEST' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> depc = ibs.depc_image >>> print(depc.get_tablenames()) >>> gid_list = ibs.get_valid_gids()[:16] >>> config = {'algo': 'lightnet', 'nms': True} >>> # depc.delete_property('localizations', gid_list, config=config) >>> detects = depc.get_property('localizations', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'combined': True} >>> # depc.delete_property('localizations', gid_list, config=config) >>> detects = depc.get_property('localizations', gid_list, 'bboxes', config=config) >>> print(detects)
-
wbia.core_images.
compute_localizations_chips
(depc, loc_id_list, config=None)[source]¶ Extract the detections for a given input image.
Parameters: - depc (wbia.depends_cache.DependencyCache) –
- loc_id_list (list) – list of localization rowids
- config (dict) – (default = None)
Yields: (float, str) – tup
- CommandLine:
- wbia compute_localizations_chips
Example
>>> # DISABLE_DOCTEST >>> from wbia.core_images import * # NOQA >>> import wbia >>> defaultdb = 'PZ_MTEST' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> depc = ibs.depc_image >>> gid_list = ibs.get_valid_gids()[0:8] >>> config = {'combined': True, 'localization_chip_masking': True} >>> # depc.delete_property('localizations_chips', gid_list, config=config) >>> results = depc.get_property('localizations_chips', gid_list, None, config=config) >>> print(results) >>> config = {'combined': True, 'localization_chip_masking': False} >>> # depc.delete_property('localizations_chips', gid_list, config=config) >>> results = depc.get_property('localizations_chips', gid_list, None, config=config) >>> print(results)
-
wbia.core_images.
compute_localizations_classifications
(depc, loc_id_list, config=None)[source]¶ Extract the detections for a given input image.
Parameters: - depc (wbia.depends_cache.DependencyCache) –
- loc_id_list (list) – list of localization rowids
- config (dict) – (default = None)
Yields: (float, str) – tup
- CommandLine:
- wbia compute_localizations_classifications
Example
>>> # DISABLE_DOCTEST >>> from wbia.core_images import * # NOQA >>> import wbia >>> defaultdb = 'PZ_MTEST' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> depc = ibs.depc_image >>> gid_list = ibs.get_valid_gids()[0:8] >>> config = {'algo': 'yolo'} >>> # depc.delete_property('localizations_classifier', gid_list, config=config) >>> results = depc.get_property('localizations_classifier', gid_list, None, config=config) >>> print(results) >>> config = {'algo': 'yolo', 'classifier_masking': True} >>> # depc.delete_property('localizations_classifier', gid_list, config=config) >>> results = depc.get_property('localizations_classifier', gid_list, None, config=config) >>> print(results) >>> >>> depc = ibs.depc_image >>> gid_list = list(set(ibs.get_imageset_gids(ibs.get_imageset_imgsetids_from_text('TEST_SET')))) >>> config = {'combined': True, 'classifier_algo': 'svm', 'classifier_weight_filepath': None} >>> # depc.delete_property('localizations_classifier', gid_list, config=config) >>> results = depc.get_property('localizations_classifier', gid_list, None, config=config) >>> print(results) >>> >>> config = {'combined': True, 'classifier_algo': 'svm', 'classifier_weight_filepath': 'localizer-zebra-10'} >>> # depc.delete_property('localizations_classifier', gid_list, config=config) >>> results = depc.get_property('localizations_classifier', gid_list, None, config=config) >>> print(results) >>> >>> config = {'combined': True, 'classifier_algo': 'svm', 'classifier_weight_filepath': 'localizer-zebra-50'} >>> results = depc.get_property('localizations_classifier', gid_list, None, config=config) >>> print(results) >>> >>> config = {'combined': True, 'classifier_algo': 'svm', 'classifier_weight_filepath': 'localizer-zebra-100'} >>> results = depc.get_property('localizations_classifier', gid_list, None, config=config) >>> print(results)
-
wbia.core_images.
compute_localizations_features
(depc, loc_id_list, config=None)[source]¶ Compute features on images using pre-trained state-of-the-art models in Keras.
Parameters: - depc (wbia.depends_cache.DependencyCache) –
- gid_list (list) – list of image rowids
- config (dict) – (default = None)
Yields: (np.ndarray, ) – tup
- CommandLine:
- wbia compute_localizations_features
- CommandLine:
- python -m wbia.core_images compute_localizations_features –show
Example
>>> # DISABLE_DOCTEST >>> from wbia.core_images import * # NOQA >>> import wbia >>> defaultdb = 'PZ_MTEST' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> depc = ibs.depc_image >>> print(depc.get_tablenames()) >>> gid_list = ibs.get_valid_gids()[:16] >>> config = {'feature2_algo': 'vgg16', 'combined': True} >>> depc.delete_property('localizations_features', gid_list, config=config) >>> features = depc.get_property('localizations_features', gid_list, 'vector', config=config) >>> print(features) >>> config = {'feature2_algo': 'vgg19', 'combined': True} >>> depc.delete_property('localizations_features', gid_list, config=config) >>> features = depc.get_property('localizations_features', gid_list, 'vector', config=config) >>> print(features) >>> config = {'feature2_algo': 'resnet', 'combined': True} >>> depc.delete_property('localizations_features', gid_list, config=config) >>> features = depc.get_property('localizations_features', gid_list, 'vector', config=config) >>> print(features) >>> config = {'feature2_algo': 'inception', 'combined': True} >>> depc.delete_property('localizations_features', gid_list, config=config) >>> features = depc.get_property('localizations_features', gid_list, 'vector', config=config) >>> print(features)
-
wbia.core_images.
compute_localizations_interest
(depc, loc_id_list, config=None)[source]¶ Extract the detections for a given input image.
Parameters: - depc (wbia.depends_cache.DependencyCache) –
- loc_id_list (list) – list of localization rowids
- config (dict) – (default = None)
Yields: (float, str) – tup
- CommandLine:
- wbia compute_localizations_labels
Example
>>> # DISABLE_DOCTEST >>> from wbia.core_images import * # NOQA >>> import wbia >>> defaultdb = 'PZ_MTEST' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> depc = ibs.depc_image >>> gid_list = ibs.get_valid_gids()[0:100] >>> depc.delete_property('labeler', gid_list) >>> results = depc.get_property('labeler', gid_list, None) >>> results = depc.get_property('labeler', gid_list, 'species') >>> print(results)
-
wbia.core_images.
compute_localizations_labels
(depc, loc_id_list, config=None)[source]¶ Extract the detections for a given input image.
Parameters: - depc (wbia.depends_cache.DependencyCache) –
- loc_id_list (list) – list of localization rowids
- config (dict) – (default = None)
Yields: (float, str) – tup
- CommandLine:
- python -m wbia.core_images –exec-compute_localizations_labels
Example
>>> # DISABLE_DOCTEST >>> from wbia.core_images import * # NOQA >>> import wbia >>> defaultdb = 'PZ_MTEST' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> depc = ibs.depc_image >>> gid_list = ibs.get_valid_gids()[0:10] >>> config = {'labeler_algo': 'densenet', 'labeler_weight_filepath': 'giraffe_v1'} >>> # depc.delete_property('localizations_labeler', aid_list) >>> results = depc.get_property('localizations_labeler', gid_list, None, config=config) >>> print(results) >>> config = {'labeler_weight_filepath': 'candidacy'} >>> # depc.delete_property('localizations_labeler', aid_list) >>> results = depc.get_property('localizations_labeler', gid_list, None, config=config) >>> print(results)
-
wbia.core_images.
compute_localizations_original
(depc, gid_list, config=None)[source]¶ Extract the localizations for a given input image.
Parameters: - depc (wbia.depends_cache.DependencyCache) –
- gid_list (list) – list of image rowids
- config (dict) – (default = None)
Yields: (float, np.ndarray, np.ndarray, np.ndarray, np.ndarray) – tup
- CommandLine:
- wbia compute_localizations_original
- CommandLine:
- python -m wbia.core_images compute_localizations_original –show
Example
>>> # DISABLE_DOCTEST >>> from wbia.core_images import * # NOQA >>> import wbia >>> defaultdb = 'PZ_MTEST' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> depc = ibs.depc_image >>> print(depc.get_tablenames()) >>> gid_list = ibs.get_valid_gids()[:16] >>> config = {'algo': 'azure', 'config_filepath': None} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'darknet', 'config_filepath': 'pretrained-v2-pascal'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'darknet', 'config_filepath': 'pretrained-v2-large-pascal'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'darknet', 'config_filepath': 'pretrained-tiny-pascal'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'darknet', 'config_filepath': 'pretrained-v2-large-coco'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'darknet', 'config_filepath': 'pretrained-tiny-coco'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'yolo'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'lightnet'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'rf'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'selective-search'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'selective-search-rcnn'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'faster-rcnn', 'config_filepath': 'pretrained-vgg-pascal'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'faster-rcnn', 'config_filepath': 'pretrained-zf-pascal'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'faster-rcnn', 'config_filepath': 'pretrained-vgg-ilsvrc'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'faster-rcnn', 'config_filepath': 'pretrained-zf-ilsvrc'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'ssd', 'config_filepath': 'pretrained-300-pascal'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'ssd', 'config_filepath': 'pretrained-512-pascal'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'ssd', 'config_filepath': 'pretrained-300-pascal-plus'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'ssd', 'config_filepath': 'pretrained-512-pascal-plus'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'ssd', 'config_filepath': 'pretrained-300-coco'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'ssd', 'config_filepath': 'pretrained-512-coco'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'ssd', 'config_filepath': 'pretrained-300-ilsvrc'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': 'ssd', 'config_filepath': 'pretrained-500-ilsvrc'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects) >>> config = {'algo': '_COMBINED'} >>> depc.delete_property('localizations_original', gid_list, config=config) >>> detects = depc.get_property('localizations_original', gid_list, 'bboxes', config=config) >>> print(detects)
-
wbia.core_images.
compute_thumbnails
(depc, gid_list, config=None)[source]¶ Compute the thumbnail for a given input image.
Parameters: - depc (wbia.depends_cache.DependencyCache) –
- gid_list (list) – list of image rowids
- config (dict) – (default = None)
Yields: (uri, int, int) – tup
- CommandLine:
- wbia –tf compute_thumbnails –show –db PZ_MTEST
Example
>>> # ENABLE_DOCTEST >>> # xdoctest: +REQUIRES(--weird) >>> from wbia.core_images import * # NOQA >>> import wbia >>> defaultdb = 'testdb1' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> depc = ibs.depc_image >>> gid_list = ibs.get_valid_gids()[0:10] >>> thumbs = depc.get_property('thumbnails', gid_list, 'img', config={'thumbsize': 221}, recompute=True) >>> # xdoctest: +REQUIRES(--show) >>> import wbia.plottool as pt >>> pt.quit_if_noshow() >>> iteract_obj = pt.interact_multi_image.MultiImageInteraction(thumbs, nPerPage=4) >>> iteract_obj.start() >>> pt.show_if_requested()
-
wbia.core_images.
compute_web_src
(depc, gid_list, config=None)[source]¶ Compute the web src
Parameters: - depc (wbia.depends_cache.DependencyCache) –
- gid_list (list) – list of image rowids
- config (dict) – (default = None)
Yields: (str) – tup
- CommandLine:
- wbia –tf compute_web_src –show –db PZ_MTEST
Example
>>> # ENABLE_DOCTEST >>> from wbia.core_images import * # NOQA >>> import wbia >>> defaultdb = 'testdb1' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> depc = ibs.depc_image >>> gid_list = ibs.get_valid_gids()[0:10] >>> thumbs = depc.get_property('web_src', gid_list, 'src', recompute=True) >>> thumb = thumbs[0] >>> assert ut.hash_data(thumb) in ['wcuppmpowkvhfmfcnrxdeedommihexfu', 'wjkpjrsmqzdhmqdxjbgomdmqxaxsckxn']
-
wbia.core_images.
draw_thumb_helper
(thumbsize, gpath, orient, bbox_list, theta_list, interest_list)[source]¶
-
wbia.core_images.
get_localization_chips
(ibs, loc_id_list, target_size=(128, 128), axis_aligned=False)[source]¶
-
wbia.core_images.
get_localization_chips_worker
(gid, img, bbox_list, theta_list, target_size, axis_aligned=False)[source]¶
wbia.core_parts¶
Extracts parts chips from image and applies optional image normalizations.
-
wbia.core_parts.
compute_part_chip
(depc, part_rowid_list, config=None)[source]¶ Extracts the part chip from the bounding box
Parameters: - depc (wbia.depends_cache.DependencyCache) –
- part_rowid_list (list) – list of part rowids
- config (dict) – (default = None)
Yields: (uri, int, int) – tup
- CommandLine:
- wbia –tf compute_part_chip
- Doctest:
>>> from wbia.core_parts import * # NOQA >>> import wbia >>> import random >>> defaultdb = 'testdb1' >>> ibs = wbia.opendb(defaultdb=defaultdb) >>> depc = ibs.depc_part >>> config = {'dim_size': None} >>> aid_list = ibs.get_valid_aids() >>> aid_list = aid_list[:10] >>> bbox_list = ibs.get_annot_bboxes(aid_list) >>> bbox_list = [ >>> (xtl + 100, ytl + 100, w - 100, h - 100) >>> for xtl, ytl, w, h in bbox_list >>> ] >>> part_rowid_list = ibs.add_parts(aid_list, bbox_list=bbox_list) >>> chips = depc.get_property('pchips', part_rowid_list, 'img', config=config) >>> for (xtl, ytl, w, h), chip in zip(bbox_list, chips): >>> assert chip.shape == (h, w, 3) >>> ibs.delete_parts(part_rowid_list)
wbia.demodata¶
wbia.dev¶
mkinit ~/code/wbia/wbia
DEV SCRIPT
TODO: DEPRICATE
This is a hacky script meant to be run mostly automatically with the option of interactions.
dev.py is supposed to be a developer non-gui interface into the IBEIS software. dev.py runs experiments and serves as a scratchpad for new code and quick scripts
- Done:
- Cache nearest neighbors so different parameters later in the pipeline dont take freaking forever.
- CommandLine:
- python dev.py –wshow -t query –db PZ_MTEST –qaid 110 –cfg score_method:nsum prescore_method:nsum python dev.py –wshow -t query –db PZ_MTEST –qaid 110 python dev.py –wshow -t query –db PZ_MTEST –qaid 110 –cfg fg_on=True python dev.py –wshow -t query –db PZ_MTEST –qaid 110 –cfg
-
wbia.dev.
dev_snippets
(main_locals)[source]¶ Common variables for convineince when interacting with IPython
-
wbia.dev.
devmain
()[source]¶ - The Developer Script
A command line interface to almost everything
-w # wait / show the gui / figures are visible --cmd # ipython shell to play with variables -t # run list of tests
-
wbia.dev.
ggr_random_name_splits
()[source]¶ - CommandLine:
- python -m wbia.viz.viz_graph2 ggr_random_name_splits –show
- Ignore:
- sshfs -o idmap=user lev:/ ~/lev
Example
>>> # DISABLE_DOCTEST >>> from wbia.viz.viz_graph2 import * # NOQA >>> ggr_random_name_splits()
-
wbia.dev.
print
(*args, **kwargs)¶ ./dev.py -e print_results –db PZ_Master1 -a varysize_pzm:dper_name=[1,2],dsize=1500 -t candidacy_k:K=1 –intersect_hack ./dev.py -e draw_rank_cmc -t baseline -a baseline –show –db PZ_Master1 ./dev.py -e get_dbinfo –db PZ_Master1 –aid_list=baseline ./dev.py -e get_dbinfo –db PZ_MTEST ./dev.py -e get_dbinfo –db PZ_Master1 –aid_list=baseline –hackshow-unixtime –show ./dev.py -e get_dbinfo –db PZ_Master1 –hackshow-unixtime –show
-
wbia.dev.
profile
(func)¶ ./dev.py -e print_results –db PZ_Master1 -a varysize_pzm:dper_name=[1,2],dsize=1500 -t candidacy_k:K=1 –intersect_hack ./dev.py -e draw_rank_cmc -t baseline -a baseline –show –db PZ_Master1 ./dev.py -e get_dbinfo –db PZ_Master1 –aid_list=baseline ./dev.py -e get_dbinfo –db PZ_MTEST ./dev.py -e get_dbinfo –db PZ_Master1 –aid_list=baseline –hackshow-unixtime –show ./dev.py -e get_dbinfo –db PZ_Master1 –hackshow-unixtime –show
-
wbia.dev.
rrr
(verbose=True)¶ ./dev.py -e print_results –db PZ_Master1 -a varysize_pzm:dper_name=[1,2],dsize=1500 -t candidacy_k:K=1 –intersect_hack ./dev.py -e draw_rank_cmc -t baseline -a baseline –show –db PZ_Master1 ./dev.py -e get_dbinfo –db PZ_Master1 –aid_list=baseline ./dev.py -e get_dbinfo –db PZ_MTEST ./dev.py -e get_dbinfo –db PZ_Master1 –aid_list=baseline –hackshow-unixtime –show ./dev.py -e get_dbinfo –db PZ_Master1 –hackshow-unixtime –show
-
wbia.dev.
run_dev
(ibs)[source]¶ main developer command
- CommandLine:
- python dev.py –db PZ_Master0 –controlled –print-rankhist
wbia.filter_configs¶
wbia.images¶
-
class
wbia.images.
ImageSetAttrInjector
(name, bases, dct)[source]¶ Bases:
type
Example
>>> # SCRIPT >>> from wbia import _wbia_object >>> import wbia >>> ibs = wbia.opendb(defaultdb='testdb1') >>> objname = 'imageset' >>> blacklist = [] >>> _wbia_object._find_wbia_attrs(ibs, objname, blacklist)
-
class
wbia.images.
ImageSets
(gsids, ibs, config=None)[source]¶ Bases:
wbia._wbia_object.ObjectList1D
Represents a group of annotations. Efficiently accesses properties from a database using lazy evaluation.
- CommandLine:
- python -m wbia.images ImageSets
Example
>>> # DISABLE_DOCTEST >>> from wbia.images import * # NOQA >>> import wbia >>> ibs = wbia.opendb(defaultdb='testdb1') >>> gsids = ibs._get_all_imgsetids() >>> self = ImageSets(gsids, ibs) >>> print(self) <ImageSets(num=13)>
-
aids
¶
-
annots
¶
-
configid
¶
-
custom_filtered_aids
¶
-
duration
¶
-
end_time_posix
¶
-
fraction_annotmatch_reviewed
¶
-
fraction_imgs_reviewed
¶
-
fraction_names_with_exemplar
¶
-
gids
¶
-
gps_lats
¶
-
gps_lons
¶
-
gsgrids
¶
-
image_uuids
¶
-
images
¶
-
imgsetids_from_text
¶
-
imgsetids_from_uuid
¶
-
isoccurrence
¶
-
name_uuids
¶
-
nids
¶
-
note
¶
-
notes
¶
-
num_aids
¶
-
num_annotmatch_reviewed
¶
-
num_annots_reviewed
¶
-
num_gids
¶
-
num_imgs_reviewed
¶
-
num_names_with_exemplar
¶
-
percent_annotmatch_reviewed_str
¶
-
percent_imgs_reviewed_str
¶
-
percent_names_with_exemplar_str
¶
-
processed_flags
¶
-
rrr
()¶ Dynamic module reloading
-
shipped_flags
¶
-
smart_waypoint_ids
¶
-
smart_xml_contents
¶
-
smart_xml_fnames
¶
-
start_time_posix
¶
-
text
¶
-
uuid
¶
-
uuids
¶
-
class
wbia.images.
Images
(rowids, ibs, config=None, caching=False, asarray=False)[source]¶ Bases:
wbia._wbia_object.ObjectList1D
Represents a group of annotations. Efficiently accesses properties from a database using lazy evaluation.
- CommandLine:
- python -m wbia.images Images –show
Example
>>> # DISABLE_DOCTEST >>> from wbia.images import * # NOQA >>> import wbia >>> ibs = wbia.opendb(defaultdb='testdb1') >>> gids = ibs.get_valid_gids() >>> g = self = images = Images(gids, ibs) >>> print(g.widths) >>> print(g) <Images(num=13)>
-
aids
¶
-
aids_of_species
¶
-
annot_uuids
¶
-
annot_uuids_of_species
¶
-
annotation_bboxes
¶
-
annotation_thetas
¶
-
annots
¶
-
contributor_rowid
¶
-
contributor_tag
¶
-
datetime
¶
-
datetime_str
¶
-
detect_confidence
¶
-
detectpaths
¶
-
enabled
¶
-
exts
¶
-
gid
¶
-
gids
¶
-
glrids
¶
-
gnames
¶
-
gps
¶
-
gps2
¶
-
gsgrids
¶
-
heights
¶
-
imagesettext
¶
-
imgset_uuids
¶
-
imgsetids
¶
-
lat
¶
-
location_codes
¶
-
lon
¶
-
missing_uuid
¶
-
name_uuids
¶
-
nids
¶
-
notes
¶
-
num_annotations
¶
-
orientation
¶
-
orientation_str
¶
-
party_rowids
¶
-
party_tag
¶
-
paths
¶
-
reviewed
¶
-
rrr
()¶ Dynamic module reloading
-
sizes
¶
-
species_rowids
¶
-
species_uuids
¶
-
thumbpath
¶
-
thumbtup
¶
-
time_statstr
¶
-
timedelta_posix
¶
-
unixtime
¶
-
unixtime2
¶
-
unixtime_asfloat
¶
-
uris
¶
-
uris_original
¶
-
uuids
¶
-
widthsimgdata
¶
wbia.main_module¶
This module defines the entry point into the IBEIS system wbia.opendb and wbia.main are the main entry points
-
wbia.main_module.
main
(gui=True, dbdir=None, defaultdb='cache', allow_newdir=False, db=None, delete_ibsdir=False, **kwargs)[source]¶ Program entry point Inits the system environment, an IBEISControl, and a GUI if requested
Parameters: - gui (bool) – (default=True) If gui is False a gui instance will not be created
- dbdir (None) – full directory of a database to load
- db (None) – name of database to load relative to the workdir
- allow_newdir (bool) – (default=False) if False an error is raised if a a new database is created
- defaultdb (str) – codename of database to load if db and dbdir is None. a value of ‘cache’ will open the last database opened with the GUI.
Returns: main_locals
Return type: dict
-
wbia.main_module.
main_loop
(main_locals, rungui=True, ipy=False, persist=True)[source]¶ Runs the qt loop if the GUI was initialized and returns an executable string for embedding an IPython terminal if requested.
If rungui is False the gui will not loop even if back has been created
the main locals dict must be callsed main_locals in the scope you call this function in.
Parameters: - main_locals (dict_) –
- rungui (bool) –
- ipy (bool) –
- persist (bool) –
Returns: execstr
Return type: str
-
wbia.main_module.
opendb
(db=None, dbdir=None, defaultdb='cache', allow_newdir=False, delete_ibsdir=False, verbose=False, use_cache=True, web=None, **kwargs)[source]¶ main without the preload (except for option to delete database before opening)
Parameters: - db (str) – database name in your workdir used only if dbdir is None
- dbdir (None) – full database path
- defaultdb (str) – dbdir search stratagy when db is None and dbdir is None
- allow_newdir (bool) – (default=True) if True errors when opening a nonexisting database
- delete_ibsdir (bool) – BE CAREFUL! (default=False) if True deletes the entire
- verbose (bool) – verbosity flag
- web (bool) – starts webserver if True (default=param specification)
- use_cache (bool) – if True will try to return a previously loaded controller
Returns: ibs
Return type: wbia.IBEISController
Example
>>> # ENABLE_DOCTEST >>> from wbia.main_module import * # NOQA >>> db = None >>> dbdir = None >>> defaultdb = 'cache' >>> allow_newdir = False >>> delete_ibsdir = False >>> verbose = False >>> use_cache = True >>> ibs = opendb(db, dbdir, defaultdb, allow_newdir, delete_ibsdir, >>> verbose, use_cache) >>> result = str(ibs) >>> print(result)
-
wbia.main_module.
opendb_bg_web
(*args, **kwargs)[source]¶ Wrapper around opendb_in_background, returns a nice web_ibs object to execute web calls using normal python-like syntax
Parameters: - *args – passed to opendb_in_background
- **kwargs –
port (int): domain (str): if specified assumes server is already running
somewhere otherwise kwargs is passed to opendb_in_backgroundstart_job_queue (bool)
Returns: web_ibs - this is a KillableProcess object with special functions
- CommandLine:
- python -m wbia.main_module opendb_bg_web
Example
>>> # DISABLE_DOCTEST >>> from wbia.main_module import * # NOQA >>> args = tuple() >>> kwargs = {} >>> print('Opening a web_ibs') >>> web_ibs = opendb_bg_web() >>> print('SUCESS Opened a web_ibs!') >>> print(web_ibs) >>> print('Now kill the web_ibs') >>> web_ibs.terminate2()
-
wbia.main_module.
opendb_fg_web
(*args, **kwargs)[source]¶ - Ignore:
>>> from wbia.main_module import * # NOQA >>> kwargs = {'db': 'testdb1'} >>> args = tuple()
>>> import wbia >>> ibs = wbia.opendb_fg_web()
-
wbia.main_module.
opendb_in_background
(*args, **kwargs)[source]¶ Starts a web server in the background
-
wbia.main_module.
opendb_test
(gui=True, dbdir=None, defaultdb='cache', allow_newdir=False, db=None)[source]¶ alias for main()
-
wbia.main_module.
set_newfile_permissions
()[source]¶ sets this processes default permission bits when creating new files
- CommandLine:
- python -m wbia.main_module –test-set_newfile_permissions
Example
>>> # ENABLE_DOCTEST >>> from wbia.main_module import * # NOQA >>> import os >>> import utool as ut >>> # write before umask >>> ut.delete('tempfile1.txt') >>> ut.write_to('tempfile1.txt', 'foo') >>> stat_result1 = os.stat('tempfile1.txt') >>> # apply umask >>> set_newfile_permissions() >>> ut.delete('tempfile2.txt') >>> ut.write_to('tempfile2.txt', 'foo') >>> stat_result2 = os.stat('tempfile2.txt') >>> # verify results >>> print('old masked all bits = %o' % (stat_result1.st_mode)) >>> print('new masked all bits = %o' % (stat_result2.st_mode))
wbia.params¶
DEPRICATE THIS ENTIRE FILE
this module lists most of the command line args available for use. there are still many cases where util_arg.get_argval and util_arg.get_argflag are used instead of this module. Those command line arguments will not be represented here and they should eventually be integrated into this module (hopefully automagically)
TODO: nnkj/enerate this module automagically from
import utool as ut utool_parse_codeblock = ut.util_arg.autogen_argparse_block(extra_args=parsed_args) ut.util_arg.reset_argrecord() import wbia parsed_args = ut.util_arg.parse_used_arg_flags_and_vals(wbia, recursive=True) wbia_parse_codeblock = ut.util_arg.autogen_argparse_block(extra_args=parsed_args)
ut.util_arg.autogenerate_parse_py([utool_parse_codeblock, wbia_parse_codeblock])
utool_parse_codeblock ut.util_arg
print(parse_codeblock)
wbia.tag_funcs¶
Generally appends tags to annotations. Careful not to introduce too many random tags. Maybe we should just let that happen and introduce tag-aliases
Note: this is more of a set add rather than a list append
TODO: remove
-
wbia.tag_funcs.
export_tagged_chips
(ibs, aid_list, dpath='.')[source]¶ DEPRICATE
- CommandLine:
- python -m wbia.tag_funcs –exec-export_tagged_chips –tags Hard interesting needswork –db PZ_Master1 python -m wbia.tag_funcs –exec-export_tagged_chips –logic=or –any_startswith quality occlusion –has_any lighting needswork interesting hard –db GZ_Master1 –dpath=/media/raid python -m wbia.tag_funcs –exec-export_tagged_chips –db GZ_Master1 –min_num=1 –dpath /media/raid
Example
>>> # SCRIPT >>> from wbia.tag_funcs import * # NOQA >>> import wbia >>> ibs = wbia.opendb(defaultdb='testdb1') >>> kwargs = ut.argparse_dict(ut.get_kwdefaults2(filterflags_general_tags), type_hint=ut.ddict(list, logic=str)) >>> ut.print_dict(kwargs, 'filter args') >>> aid_list = ibs.filter_annots_by_tags(**kwargs) >>> print('len(aid_list) = %r' % (len(aid_list),)) >>> dpath = ut.get_argval('--dpath', default='') >>> all_tags = ut.flatten(ibs.get_annot_all_tags(aid_list)) >>> filtered_tag_hist = ut.dict_hist(all_tags) >>> ut.print_dict(filtered_tag_hist, key_order_metric='val') >>> export_tagged_chips(ibs, aid_list, dpath)
list(zip(aid_pairs, undirected_tags))
ignores case
Parameters: - ibs (IBEISController) – wbia controller object
- flags –
Returns: list
- CommandLine:
python -m wbia.tag_funcs –exec-filter_annotmatch_by_tags –show python -m wbia.tag_funcs –exec-filter_annotmatch_by_tags –show –db PZ_Master1 –min-num=1 python -m wbia.tag_funcs –exec-filter_annotmatch_by_tags –show –db PZ_Master1 –tags JoinCase python -m wbia.tag_funcs –exec-filter_annotmatch_by_tags –show –db PZ_Master1 –tags SplitCase python -m wbia.tag_funcs –exec-filter_annotmatch_by_tags –show –db PZ_Master1 –tags occlusion python -m wbia.tag_funcs –exec-filter_annotmatch_by_tags –show –db PZ_Master1 –tags viewpoint python -m wbia.tag_funcs –exec-filter_annotmatch_by_tags –show –db PZ_Master1 –tags SceneryMatch python -m wbia.tag_funcs –exec-filter_annotmatch_by_tags –show –db PZ_Master1 –tags Photobomb
python -m wbia.tag_funcs –exec-filter_annotmatch_by_tags –show –db GZ_Master1 –tags needswork
Example
>>> # DISABLE_DOCTEST >>> from wbia.tag_funcs import * # NOQA >>> import wbia >>> #ibs = wbia.opendb(defaultdb='testdb1') >>> ibs = wbia.opendb(defaultdb='PZ_Master1') >>> #tags = ['Photobomb', 'SceneryMatch'] >>> has_any = ut.get_argval('--tags', type_=list, default=['SceneryMatch', 'Photobomb']) >>> min_num = ut.get_argval('--min_num', type_=int, default=1) >>> prop = has_any[0] >>> filtered_annotmatch_rowids = filter_annotmatch_by_tags(ibs, None, has_any=has_any, min_num=min_num) >>> aid1_list = np.array(ibs.get_annotmatch_aid1(filtered_annotmatch_rowids)) >>> aid2_list = np.array(ibs.get_annotmatch_aid2(filtered_annotmatch_rowids)) >>> aid_pairs = np.vstack([aid1_list, aid2_list]).T >>> # Dont double count >>> xs = vt.find_best_undirected_edge_indexes(aid_pairs) >>> aid1_list = aid1_list.take(xs) >>> aid2_list = aid2_list.take(xs) >>> valid_tags_list = ibs.get_annotmatch_case_tags(filtered_annotmatch_rowids) >>> print('valid_tags_list = %s' % (ut.repr2(valid_tags_list, nl=1),)) >>> # >>> print('Aid pairs with has_any=%s' % (has_any,)) >>> print('Aid pairs with min_num=%s' % (min_num,)) >>> print('aid_pairs = ' + ut.repr2(list(zip(aid1_list, aid2_list)))) >>> # Show timedelta info >>> ut.quit_if_noshow() >>> timedelta_list = ibs.get_annot_pair_timedelta(aid1_list, aid2_list) >>> import wbia.plottool as pt >>> pt.draw_timedelta_pie(timedelta_list, label='timestamp of tags=%r' % (has_any,)) >>> ut.show_if_requested()
Filter / Find / Search for annotations with particular tags
- CommandLine:
- python -m wbia.tag_funcs –exec-filter_annots_by_tags –helpx python -m wbia.tag_funcs –exec-filter_annots_by_tags –db GZ_Master1 python -m wbia.tag_funcs –exec-filter_annots_by_tags –db GZ_Master1 –min_num=1 python -m wbia.tag_funcs –exec-filter_annots_by_tags –db GZ_Master1 –has_any=lighting –has_all=lighting:underexposed –show
- SeeAlso:
- python -m wbia.init.filter_annots –exec-filter_annots_general
Example
>>> # ENABLE_DOCTEST >>> from wbia.tag_funcs import * # NOQA >>> import wbia >>> ibs = wbia.opendb(defaultdb='testdb1') >>> aid_list = ibs.get_valid_aids() >>> kwargs = ut.argparse_dict(ut.get_kwdefaults2(filterflags_general_tags), type_hint=ut.ddict(list, logic=str)) >>> ut.print_dict(kwargs, 'filter args') >>> aid_list = ibs.filter_annots_by_tags(aid_list, **kwargs) >>> print('len(aid_list) = %r' % (len(aid_list),)) >>> # print results >>> all_tags = ut.flatten(ibs.get_annot_all_tags(aid_list)) >>> filtered_tag_hist = ut.dict_hist(all_tags) >>> ut.print_dict(filtered_tag_hist, key_order_metric='val') >>> print('len(aid_list) = %r' % (len(aid_list),)) >>> print('sum(tags) = %r' % (sum(filtered_tag_hist.values()),)) >>> ut.quit_if_noshow() >>> import wbia.viz.interact >>> wbia.viz.interact.interact_chip.interact_multichips(ibs, aid_list) >>> ut.show_if_requested()
Filter / Find / Search for annotations with particular tags
maybe integrate into utool? Seems pretty general
Parameters: - tags_list (list) –
- has_any (None) – (default = None)
- has_all (None) – (default = None)
- min_num (None) – (default = None)
- max_num (None) – (default = None)
- CommandLine:
- python -m wbia.tag_funcs –exec-filterflags_general_tags python -m wbia.tag_funcs –exec-filterflags_general_tags:0 –helpx python -m wbia.tag_funcs –exec-filterflags_general_tags:0 python -m wbia.tag_funcs –exec-filterflags_general_tags:0 –none_match n python -m wbia.tag_funcs –exec-filterflags_general_tags:0 –has_none=n,o python -m wbia.tag_funcs –exec-filterflags_general_tags:1 python -m wbia.tag_funcs –exec-filterflags_general_tags:2
- Example0:
>>> # DISABLE_DOCTEST >>> from wbia.tag_funcs import * # NOQA >>> tags_list = [['v'], [], ['P'], ['P', 'o'], ['n', 'o',], [], ['n', 'N'], ['e', 'i', 'p', 'b', 'n'], ['q', 'v'], ['n'], ['n'], ['N']] >>> kwargs = ut.argparse_dict(ut.get_kwdefaults2(filterflags_general_tags), type_hint=list) >>> print('kwargs = %r' % (kwargs,)) >>> flags = filterflags_general_tags(tags_list, **kwargs) >>> print(flags) >>> result = ut.compress(tags_list, flags) >>> print('result = %r' % (result,))
- Example1:
>>> # ENABLE_DOCTEST >>> from wbia.tag_funcs import * # NOQA >>> tags_list = [['v'], [], ['P'], ['P'], ['n', 'o',], [], ['n', 'N'], ['e', 'i', 'p', 'b', 'n'], ['n'], ['n'], ['N']] >>> has_all = 'n' >>> min_num = 1 >>> flags = filterflags_general_tags(tags_list, has_all=has_all, min_num=min_num) >>> result = ut.compress(tags_list, flags) >>> print('result = %r' % (result,))
- Example2:
>>> # ENABLE_DOCTEST >>> from wbia.tag_funcs import * # NOQA >>> tags_list = [['vn'], ['vn', 'no'], ['P'], ['P'], ['n', 'o',], [], ['n', 'N'], ['e', 'i', 'p', 'b', 'n'], ['n'], ['n', 'nP'], ['NP']] >>> kwargs = { >>> 'any_endswith': 'n', >>> 'any_match': None, >>> 'any_startswith': 'n', >>> 'has_all': None, >>> 'has_any': None, >>> 'has_none': None, >>> 'max_num': 3, >>> 'min_num': 1, >>> 'none_match': ['P'], >>> } >>> flags = filterflags_general_tags(tags_list, **kwargs) >>> filtered = ut.compress(tags_list, flags) >>> result = ('result = %s' % (ut.repr2(filtered),)) result = [['vn', 'no'], ['n', 'o'], ['n', 'N'], ['n'], ['n', 'nP']]
Parameters: - ibs (IBEISController) – wbia controller object
- aid1_list (list) –
- aid2_list (list) –
- directed (bool) – (default = True)
Returns: tags_list
Return type: list
- CommandLine:
- python -m wbia.tag_funcs –exec-get_aidpair_tags –db PZ_Master1 –tags Hard interesting
Example
>>> # DISABLE_DOCTEST >>> from wbia.tag_funcs import * # NOQA >>> import wbia >>> ibs = wbia.opendb(defaultdb='testdb1') >>> has_any = ut.get_argval('--tags', type_=list, default=None) >>> min_num = ut.get_argval('--min_num', type_=int, default=1) >>> aid_pairs = filter_aidpairs_by_tags(ibs, has_any=has_any, min_num=1) >>> aid1_list = aid_pairs.T[0] >>> aid2_list = aid_pairs.T[1] >>> undirected_tags = get_aidpair_tags(ibs, aid1_list, aid2_list, directed=False) >>> tagged_pairs = list(zip(aid_pairs.tolist(), undirected_tags)) >>> print(ut.repr2(tagged_pairs)) >>> tag_dict = ut.groupby_tags(tagged_pairs, undirected_tags) >>> print(ut.repr2(tag_dict, nl=2)) >>> print(ut.repr2(ut.map_dict_vals(len, tag_dict)))
- CommandLine:
- python -m wbia.tag_funcs –exec-get_annot_all_tags –db GZ_Master1
Example
>>> # ENABLE_DOCTEST >>> from wbia.tag_funcs import * # NOQA >>> import wbia >>> ibs = wbia.opendb(defaultdb='testdb1') >>> aid_list = ibs.get_valid_aids() >>> all_tags = ut.flatten(ibs.get_annot_all_tags(aid_list)) >>> tag_hist = ut.dict_hist(all_tags) >>> ut.print_dict(tag_hist)
Parameters: - ibs (IBEISController) – wbia controller object
- aid_list (list) – list of annotation rowids
Returns: annotmatch_tags_list
Return type: list
- CommandLine:
- python -m wbia.tag_funcs –exec-get_annot_annotmatch_tags –db GZ_Master1
Example
>>> # ENABLE_DOCTEST >>> from wbia.tag_funcs import * # NOQA >>> import wbia >>> ibs = wbia.opendb(defaultdb='testdb1') >>> aid_list = ibs.get_valid_aids() >>> all_tags = ut.flatten(get_annot_annotmatch_tags(ibs, aid_list)) >>> tag_hist = ut.dict_hist(all_tags) >>> ut.print_dict(tag_hist)
returns list of tags. Use instead of get_annot_tag_text .. todo:: rename to get_annot_unary_tags
Parameters: - ibs (IBEISController) – wbia controller object
- aid_list (list) – list of annotation rowids
Returns: tags_list
Return type: list
- CommandLine:
- python -m wbia.tag_funcs –exec-get_annot_case_tags
Example
>>> # ENABLE_DOCTEST >>> from wbia.tag_funcs import * # NOQA >>> from wbia.tag_funcs import _parse_tags # NOQA >>> import wbia >>> ibs = wbia.opendb(defaultdb='testdb1') >>> aid_list = ibs.get_valid_aids() >>> tags_list = get_annot_case_tags(ibs, aid_list) >>> result = ('tags_list = %s' % (str(tags_list),)) >>> print(result)
- Ignore:
# FIXME incorrporate old tag notes aid_list = ibs.get_valid_aids() notes_list = ibs.get_annot_notes(aid_list) flags = [len(notes) > 0 for notes in notes_list] aid_list = ut.compress(aid_list, flags) notes_list = ut.compress(notes_list, flags)
import re notes_list = [note.replace(‘rfdetect’, ‘’) for note in notes_list] notes_list = [note.replace(‘<COMMA>’, ‘;’) for note in notes_list] notes_list = [note.replace(‘jpg’, ‘’) for note in notes_list] notes_list = [note.replace(‘<HARDCASE>’, ‘’) for note in notes_list] notes_list = [note.strip() for note in notes_list] notes_list = [re.sub(‘;;*’, ‘;’, note) for note in notes_list] notes_list = [note.strip(‘;’) for note in notes_list] notes_list = [note.strip(‘:’) for note in notes_list] notes_list = [note.strip() for note in notes_list]
flags = [len(notes) < 70 and len(notes) > 0 for notes in notes_list] aid_list = ut.compress(aid_list, flags) notes_list = ut.compress(notes_list, flags)
flags = [‘M;’ not in notes and ‘F;’ not in notes and ‘H1’ not in notes for notes in notes_list] flags = [ ‘M;’ not in notes and ‘F;’ not in notes and ‘H1’ not in notes for notes in notes_list] aid_list = ut.compress(aid_list, flags) notes_list = ut.compress(notes_list, flags)
flags = [‘aliases’ not in notes for notes in notes_list] aid_list = ut.compress(aid_list, flags) notes_list = ut.compress(notes_list, flags)
#flags = [not re.match(‘;d*;’, note) for note in notes_list] flags = [not re.match(r’dd*’, note) for note in notes_list] aid_list = ut.compress(aid_list, flags) notes_list = ut.compress(notes_list, flags)
flags = [not notes.startswith(‘Foal;’) for notes in notes_list] aid_list = ut.compress(aid_list, flags) notes_list = ut.compress(notes_list, flags)
old_tags_list = [_parse_tags(note) for note in notes_list]
old_tags = list(set(ut.flatten(old_tags_list))) old_tags = sorted([tag for tag in old_tags if not re.match(r’dd*’, tag)])
- old_to_new = {
- ‘gash’: None, ‘pose’: ‘novelpose’, ‘vocalizing’: ‘novelpose’ ‘occlusion’: ‘occlusion’,
}
- Ignore:
- python -m wbia.tag_funcs –exec-filter_annotmatch_by_tags –show –db PZ_Master1 –tags viewpoint
Parameters: - ibs (IBEISController) – wbia controller object
- annotmatch_rowids –
Returns: filtered_aid_list
Return type: list
- CommandLine:
- python -m wbia.tag_funcs –exec-get_annotmatch_case_tags
Example
>>> # DISABLE_DOCTEST >>> from wbia.tag_funcs import * # NOQA >>> import wbia >>> ibs = wbia.opendb(defaultdb='PZ_Master1') >>> annotmatch_rowids = ibs._get_all_annotmatch_rowids() >>> tags_list = get_annotmatch_case_tags(ibs, annotmatch_rowids) >>> result = ('tags_list = %s' % (str(tags_list),)) >>> print(result) tags_list = [[u'occlusion', u'pose', 'Hard', 'NonDistinct'], [], ['Hard']]
-
wbia.tag_funcs.
get_annotmatch_prop
(ibs, prop, annotmatch_rowids)[source]¶ hacky getter for dynamic properties of annotmatches using notes table
Parameters: - prop (str) –
- annotmatch_rowids –
Returns: filtered_aid_list
Return type: list
- CommandLine:
- python -m wbia.tag_funcs –exec-get_annotmatch_prop
Example
>>> # DISABLE_DOCTEST >>> # Test setting and getting standard keys >>> from wbia.tag_funcs import * # NOQA >>> import wbia >>> ibs = wbia.opendb(defaultdb='testdb1') >>> prop = 'hard' >>> annotmatch_rowids = ibs._get_all_annotmatch_rowids() >>> flag_list = get_annotmatch_prop(ibs, prop, annotmatch_rowids) >>> flag_list = ('filtered_aid_list = %s' % (str(flag_list),)) >>> subset_rowids = annotmatch_rowids[::2] >>> set_annotmatch_prop(ibs, prop, subset_rowids, [True] * len(subset_rowids)) >>> flag_list2 = get_annotmatch_prop(ibs, prop, annotmatch_rowids) >>> print('flag_list2 = %r' % (flag_list2,))
Example
>>> # DISABLE_DOCTEST >>> # Test setting and getting non-standard keys >>> from wbia.tag_funcs import * # NOQA >>> import wbia >>> ibs = wbia.opendb(defaultdb='testdb1') >>> prop = 'occlusion' >>> annotmatch_rowids = ibs._get_all_annotmatch_rowids() >>> flag_list = get_annotmatch_prop(ibs, prop, annotmatch_rowids) >>> flag_list = ('filtered_aid_list = %s' % (str(flag_list),)) >>> subset_rowids = annotmatch_rowids[1::2] >>> subset_rowids1 = annotmatch_rowids[::2] >>> set_annotmatch_prop(ibs, prop, subset_rowids1, [True] * len(subset_rowids)) >>> set_annotmatch_prop(ibs, 'pose', subset_rowids1, [True] * len(subset_rowids)) >>> flag_list2 = get_annotmatch_prop(ibs, prop, annotmatch_rowids) >>> print('flag_list2 = %r' % (flag_list2,))
Completely replaces annotation tags. BE VERY CAREFUL WITH THIS FUNCTION
Script to update tags to newest values
- CommandLine:
- python -m wbia.tag_funcs –exec-rename_and_reduce_tags –db PZ_Master1
- Ignore:
>>> from wbia.tag_funcs import * # NOQA >>> import wbia >>> #ibs = wbia.opendb(defaultdb='PZ_Master1') >>> ibs = wbia.opendb(defaultdb='testdb1') >>> annotmatch_rowids = filter_annotmatch_by_tags(ibs, min_num=1) >>> rename_and_reduce_tags(ibs, annotmatch_rowids)
Completely overwrite case tags
-
wbia.tag_funcs.
set_annot_prop
(ibs, prop, aid_list, flags)[source]¶ sets nonstandard properties using the notes column
-
wbia.tag_funcs.
set_annotmatch_other_prop
(ibs, prop, annotmatch_rowids, flags)[source]¶ sets nonstandard properties using the notes column
Module contents¶
IBEIS: main package init
- TODO: LAZY IMPORTS?
- http://code.activestate.com/recipes/473888-lazy-module-imports/
-
wbia.
import_subs
()[source]
-
wbia.
reload_subs
(verbose=True)[source] Reloads wbia and submodules
-
wbia.
rrrr
(verbose=True) Reloads wbia and submodules
-
wbia.
run_experiment
(e='print', db='PZ_MTEST', dbdir=None, a=['unctrl'], t=['default'], initial_aids=None, qaid_override=None, daid_override=None, lazy=False, **kwargs)[source] Convience function
- CommandLine:
- wbia -e print
Parameters: - e (str) – (default = ‘print’)
- db (str) – (default = ‘PZ_MTEST’)
- a (list) – (default = [‘unctrl’])
- t (list) – (default = [‘default’])
- qaid_override (None) – (default = None)
- lazy (bool) – (default = False)
Returns: func - live python function
Return type: function
- CommandLine:
- python -m wbia.__init__ –exec-run_experiment –show
Example
>>> # DISABLE_DOCTEST >>> from wbia import * # NOQA >>> e = 'rank_cmc' >>> db = 'testdb1' >>> a = ['default:species=primary'] >>> t = ['default'] >>> initial_aids = [2, 3, 4, 7, 9, 10, 11] >>> qaid_override = [1, 9, 10, 11, 2, 3] >>> testres = run_experiment(e, db, a, t, qaid_override=qaid_override, >>> initial_aids=initial_aids) >>> result = ('testres = %s' % (str(testres),)) >>> print(result) >>> ut.quit_if_noshow() >>> testres.draw_func() >>> ut.show_if_requested()