ibeis.algo package

Subpackages

Submodules

ibeis.algo.Config module

DEPRICATE FOR CORE ANNOT AND CORE IMAGE DEFS

class ibeis.algo.Config.AggregateConfig(agg_cfg, **kwargs)[source]

Bases: utool.Preferences.Pref

Old Agg Cfg

__hash__(cfg)

Needed for comparison operators

get_cfgstr(cfg, **kwargs)
get_cfgstr_list(agg_cfg, **kwargs)[source]
get_config_name(cfg, **kwargs)

the user might want to overwrite this function

initialize_params(cfg)

Initializes config class attributes based on params info list

meta_get_cfgstr_list(cfg, ignore_keys=None, **kwargs)

default get_cfgstr_list, can be overrided by a config object

parse_items(cfg, **kwargs)
class ibeis.algo.Config.ChipConfig(cc_cfg, **kwargs)[source]

Bases: utool.Preferences.Pref

__hash__(cfg)

Needed for comparison operators

get_cfgstr(cfg, **kwargs)
get_cfgstr_list(cfg, ignore_keys=None, **kwargs)

default get_cfgstr_list, can be overrided by a config object

get_config_name(cfg, **kwargs)

the user might want to overwrite this function

get_param_info_list()[source]
initialize_params(cfg)

Initializes config class attributes based on params info list

parse_items(cfg, **kwargs)
class ibeis.algo.Config.ConfigMetaclass

Bases: type

Defines extra methods for Configs

class ibeis.algo.Config.DetectionConfig(detect_cfg, **kwargs)[source]

Bases: utool.Preferences.Pref

CommandLine:

python -m ibeis.algo.Config --test-DetectionConfig

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.algo.Config import *  # NOQA
>>> detect_cfg = DetectionConfig()
>>> result = (detect_cfg.get_cfgstr())
>>> print(result)
_DETECT(cnn,____,sz=800)
__hash__(cfg)

Needed for comparison operators

get_cfgstr(cfg, **kwargs)
get_cfgstr_list(detect_cfg)[source]
get_config_name(cfg, **kwargs)

the user might want to overwrite this function

initialize_params(cfg)

Initializes config class attributes based on params info list

meta_get_cfgstr_list(cfg, ignore_keys=None, **kwargs)

default get_cfgstr_list, can be overrided by a config object

parse_items(cfg, **kwargs)
class ibeis.algo.Config.DisplayConfig(display_cfg, **kwargs)[source]

Bases: utool.Preferences.Pref

__hash__(cfg)

Needed for comparison operators

get_cfgstr(cfg, **kwargs)
get_cfgstr_list(nn_cfg)[source]
get_config_name(cfg, **kwargs)

the user might want to overwrite this function

initialize_params(cfg)

Initializes config class attributes based on params info list

meta_get_cfgstr_list(cfg, ignore_keys=None, **kwargs)

default get_cfgstr_list, can be overrided by a config object

parse_items(cfg, **kwargs)
class ibeis.algo.Config.FeatureConfig(feat_cfg, **kwargs)[source]

Bases: utool.Preferences.Pref

Feature configuration object.

TODO depcirate for core_annots.FeatConfig

CommandLine:

python -m ibeis.algo.Config --test-FeatureConfig

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.algo import Config  # NOQA
>>> from ibeis.algo.Config import *  # NOQA
>>> feat_cfg = Config.FeatureConfig()
>>> result = (feat_cfg.get_cfgstr())
>>> print(result)
>>> #assert result.startswith('_FEAT(hesaff+sift_)_CHIP')
_Feat(hesaff+sift)
__hash__(cfg)

Needed for comparison operators

get_cfgstr(cfg, **kwargs)
get_cfgstr_list(cfg, ignore_keys=None, **kwargs)

default get_cfgstr_list, can be overrided by a config object

get_config_name()[source]
get_hesaff_params(feat_cfg)[source]
get_param_info_list()[source]
initialize_params(cfg)

Initializes config class attributes based on params info list

meta_get_config_name(cfg, **kwargs)

the user might want to overwrite this function

parse_items(cfg, **kwargs)
class ibeis.algo.Config.FeatureWeightConfig(featweight_cfg, **kwargs)[source]

Bases: utool.Preferences.Pref

CommandLine:

python -m ibeis.algo.Config --exec-FeatureWeightConfig

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.algo.Config import *  # NOQA
>>> featweight_cfg = FeatureWeightConfig(fw_detector='rf',
>>>                                      featweight_enabled=True)
>>> result = featweight_cfg.get_cfgstr()
>>> print(result)

_FEATWEIGHT(ON,uselabel,rf)_FEAT(hesaff+sift_)_CHIP(sz450)

_FEATWEIGHT(OFF)_FEAT(hesaff+sift_)_CHIP(sz450)

__hash__(cfg)

Needed for comparison operators

get_cfgstr(cfg, **kwargs)
get_cfgstr_list(cfg, ignore_keys=None, **kwargs)

default get_cfgstr_list, can be overrided by a config object

get_config_name(cfg, **kwargs)

the user might want to overwrite this function

get_param_info_list()[source]
initialize_params(cfg)

Initializes config class attributes based on params info list

make_feasible(featweight_cfg)[source]
parse_items(cfg, **kwargs)
class ibeis.algo.Config.FlannConfig(flann_cfg, **kwargs)[source]

Bases: utool.Preferences.Pref

this flann is only for neareset neighbors in vsone/many TODO: this might not need to be here, should be part of neighbor config

References

http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann_pami2014.pdf http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann_manual-1.8.4.pdf http://docs.opencv.org/trunk/modules/flann/doc/flann_fast_approximate_nearest_neighbor_search.html

__hash__(cfg)

Needed for comparison operators

get_cfgstr(cfg, **kwargs)
get_cfgstr_list(flann_cfg, **kwargs)[source]
get_config_name(cfg, **kwargs)

the user might want to overwrite this function

get_flann_params(flann_cfg)[source]
initialize_params(cfg)

Initializes config class attributes based on params info list

meta_get_cfgstr_list(cfg, ignore_keys=None, **kwargs)

default get_cfgstr_list, can be overrided by a config object

parse_items(cfg, **kwargs)
class ibeis.algo.Config.GenericConfig(cfg, *args, **kwargs)[source]

Bases: utool.Preferences.Pref

__hash__(cfg)

Needed for comparison operators

get_cfgstr(cfg, **kwargs)
get_cfgstr_list(cfg, ignore_keys=None, **kwargs)

default get_cfgstr_list, can be overrided by a config object

get_config_name(cfg, **kwargs)

the user might want to overwrite this function

initialize_params(cfg)

Initializes config class attributes based on params info list

parse_items(cfg, **kwargs)
class ibeis.algo.Config.NNConfig(nn_cfg, **kwargs)[source]

Bases: utool.Preferences.Pref

CommandLine:

python -m ibeis.algo.Config --exec-NNConfig

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.algo.Config import *  # NOQA
>>> nn_cfg = NNConfig()
>>> nn_cfg = NNConfig(single_name_condition=True)
>>> result = nn_cfg.get_cfgstr()
>>> print(result)
_NN(single,K=4,Kn=1,padk=False,cks800)
__hash__(cfg)

Needed for comparison operators

get_cfgstr(cfg, **kwargs)
get_cfgstr_list(cfg, ignore_keys=None, **kwargs)

default get_cfgstr_list, can be overrided by a config object

get_config_name(cfg, **kwargs)

the user might want to overwrite this function

get_param_info_list(rrvsone_cfg)[source]
initialize_params(cfg)

Initializes config class attributes based on params info list

make_feasible(nn_cfg)[source]
parse_items(cfg, **kwargs)
class ibeis.algo.Config.NNWeightConfig(nnweight_cfg, **kwargs)[source]

Bases: utool.Preferences.Pref

CommandLine:

python -m ibeis.algo.Config --test-NNWeightConfig

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.algo.Config import *  # NOQA
>>> cfg_list = [
...     NNWeightConfig(),
...     NNWeightConfig(can_match_sameimg=True, can_match_samename=False),
...     NNWeightConfig(ratio_thresh=.625, lnbnn_on=False),
...     NNWeightConfig(ratio_thresh=.625, lnbnn_normer='foobarstr'),
... ]
>>> result = '\n'.join([cfg.get_cfgstr() for cfg in cfg_list])
>>> print(result)
_NNWeight(lnbnn,fg,last,nosqrd_dist)
_NNWeight(lnbnn,fg,last,sameimg,nosamename,nosqrd_dist)
_NNWeight(ratio_thresh=0.625,fg,last,nosqrd_dist)
_NNWeight(ratio_thresh=0.625,lnbnn,fg,last,lnbnn_normer=foobarstr,lnbnn_norm_thresh=0.5,nosqrd_dist)
__hash__(cfg)

Needed for comparison operators

get_cfgstr(cfg, **kwargs)
get_cfgstr_list(cfg, ignore_keys=None, **kwargs)

default get_cfgstr_list, can be overrided by a config object

get_config_name(cfg, **kwargs)

the user might want to overwrite this function

get_param_info_list(nnweight_cfg)[source]
initialize_params(cfg)

Initializes config class attributes based on params info list

parse_items(cfg, **kwargs)
class ibeis.algo.Config.OccurrenceConfig(occur_cfg, **kwargs)[source]

Bases: utool.Preferences.Pref

CommandLine:

python -m ibeis.algo.Config --exec-OccurrenceConfig --show

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.algo.Config import *  # NOQA
>>> occur_cfg = OccurrenceConfig()
>>> print(occur_cfg.get_cfgstr())
__hash__(cfg)

Needed for comparison operators

get_cfgstr(cfg, **kwargs)
get_cfgstr_list(cfg, ignore_keys=None, **kwargs)

default get_cfgstr_list, can be overrided by a config object

get_config_name(cfg, **kwargs)

the user might want to overwrite this function

get_param_info_list(occur_cfg)[source]
initialize_params(cfg)

Initializes config class attributes based on params info list

parse_items(cfg, **kwargs)
class ibeis.algo.Config.OtherConfig(other_cfg, **kwargs)[source]

Bases: utool.Preferences.Pref

__hash__(cfg)

Needed for comparison operators

get_cfgstr(cfg, **kwargs)
get_cfgstr_list(cfg, ignore_keys=None, **kwargs)

default get_cfgstr_list, can be overrided by a config object

get_config_name(cfg, **kwargs)

the user might want to overwrite this function

initialize_params(cfg)

Initializes config class attributes based on params info list

parse_items(cfg, **kwargs)
class ibeis.algo.Config.QueryConfig(query_cfg, **kwargs)[source]

Bases: utool.Preferences.Pref

query configuration parameters

Example

>>> # ENABLE_DOCTEST
>>> import ibeis
>>> ibs = ibeis.opendb('testdb1')
>>> cfg = ibs.cfg.query_cfg
>>> cfgstr = ibs.cfg.query_cfg.get_cfgstr()
>>> print(cfgstr)
__hash__(cfg)

Needed for comparison operators

apply_codename(query_cfg, codename=None)[source]

codenames denote mass changes to configurations it is a hacky solution to setting different parameter values all at once.

deepcopy(query_cfg, **kwargs)[source]
get_cfgstr(cfg, **kwargs)
get_cfgstr_list(query_cfg, **kwargs)[source]
get_config_name(cfg, **kwargs)

the user might want to overwrite this function

initialize_params(cfg)

Initializes config class attributes based on params info list

make_feasible(query_cfg)[source]
make_feasible_(query_cfg)[source]

removes invalid parameter settings over all cfgs (move to QueryConfig)

meta_get_cfgstr_list(cfg, ignore_keys=None, **kwargs)

default get_cfgstr_list, can be overrided by a config object

parse_items(cfg, **kwargs)
update_query_cfg(query_cfg, **cfgdict)[source]
class ibeis.algo.Config.RerankVsOneConfig(rrvsone_cfg, **kwargs)[source]

Bases: utool.Preferences.Pref

CommandLine:

python -m ibeis.algo.Config --test-RerankVsOneConfig
Example0:
>>> # ENABLE_DOCTEST
>>> from ibeis.algo.Config import *  # NOQA
>>> rrvsone_cfg = RerankVsOneConfig(rrvsone_on=True)
>>> result = rrvsone_cfg.get_cfgstr()
>>> assert result.startswith('_RRVsOne(True,')
Example1:
>>> # ENABLE_DOCTEST
>>> from ibeis.algo.Config import *  # NOQA
>>> rrvsone_cfg = RerankVsOneConfig(rrvsone_on=True)
>>> result = rrvsone_cfg.get_cfgstr()
>>> print(result)
_RRVsOne(True,nNm=20,nApN=3,prior_coeff=0.6,unc_coeff=0.4,sver_unc=True,uncRat=0.8)
__hash__(cfg)

Needed for comparison operators

get_cfgstr(cfg, **kwargs)
get_cfgstr_list(rrvsone_cfg, **kwargs)[source]
get_config_name(rrvsone_cfg)[source]
get_constraint_func()[source]
get_param_info_list(rrvsone_cfg)[source]
initialize_params(cfg)

Initializes config class attributes based on params info list

meta_get_cfgstr_list(cfg, ignore_keys=None, **kwargs)

default get_cfgstr_list, can be overrided by a config object

meta_get_config_name(cfg, **kwargs)

the user might want to overwrite this function

parse_items(cfg, **kwargs)
class ibeis.algo.Config.SMKConfig(smk_cfg, **kwargs)[source]

Bases: utool.Preferences.Pref

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.algo.Config import *  # NOQA
>>> smk_cfg = SMKConfig()
>>> result1 = smk_cfg.get_cfgstr()
>>> print(result1)
Example2:
>>> # ENABLE_DOCTEST
>>> import ibeis
>>> ibs = ibeis.opendb('testdb1')
>>> smk_cfg = ibs.cfg.query_cfg.smk_cfg
>>> smk_cfg.printme3()
__hash__(cfg)

Needed for comparison operators

get_cfgstr(cfg, **kwargs)
get_cfgstr_list(smk_cfg, **kwargs)[source]
get_config_name(cfg, **kwargs)

the user might want to overwrite this function

initialize_params(cfg)

Initializes config class attributes based on params info list

make_feasible(smk_cfg)[source]
meta_get_cfgstr_list(cfg, ignore_keys=None, **kwargs)

default get_cfgstr_list, can be overrided by a config object

parse_items(cfg, **kwargs)
class ibeis.algo.Config.SpatialVerifyConfig(sv_cfg, **kwargs)[source]

Bases: utool.Preferences.Pref

Spatial verification

__hash__(cfg)

Needed for comparison operators

get_cfgstr(cfg, **kwargs)
get_cfgstr_list(sv_cfg, **kwargs)[source]
get_config_name(cfg, **kwargs)

the user might want to overwrite this function

initialize_params(cfg)

Initializes config class attributes based on params info list

meta_get_cfgstr_list(cfg, ignore_keys=None, **kwargs)

default get_cfgstr_list, can be overrided by a config object

parse_items(cfg, **kwargs)
class ibeis.algo.Config.VocabAssignConfig(vocabassign_cfg, **kwargs)[source]

Bases: utool.Preferences.Pref

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.algo.Config import *  # NOQA
>>> vocabassign_cfg = VocabAssignConfig()
>>> result = vocabassign_cfg.get_cfgstr()
>>> print(result)
__hash__(cfg)

Needed for comparison operators

get_cfgstr(cfg, **kwargs)
get_cfgstr_list(vocabassign_cfg, **kwargs)[source]
get_config_name(cfg, **kwargs)

the user might want to overwrite this function

initialize_params(cfg)

Initializes config class attributes based on params info list

make_feasible(vocabassign_cfg)[source]
meta_get_cfgstr_list(cfg, ignore_keys=None, **kwargs)

default get_cfgstr_list, can be overrided by a config object

parse_items(cfg, **kwargs)
class ibeis.algo.Config.VocabTrainConfig(vocabtrain_cfg, **kwargs)[source]

Bases: utool.Preferences.Pref

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.algo.Config import *  # NOQA
>>> vocabtrain_cfg = VocabTrainConfig()
>>> result = vocabtrain_cfg.get_cfgstr()
>>> print(result)
__hash__(cfg)

Needed for comparison operators

get_cfgstr(cfg, **kwargs)
get_cfgstr_list(vocabtrain_cfg, **kwargs)[source]
get_config_name(cfg, **kwargs)

the user might want to overwrite this function

initialize_params(cfg)

Initializes config class attributes based on params info list

meta_get_cfgstr_list(cfg, ignore_keys=None, **kwargs)

default get_cfgstr_list, can be overrided by a config object

parse_items(cfg, **kwargs)
ibeis.algo.Config.default_vsone_cfg(ibs, **kwargs)[source]
ibeis.algo.Config.load_named_config(cfgname, dpath, use_config_cache=False, verbose=False)[source]

hack 12-30-2014

Parameters:
  • cfgname (str) –
  • dpath (str) –
  • use_config_cache (bool) –
Returns:

cfg

Return type:

Config

CommandLine:

python -m ibeis.algo.Config --test-load_named_config

Example

>>> # DISABLE_DOCTEST
>>> from ibeis.algo.Config import *  # NOQA
>>> from ibeis.algo.Config import _default_config  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb('PZ_Master0')
>>> #ibs.cfg.save()
>>> # build test data
>>> cfgname = 'zebra_plains'
>>> dpath = ibs.get_dbdir()
>>> use_config_cache = True
>>> # execute function
>>> cfg = load_named_config(cfgname, dpath, use_config_cache)
>>> #
>>> keys1 = ut.get_list_column(cfg.parse_items(), 0)
>>> keys2 = ut.get_list_column(ibs.cfg.parse_items(), 0)
>>> symdiff = set(keys1) ^ set(keys2)
>>> # verify results
>>> result = str(cfg)
>>> print(result)
ibeis.algo.Config.make_config_metaclass()[source]

Creates a metaclass for Config objects that automates some of the more tedious functions to write

Like:
get_cfgstr and the comparison methods

Example

from ibeis.algo.Config import * # NOQA @six.add_metaclass(ConfigMetaclass) class FooConfig(ConfigBase):

def __init__(cfg):
super(FooConfig, cfg).__init__(name=’FooConfig’) cfg.initialize_params()
def get_param_info_list(cfg):
return [
ut.ParamInfo(‘x’, ‘y’), ut.ParamInfo(‘z’, 3),

]

cfg = FooConfig() print(cfg.get_cfgstr(ignore_keys=[‘x’])) print(cfg.get_cfgstr(ignore_keys=[]))

cfg = GenericConfig() cfg.x = ‘y’

ibeis.algo.Config.parse_config_items(cfg)[source]

Recursively extracts key, val pairs from Config objects into a flat list. (there must not be name conflicts)

Example

>>> # ENABLE_DOCTEST
>>> from ibeis.algo.Config import *  # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb('testdb1')
>>> cfg = ibs.cfg.query_cfg
>>> param_list = parse_config_items(cfg)
ibeis.algo.Config.set_query_cfg(cfg, query_cfg)[source]

hack 12-30-2014

ibeis.algo.Config.update_query_config(cfg, **kwargs)[source]

hack 12-30-2014

Module contents

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

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

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

Reloads ibeis.algo and submodules

ibeis.algo.rrrr(verbose=True)

Reloads ibeis.algo and submodules