ibeis.control package¶
Submodules¶
ibeis.control.DB_SCHEMA module¶
Module Licence and docstring
TODO: ideally the ibeis.constants module would not be used here and each function would use its own constant variables that are suffixed with the last version number that they existed in
- TODO:
- Add a table for original_image_path Add column for image exif orientation
CommandLine:
python -m ibeis.control.DB_SCHEMA --test-autogen_db_schema
-
ibeis.control.DB_SCHEMA.
VALID_VERSIONS
= OrderedDict([(u'0.0.0', (None, None, None)), ('1.0.0', (None, <function update_1_0_0 at 0x2ac986326ed8>, <function post_1_0_0 at 0x2ac986326f50>)), ('1.0.1', (None, <function update_1_0_1 at 0x2ac986358230>, None)), ('1.0.2', (None, <function update_1_0_2 at 0x2ac9863582a8>, None)), ('1.1.0', (None, <function update_1_1_0 at 0x2ac986358320>, None)), ('1.1.1', (None, <function update_1_1_1 at 0x2ac986358398>, None)), ('1.2.0', (None, <function update_1_2_0 at 0x2ac986358410>, <function post_1_2_0 at 0x2ac986358050>)), ('1.2.1', (None, <function update_1_2_1 at 0x2ac986358488>, <function post_1_2_1 at 0x2ac9863580c8>)), ('1.3.0', (None, <function update_1_3_0 at 0x2ac986358500>, None)), ('1.3.1', (<function pre_1_3_1 at 0x2ac9863581b8>, <function update_1_3_1 at 0x2ac986358578>, None)), ('1.3.2', (None, <function update_1_3_2 at 0x2ac9863585f0>, None)), ('1.3.3', (None, <function update_1_3_3 at 0x2ac986358668>, None)), ('1.3.4', (None, <function update_1_3_4 at 0x2ac9863586e0>, <function post_1_3_4 at 0x2ac986358140>)), ('1.3.5', (None, <function update_1_3_5 at 0x2ac986358758>, None)), ('1.3.6', (None, <function update_1_3_6 at 0x2ac9863587d0>, None)), ('1.3.7', (None, <function update_1_3_7 at 0x2ac986358848>, None)), ('1.3.8', (None, <function update_1_3_8 at 0x2ac9863588c0>, None)), ('1.3.9', (None, <function update_1_3_9 at 0x2ac986358938>, None)), ('1.4.0', (None, <function update_1_4_0 at 0x2ac9863589b0>, None)), ('1.4.1', (None, <function update_1_4_1 at 0x2ac986358a28>, None)), ('1.4.2', (None, <function update_1_4_2 at 0x2ac986358aa0>, None)), ('1.4.3', (None, <function update_1_4_3 at 0x2ac986358b18>, None)), ('1.4.4', (None, <function update_1_4_4 at 0x2ac986358b90>, None)), ('1.4.5', (None, <function update_1_4_5 at 0x2ac986358c08>, None)), ('1.4.6', (None, <function update_1_4_6 at 0x2ac986358c80>, None)), ('1.4.7', (None, <function update_1_4_7 at 0x2ac986358cf8>, <function post_1_4_7 at 0x2ac986358d70>)), ('1.4.8', (<function pre_1_4_8 at 0x2ac986358de8>, <function update_1_4_8 at 0x2ac986358e60>, None)), ('1.4.9', (<function pre_1_4_9 at 0x2ac986358ed8>, <function update_1_4_9 at 0x2ac986358f50>, <function post_1_4_9 at 0x2ac986359050>)), ('1.5.0', (None, <function update_1_5_0 at 0x2ac9863590c8>, None)), ('1.5.1', (None, <function update_1_5_1 at 0x2ac986359140>, None)), ('1.5.2', (None, <function update_1_5_2 at 0x2ac9863591b8>, <function post_1_5_2 at 0x2ac986359230>))])¶ SeeAlso – When updating versions need to test and modify in IBEISController._init_sqldbcore
-
ibeis.control.DB_SCHEMA.
autogen_db_schema
()[source]¶ CommandLine:
python -m ibeis.control.DB_SCHEMA --test-autogen_db_schema python -m ibeis.control.DB_SCHEMA --test-autogen_db_schema --diff=1 python -m ibeis.control.DB_SCHEMA --test-autogen_db_schema -n=-1 python -m ibeis.control.DB_SCHEMA --test-autogen_db_schema -n=0 python -m ibeis.control.DB_SCHEMA --test-autogen_db_schema -n=1 python -m ibeis.control.DB_SCHEMA --force-incremental-db-update python -m ibeis.control.DB_SCHEMA --test-autogen_db_schema --write python -m ibeis.control.DB_SCHEMA --test-autogen_db_schema --force-incremental-db-update --dump-autogen-schema python -m ibeis.control.DB_SCHEMA --test-autogen_db_schema --force-incremental-db-update
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.DB_SCHEMA import * # NOQA >>> autogen_db_schema()
-
ibeis.control.DB_SCHEMA.
pre_1_3_1
(db, ibs=None)[source]¶ need to ensure that visual uuid columns are unique before we add that constaint to sql. This will remove any annotations that are not unique
-
ibeis.control.DB_SCHEMA.
update_1_3_1
(db, ibs=None)[source]¶ update the visual_uuid to be a superkey by adding a constraint
-
ibeis.control.DB_SCHEMA.
update_1_3_5
(db, ibs=None)[source]¶ expand datasets to use new quality measures
-
ibeis.control.DB_SCHEMA.
update_1_4_8
(db, ibs=None)[source]¶ change notes to tag_text_data add configuration that made the match add the score of the match add concept of: DEFINIATELY MATCHES, DOES NOT MATCH, CAN NOT DECIDE
Probably want a separate table for the config_rowid matching results because the primary key needs to be (config_rowid, aid1, aid2) OR just (config_rowid, annotmatch_rowid)
ibeis.control.DB_SCHEMA_CURRENT module¶
AUTOGENERATED ON 12:05:54 2016/03/15 AutogenCommandLine:
python -m ibeis.control.DB_SCHEMA –test-autogen_db_schema –force-incremental-db-update –write python -m ibeis.control.DB_SCHEMA –test-autogen_db_schema –force-incremental-db-update –diff=1 python -m ibeis.control.DB_SCHEMA –test-autogen_db_schema –force-incremental-db-update
ibeis.control.IBEISControl module¶
This module contains the definition of IBEISController. This object allows access to a single database. Construction of this object should be done using ibeis.opendb().
- TODO:
Module Licence and docstring
- load plugin logic:
- known plugin list - plugin_register.txt / dirs/symlinks in plugin folder
- disabled flags
- try import && register
- except flag errored
- init db
- check versioning / update
- (determine plugin import ordering?)
- inject and initialize plugins
Note
- There are functions that are injected into the controller that are not
- defined in this module.
- Functions in the IBEISController have been split up into several
- submodules.
- look at the modules listed in autogenmodname_list to see the full list of
- functions that will be injected into an IBEISController object
- Recently, these functions have been enumerated in
- ibeis.control._autogen_explicit_controller.py, and explicitly added to the
controller using subclassing. This submodule only provides function headers, the source code still
resides in the injected modules.
-
class
ibeis.control.IBEISControl.
IBEISController
(ibs, dbdir=None, ensure=True, wbaddr=None, verbose=True, request_dbversion=None, force_serial=None)[source]¶ Bases:
object
IBEISController docstring
- NameingConventions:
- chip - cropped region of interest in an image, maps to one animal cid - chip unique id gid - image unique id (could just be the relative file path) name - name unique id imgsetid - imageset unique id aid - region of interest unique id annot - an annotation i.e. region of interest for a chip theta - angle of rotation for a chip
-
get_big_cachedir
(ibs)[source]¶ Returns: bigcachedir – database directory where aggregate results are stored Return type: str
-
get_current_log_text
(ibs)[source]¶ CommandLine:
python -m ibeis.control.IBEISControl --exec-get_current_log_text python -m ibeis.control.IBEISControl --exec-get_current_log_text --domain http://52.33.105.88
Example
>>> # WEB_DOCTEST >>> from ibeis.control.IBEISControl import * # NOQA >>> import ibeis >>> import ibeis.web >>> web_ibs = ibeis.opendb_bg_web('testdb1', wait=.5, start_job_queue=False) >>> resp = web_ibs.send_ibeis_request('/log/current/', 'get') >>> print('\n-------Logs ----: \n' ) >>> print(resp) >>> print('\nL____ END LOGS ___\n') >>> web_ibs.terminate2()
-
get_database_icon
(ibs, max_dsize=(None, 192), aid=None)[source]¶ Parameters: max_dsize (tuple) – (default = (None, 192)) Returns: None Return type: None CommandLine:
python -m ibeis.control.IBEISControl --exec-get_database_icon --show python -m ibeis.control.IBEISControl --exec-get_database_icon --show --db Oxford
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.IBEISControl import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> icon = ibs.get_database_icon() >>> ut.quit_if_noshow() >>> import plottool as pt >>> pt.imshow(icon) >>> ut.show_if_requested()
-
get_db_cache_path
(ibs)[source]¶ Returns: path – path of the sqlite3 cache database file Return type: str
-
get_db_core_path
(ibs)[source]¶ Returns: path – path of the sqlite3 core database file Return type: str
-
get_dbname
(ibs)[source]¶ Returns: list_ – database name Return type: list - RESTful:
- Method: GET URL: /api/core/dbname/
-
get_detectimg_cachedir
(ibs)[source]¶ Returns: detectimgdir – database directory of image resized for detections Return type: str
-
get_flann_cachedir
(ibs)[source]¶ Returns: flanndir – database directory where the FLANN KD-Tree is stored Return type: str
-
get_global_distinctiveness_modeldir
(ibs, ensure=True)[source]¶ Returns: global_distinctdir – ibs internal directory Return type: str
-
get_global_species_scorenorm_cachedir
(ibs, species_text, ensure=True)[source]¶ Parameters: - species_text (str) –
- ensure (bool) –
Returns: species_cachedir
Return type: str
CommandLine:
python -m ibeis.control.IBEISControl --test-get_global_species_scorenorm_cachedir
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.IBEISControl import * # NOQA >>> import ibeis # NOQA >>> ibs = ibeis.opendb('testdb1') >>> species_text = ibeis.const.TEST_SPECIES.ZEB_GREVY >>> ensure = True >>> species_cachedir = ibs.get_global_species_scorenorm_cachedir(species_text, ensure) >>> resourcedir = ibs.get_ibeis_resource_dir() >>> result = ut.relpath_unix(species_cachedir, resourcedir) >>> print(result) scorenorm/zebra_grevys
-
get_ibeis_resource_dir
(ibs)[source]¶ returns the global resource dir in .config or AppData or whatever
-
get_local_distinctiveness_modeldir
(ibs)[source]¶ Returns: distinctdir – ibs internal directory Return type: str
-
get_qres_cachedir
(ibs)[source]¶ Returns: qresdir – database directory where query results are stored Return type: str
-
get_smart_patrol_dir
(ibs, ensure=True)[source]¶ Parameters: ensure (bool) – Returns: str smart_patrol_dpath CommandLine:
python -m ibeis.control.IBEISControl --test-get_smart_patrol_dir
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.IBEISControl import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> ensure = True >>> # execute function >>> smart_patrol_dpath = ibs.get_smart_patrol_dir(ensure) >>> # verify results >>> ut.assertpath(smart_patrol_dpath, verbose=True)
-
get_thumbdir
(ibs)[source]¶ Returns: list_ – database directory where thumbnails are cached Return type: list
-
rrr
(verbose=True)¶ special class reloading function
-
show_depc_annot_graph
(ibs, *args, **kwargs)[source]¶ CommandLine:
python -m ibeis.control.IBEISControl --test-show_depc_annot_graph --show python -m ibeis.control.IBEISControl --test-show_depc_annot_graph --show --reduced
Example
>>> # SCRIPT >>> from ibeis.control.IBEISControl import * # NOQA >>> import ibeis # NOQA >>> ibs = ibeis.opendb('testdb1') >>> reduced = ut.get_argflag('--reduced') >>> ibs.show_depc_annot_graph(reduced=reduced) >>> ut.show_if_requested()
-
show_depc_annot_table_input
(ibs, tablename, *args, **kwargs)[source]¶ CommandLine:
python -m ibeis.control.IBEISControl --test-show_depc_annot_table_input --show --tablename=vsone python -m ibeis.control.IBEISControl --test-show_depc_annot_table_input --show --tablename=neighbor_index python -m ibeis.control.IBEISControl --test-show_depc_annot_table_input --show --tablename=feat_neighbs --testmode
Example
>>> # SCRIPT >>> from ibeis.control.IBEISControl import * # NOQA >>> import ibeis # NOQA >>> ibs = ibeis.opendb('testdb1') >>> tablename = ut.get_argval('--tablename') >>> ibs.show_depc_annot_table_input(tablename) >>> ut.show_if_requested()
-
show_depc_image_graph
(ibs, **kwargs)[source]¶ CommandLine:
python -m ibeis.control.IBEISControl --test-show_depc_image_graph --show python -m ibeis.control.IBEISControl --test-show_depc_image_graph --show --reduced
Example
>>> # SCRIPT >>> from ibeis.control.IBEISControl import * # NOQA >>> import ibeis # NOQA >>> ibs = ibeis.opendb('testdb1') >>> reduced = ut.get_argflag('--reduced') >>> ibs.show_depc_image_graph(reduced=reduced) >>> ut.show_if_requested()
-
ibeis.control.IBEISControl.
request_IBEISController
(dbdir=None, ensure=True, wbaddr=None, verbose=False, use_cache=True, request_dbversion=None, asproxy=None)[source]¶ Alternative to directory instantiating a new controller object. Might return a memory cached object
Parameters: - dbdir (str) – databse directory
- ensure (bool) –
- wbaddr (None) –
- verbose (bool) –
- use_cache (bool) – use the global ibeis controller cache. Make sure this is false if calling from a Thread. (default=True)
- request_dbversion (str) – developer flag. Do not use.
Returns: ibs
Return type: CommandLine:
python -m ibeis.control.IBEISControl --test-request_IBEISController
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.IBEISControl import * # NOQA >>> dbdir = 'testdb1' >>> ensure = True >>> wbaddr = None >>> verbose = True >>> use_cache = False >>> ibs = request_IBEISController(dbdir, ensure, wbaddr, verbose, >>> use_cache) >>> result = str(ibs) >>> print(result)
ibeis.control._autogen_annotmatch_funcs module¶
Autogenerated IBEISController functions
- TemplateInfo:
- autogen_time = 11:34:25 2016/01/05 autogen_key = annotmatch
- ToRegenerate:
- python -m ibeis.templates.template_generator –key annotmatch –Tcfg with_web_api=False with_api_cache=False with_deleters=True no_extern_deleters=True –diff python -m ibeis.templates.template_generator –key annotmatch –Tcfg with_web_api=False with_api_cache=False with_deleters=True no_extern_deleters=True –write
-
ibeis.control._autogen_annotmatch_funcs.
add_annotmatch
(ibs, aid1_list, aid2_list, annotmatch_truth_list=None, annotmatch_confidence_list=None, annotmatch_tag_text_list=None, annotmatch_reviewed_list=None, annotmatch_reviewer_list=None, annotmatch_posixtime_modified_list=None, annotmatch_pairwise_prob_list=None, config_hashid_list=None)[source]¶ Returns: returns annotmatch_rowid_list of added (or already existing annotmatchs) - TemplateInfo:
- Tadder_native tbl = annotmatch
-
ibeis.control._autogen_annotmatch_funcs.
delete_annotmatch
(ibs, annotmatch_rowid_list, config2_=None)[source]¶ annotmatch.delete(annotmatch_rowid_list)
delete annotmatch rows
Parameters: annotmatch_rowid_list – Returns: num_deleted Return type: int - TemplateInfo:
- Tdeleter_native_tbl tbl = annotmatch
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids()[:2] >>> num_deleted = ibs.delete_annotmatch(annotmatch_rowid_list) >>> print('num_deleted = %r' % (num_deleted,))
-
ibeis.control._autogen_annotmatch_funcs.
get_annotmatch_aid1
(ibs, annotmatch_rowid_list, eager=True, nInput=None)[source]¶ aid1_list <- annotmatch.aid1[annotmatch_rowid_list]
gets data from the “native” column “aid1” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: aid1_list Return type: list - TemplateInfo:
- Tgetter_table_column col = aid1 tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> aid1_list = ibs.get_annotmatch_aid1(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(aid1_list)
-
ibeis.control._autogen_annotmatch_funcs.
get_annotmatch_aid2
(ibs, annotmatch_rowid_list, eager=True, nInput=None)[source]¶ aid2_list <- annotmatch.aid2[annotmatch_rowid_list]
gets data from the “native” column “aid2” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: aid2_list Return type: list - TemplateInfo:
- Tgetter_table_column col = aid2 tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> aid2_list = ibs.get_annotmatch_aid2(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(aid2_list)
-
ibeis.control._autogen_annotmatch_funcs.
get_annotmatch_confidence
(ibs, annotmatch_rowid_list, eager=True, nInput=None)[source]¶ annotmatch_confidence_list <- annotmatch.annotmatch_confidence[annotmatch_rowid_list]
gets data from the “native” column “annotmatch_confidence” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: annotmatch_confidence_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotmatch_confidence tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> annotmatch_confidence_list = ibs.get_annotmatch_confidence(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(annotmatch_confidence_list)
-
ibeis.control._autogen_annotmatch_funcs.
get_annotmatch_config_hashid
(ibs, annotmatch_rowid_list, eager=True, nInput=None)[source]¶ config_hashid_list <- annotmatch.config_hashid[annotmatch_rowid_list]
gets data from the “native” column “config_hashid” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: config_hashid_list Return type: list - TemplateInfo:
- Tgetter_table_column col = config_hashid tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> config_hashid_list = ibs.get_annotmatch_config_hashid(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(config_hashid_list)
-
ibeis.control._autogen_annotmatch_funcs.
get_annotmatch_pairwise_prob
(ibs, annotmatch_rowid_list, eager=True, nInput=None)[source]¶ annotmatch_pairwise_prob_list <- annotmatch.annotmatch_pairwise_prob[annotmatch_rowid_list]
gets data from the “native” column “annotmatch_pairwise_prob” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: annotmatch_pairwise_prob_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotmatch_pairwise_prob tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> annotmatch_pairwise_prob_list = ibs.get_annotmatch_pairwise_prob(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(annotmatch_pairwise_prob_list)
-
ibeis.control._autogen_annotmatch_funcs.
get_annotmatch_posixtime_modified
(ibs, annotmatch_rowid_list, eager=True, nInput=None)[source]¶ annotmatch_posixtime_modified_list <- annotmatch.annotmatch_posixtime_modified[annotmatch_rowid_list]
gets data from the “native” column “annotmatch_posixtime_modified” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: annotmatch_posixtime_modified_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotmatch_posixtime_modified tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> annotmatch_posixtime_modified_list = ibs.get_annotmatch_posixtime_modified(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(annotmatch_posixtime_modified_list)
-
ibeis.control._autogen_annotmatch_funcs.
get_annotmatch_reviewed
(ibs, annotmatch_rowid_list, eager=True, nInput=None)[source]¶ annotmatch_reviewed_list <- annotmatch.annotmatch_reviewed[annotmatch_rowid_list]
gets data from the “native” column “annotmatch_reviewed” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: annotmatch_reviewed_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotmatch_reviewed tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> annotmatch_reviewed_list = ibs.get_annotmatch_reviewed(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(annotmatch_reviewed_list)
-
ibeis.control._autogen_annotmatch_funcs.
get_annotmatch_reviewer
(ibs, annotmatch_rowid_list, eager=True, nInput=None)[source]¶ annotmatch_reviewer_list <- annotmatch.annotmatch_reviewer[annotmatch_rowid_list]
gets data from the “native” column “annotmatch_reviewer” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: annotmatch_reviewer_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotmatch_reviewer tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> annotmatch_reviewer_list = ibs.get_annotmatch_reviewer(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(annotmatch_reviewer_list)
-
ibeis.control._autogen_annotmatch_funcs.
get_annotmatch_rowid
(ibs, annotmatch_rowid_list, eager=True, nInput=None)[source]¶ annotmatch_rowid_list <- annotmatch.annotmatch_rowid[annotmatch_rowid_list]
gets data from the “native” column “annotmatch_rowid” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: annotmatch_rowid_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotmatch_rowid tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> annotmatch_rowid_list = ibs.get_annotmatch_rowid(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(annotmatch_rowid_list)
-
ibeis.control._autogen_annotmatch_funcs.
get_annotmatch_rowid_from_superkey
(ibs, aid1_list, aid2_list, eager=True, nInput=None)[source]¶ annotmatch_rowid_list <- annotmatch[aid1_list, aid2_list]
Parameters: lists (superkey) – aid1_list, aid2_list Returns: annotmatch_rowid_list - TemplateInfo:
- Tgetter_native_rowid_from_superkey tbl = annotmatch
-
ibeis.control._autogen_annotmatch_funcs.
get_annotmatch_tag_text
(ibs, annotmatch_rowid_list, eager=True, nInput=None)[source]¶ annotmatch_tag_text_list <- annotmatch.annotmatch_tag_text[annotmatch_rowid_list]
gets data from the “native” column “annotmatch_tag_text” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: annotmatch_tag_text_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotmatch_tag_text tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> annotmatch_tag_text_list = ibs.get_annotmatch_tag_text(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(annotmatch_tag_text_list)
-
ibeis.control._autogen_annotmatch_funcs.
get_annotmatch_truth
(ibs, annotmatch_rowid_list, eager=True, nInput=None)[source]¶ annotmatch_truth_list <- annotmatch.annotmatch_truth[annotmatch_rowid_list]
gets data from the “native” column “annotmatch_truth” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: annotmatch_truth_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotmatch_truth tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> annotmatch_truth_list = ibs.get_annotmatch_truth(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(annotmatch_truth_list)
-
ibeis.control._autogen_annotmatch_funcs.
set_annotmatch_confidence
(ibs, annotmatch_rowid_list, annotmatch_confidence_list, duplicate_behavior=u'error')[source]¶ annotmatch_confidence_list -> annotmatch.annotmatch_confidence[annotmatch_rowid_list]
Parameters: - annotmatch_rowid_list –
- annotmatch_confidence_list –
- TemplateInfo:
- Tsetter_native_column tbl = annotmatch col = annotmatch_confidence
-
ibeis.control._autogen_annotmatch_funcs.
set_annotmatch_config_hashid
(ibs, annotmatch_rowid_list, config_hashid_list, duplicate_behavior=u'error')[source]¶ config_hashid_list -> annotmatch.config_hashid[annotmatch_rowid_list]
Parameters: - annotmatch_rowid_list –
- config_hashid_list –
- TemplateInfo:
- Tsetter_native_column tbl = annotmatch col = config_hashid
-
ibeis.control._autogen_annotmatch_funcs.
set_annotmatch_pairwise_prob
(ibs, annotmatch_rowid_list, annotmatch_pairwise_prob_list, duplicate_behavior=u'error')[source]¶ annotmatch_pairwise_prob_list -> annotmatch.annotmatch_pairwise_prob[annotmatch_rowid_list]
Parameters: - annotmatch_rowid_list –
- annotmatch_pairwise_prob_list –
- TemplateInfo:
- Tsetter_native_column tbl = annotmatch col = annotmatch_pairwise_prob
-
ibeis.control._autogen_annotmatch_funcs.
set_annotmatch_posixtime_modified
(ibs, annotmatch_rowid_list, annotmatch_posixtime_modified_list, duplicate_behavior=u'error')[source]¶ annotmatch_posixtime_modified_list -> annotmatch.annotmatch_posixtime_modified[annotmatch_rowid_list]
Parameters: - annotmatch_rowid_list –
- annotmatch_posixtime_modified_list –
- TemplateInfo:
- Tsetter_native_column tbl = annotmatch col = annotmatch_posixtime_modified
-
ibeis.control._autogen_annotmatch_funcs.
set_annotmatch_reviewed
(ibs, annotmatch_rowid_list, annotmatch_reviewed_list, duplicate_behavior=u'error')[source]¶ annotmatch_reviewed_list -> annotmatch.annotmatch_reviewed[annotmatch_rowid_list]
Parameters: - annotmatch_rowid_list –
- annotmatch_reviewed_list –
- TemplateInfo:
- Tsetter_native_column tbl = annotmatch col = annotmatch_reviewed
-
ibeis.control._autogen_annotmatch_funcs.
set_annotmatch_reviewer
(ibs, annotmatch_rowid_list, annotmatch_reviewer_list, duplicate_behavior=u'error')[source]¶ annotmatch_reviewer_list -> annotmatch.annotmatch_reviewer[annotmatch_rowid_list]
Parameters: - annotmatch_rowid_list –
- annotmatch_reviewer_list –
- TemplateInfo:
- Tsetter_native_column tbl = annotmatch col = annotmatch_reviewer
-
ibeis.control._autogen_annotmatch_funcs.
set_annotmatch_tag_text
(ibs, annotmatch_rowid_list, annotmatch_tag_text_list, duplicate_behavior=u'error')[source]¶ annotmatch_tag_text_list -> annotmatch.annotmatch_tag_text[annotmatch_rowid_list]
Parameters: - annotmatch_rowid_list –
- annotmatch_tag_text_list –
- TemplateInfo:
- Tsetter_native_column tbl = annotmatch col = annotmatch_tag_text
-
ibeis.control._autogen_annotmatch_funcs.
set_annotmatch_truth
(ibs, annotmatch_rowid_list, annotmatch_truth_list, duplicate_behavior=u'error')[source]¶ annotmatch_truth_list -> annotmatch.annotmatch_truth[annotmatch_rowid_list]
Parameters: - annotmatch_rowid_list –
- annotmatch_truth_list –
- TemplateInfo:
- Tsetter_native_column tbl = annotmatch col = annotmatch_truth
ibeis.control._autogen_explicit_controller module¶
Static file containing autogenerated functions for IBEISController Autogenerated on ymd_hm-2016-04-20_11-22
- RegenCommand:
- python -m ibeis.control.controller_inject –exec-dev_autogen_explicit_injects
-
class
ibeis.control._autogen_explicit_controller.
ExplicitInjectIBEISController
[source]¶ Bases:
object
-
add_annot_relationship
(*args, **kwargs)[source]¶ - Adds a relationship between annots and lblannots
- (annotations and labels of annotations)
-
add_annotgroup
(ibs, annotgroup_uuid_list, annotgroup_text_list, annotgroup_note_list)[source]¶ Returns: returns annotgroup_rowid_list of added (or already existing annotgroups) - TemplateInfo:
- Tadder_native tbl = annotgroup
-
add_annotmatch
(ibs, aid1_list, aid2_list, annotmatch_truth_list=None, annotmatch_confidence_list=None, annotmatch_tag_text_list=None, annotmatch_reviewed_list=None, annotmatch_reviewer_list=None, annotmatch_posixtime_modified_list=None, annotmatch_pairwise_prob_list=None, config_hashid_list=None)[source]¶ Returns: returns annotmatch_rowid_list of added (or already existing annotmatchs) - TemplateInfo:
- Tadder_native tbl = annotmatch
-
add_annots
(*args, **kwargs)[source]¶ Adds an annotation to images
- Args:
- gid_list (list): image rowids to add annotation to bbox_list (list): of [x, y, w, h] bounding boxes for each image (supply verts instead) theta_list (list): orientations of annotations species_list (list): nid_list (list): name_list (list): detect_confidence_list (list): notes_list (list): vert_list (list): alternative to bounding box annot_uuid_list (list): yaw_list (list): annot_visual_uuid_list (list): annot_semantic_uuid_list (list): quiet_delete_thumbs (bool):
- Returns:
- list: aid_list
- CommandLine:
- python -m ibeis.control.manual_annot_funcs –test-add_annots python -m ibeis.control.manual_annot_funcs –test-add_annots –verbose –print-caller
- Ignore:
- theta_list = None species_list = None nid_list = None name_list = None detect_confidence_list = None notes_list = None vert_list = None annot_uuid_list = None yaw_list = None quiet_delete_thumbs = False prevent_visual_duplicates = False
- RESTful:
- Method: POST URL: /api/annot/
- Example:
>>> # ENABLE_DOCTEST >>> from ibeis.control.IBEISControl import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> prevalid = ibs.get_valid_aids() >>> num_add = 2 >>> gid_list = ibs.get_valid_gids()[0:num_add] >>> bbox_list = [(int(w * .1), int(h * .6), int(w * .5), int(h * .3)) ... for (w, h) in ibs.get_image_sizes(gid_list)] >>> # Add a test annotation >>> print('Testing add_annots') >>> aid_list = ibs.add_annots(gid_list, bbox_list=bbox_list) >>> bbox_list2 = ibs.get_annot_bboxes(aid_list) >>> vert_list2 = ibs.get_annot_verts(aid_list) >>> theta_list2 = ibs.get_annot_thetas(aid_list) >>> name_list2 = ibs.get_annot_names(aid_list) >>> print('Ensure=False. Should get back None chip fpaths') >>> chip_fpaths2 = ibs.get_annot_chip_fpath(aid_list, ensure=False) >>> assert [fpath is None for fpath in chip_fpaths2], 'should not have fpaths' >>> print('Ensure=True. Should get back None chip fpaths') >>> chip_fpaths = ibs.get_annot_chip_fpath(aid_list, ensure=True) >>> assert all([ut.checkpath(fpath, verbose=True) for fpath in chip_fpaths]), 'paths should exist' >>> ut.assert_eq(len(aid_list), num_add) >>> ut.assert_eq(len(vert_list2[0]), 4) >>> assert bbox_list2 == bbox_list, 'bboxes are unequal' >>> # Be sure to remove test annotation >>> # if this test fails a resetdbs might be nessary >>> result = '' >>> visual_uuid_list = ibs.get_annot_visual_uuids(aid_list) >>> semantic_uuid_list = ibs.get_annot_semantic_uuids(aid_list) >>> result += str(visual_uuid_list) + '
- ‘
>>> result += str(semantic_uuid_list) + '
- ‘
>>> print('Cleaning up. Removing added annotations') >>> ibs.delete_annots(aid_list) >>> assert not any([ut.checkpath(fpath, verbose=True) for fpath in chip_fpaths]) >>> postvalid = ibs.get_valid_aids() >>> assert prevalid == postvalid >>> result += str(postvalid) >>> print(result) [UUID('30f7639b-5161-a561-2c4f-41aed64e5b65'), UUID('5ccbb26d-104f-e655-cf2b-cf92e0ad2fd2')] [UUID('3e3e9c98-e47c-f153-7101-f3d4fdadfb90'), UUID('dbf3b1a2-2188-75b4-07d4-0ef7e4787d23')] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
# semantic uuids change when hashing is different
[UUID(‘30f7639b-5161-a561-2c4f-41aed64e5b65’), UUID(‘5ccbb26d-104f-e655-cf2b-cf92e0ad2fd2’)] [UUID(‘68160c90-4b82-dc96-dafa-b12948739577’), UUID(‘03e74d19-1bf7-bc43-a291-8ee06a44da2e’)] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
- Example2:
>>> # Test with prevent_visual_duplicates on >>> # ENABLE_DOCTEST >>> from ibeis.control.IBEISControl import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> prevalid = ibs.get_valid_aids() >>> num_add = 1 >>> gid_list = ibs.get_valid_gids()[0:1] * num_add >>> bbox_list = [(int(w * .1), int(h * .6), int(w * .5), int(h * .3)) ... for (w, h) in ibs.get_image_sizes(gid_list)] >>> bbox_list2 = [(int(w * .2), int(h * .6), int(w * .5), int(h * .3)) ... for (w, h) in ibs.get_image_sizes(gid_list)] >>> # Add a test annotation >>> print('Testing add_annots') >>> aid_list1 = ibs.add_annots(gid_list, bbox_list=bbox_list, prevent_visual_duplicates=True) >>> aid_list2 = ibs.add_annots(gid_list, bbox_list=bbox_list, prevent_visual_duplicates=True) >>> aid_list3 = ibs.add_annots(gid_list, bbox_list=bbox_list2, prevent_visual_duplicates=True) >>> assert aid_list1 == aid_list2 >>> assert aid_list1 != aid_list3 >>> aid_list_new = aid_list1 + aid_list3 >>> result = aid_list_new >>> print('Cleaning up. Removing added annotations') >>> ibs.delete_annots(aid_list_new) >>> print(result) [14, 15]
-
add_config
(*args, **kwargs)[source]¶ Adds an algorithm / actor configuration as a string
- RESTful:
- Method: POST URL: /api/config/
Parameters: - ibs (IBEISController) – ibeis controller object
- cfgsuffix_list (list) –
- contrib_rowid_list (list) – (default = None)
Returns: config_rowid_list
Return type: list
CommandLine:
python -m ibeis.control.manual_meta_funcs --exec-add_config
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_meta_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> cfgsuffix_list = ['_CHIP(sz450)'] >>> contrib_rowid_list = None >>> config_rowid_list = add_config(ibs, cfgsuffix_list, contrib_rowid_list) >>> result = ('config_rowid_list = %s' % (str(config_rowid_list),)) >>> print(result)
-
add_contributors
(*args, **kwargs)[source]¶ Adds a list of contributors.
Returns: contrib_id_list – contributor rowids Return type: list - RESTful:
- Method: POST URL: /api/contributor/
-
add_gar
(ibs, annotgroup_rowid_list, aid_list)[source]¶ Returns: returns gar_rowid_list of added (or already existing gars) - TemplateInfo:
- Tadder_native tbl = gar
-
add_image_relationship
(*args, **kwargs)[source]¶ Adds a relationship between an image and and imageset
-
add_image_relationship_one
(*args, **kwargs)[source]¶ Adds a relationship between images and lblimages (imageations and labels of imageations)
-
add_images
(*args, **kwargs)[source]¶ Adds a list of image paths to the database.
Initially we set the image_uri to exactely the given gpath. Later we change the uri, but keeping it the same here lets us process images asychronously.
Parameters: - gpath_list (list) – list of image paths to add
- params_list (list) – metadata list for corresponding images that can either be specified outright or can be parsed from the image data directly if None
- as_annots (bool) – if True, an annotation is automatically added for the entire image
- auto_localize (bool) – if None uses the default specified in ibs.cfg
- ensure (bool) – check to see if the images exist on a *NIX system. Defaults to True
Returns: gid_list – gids are image rowids
Return type: list of rowids
- RESTful:
- Method: POST URL: /api/image/path
- Example0:
>>> # ENABLE_DOCTEST >>> # Test returns None on fail to add >>> from ibeis.control.manual_image_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> gpath_list = ['doesnotexist.jpg'] >>> assert not ut.checkpath(gpath_list[0]) >>> gid_list = ibs.add_images(gpath_list) >>> assert len(gid_list) == len(gpath_list) >>> assert gid_list[0] is None
- Example1:
>>> # ENABLE_DOCTSET >>> # test double add >>> from ibeis.control.manual_image_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> new_gpath_list = [ut.grab_test_imgpath('carl.jpg')] >>> new_gids1 = ibs.add_images(new_gpath_list, auto_localize=False) >>> new_gids2 = ibs.add_images(new_gpath_list, auto_localize=False) >>> #new_gids2 = ibs.add_images(new_gpath_list, auto_localize=True) >>> assert new_gids1 == new_gids2, 'should be the same' >>> new_gpath_list2 = ibs.get_image_paths(new_gids1) >>> assert new_gpath_list == new_gpath_list2, 'should not move when autolocalize is False' >>> # Clean things up >>> ibs.delete_images(new_gids1)
-
add_imagesets
(*args, **kwargs)[source]¶ Adds a list of imagesets.
Parameters: - imagesettext_list (list) –
- imageset_uuid_list (list) –
- config_rowid_list (list) –
- notes_list (list) –
Returns: imgsetid_list – added imageset rowids
Return type: list
- RESTful:
- Method: POST URL: /api/imageset/
-
add_lblannots
(*args, **kwargs)[source]¶ Adds new lblannots (labels of annotations) creates a new uuid for any new pair(type, value) #TODO: reverse order of rowid_list value_list in input
-
add_lblimages
(*args, **kwargs)[source]¶ Adds new lblimages (labels of imageations) creates a new uuid for any new pair(type, value) #TODO: reverse order of rowid_list value_list in input
-
add_lbltype
(*args, **kwargs)[source]¶ Adds a label type and its default value Should only be called at the begining of the program.
-
add_metadata
(*args, **kwargs)[source]¶ Adds metadata
Returns: metadata_rowid_list – metadata rowids Return type: list - RESTful:
- Method: POST URL: /api/metadata/
-
add_names
(*args, **kwargs)[source]¶ Adds a list of names.
Returns: name_rowid_list – their nids Return type: list - RESTful:
- Method: POST URL: /api/name/
-
add_new_temp_contributor
(ibs, user_prompt=False, offset=None, autolocate=False)[source]¶ - RESTful:
- Method: POST URL: /api/contributor/new_temp/
-
add_party
(ibs, party_tag_list)[source]¶ Returns: returns party_rowid_list of added (or already existing partys) - TemplateInfo:
- Tadder_native tbl = party
- RESTful:
- Method: POST URL: /api/autogen/
-
add_species
(*args, **kwargs)[source]¶ Adds a list of species.
- Returns:
- list: speciesid_list - species rowids
- RESTful:
- Method: POST URL: /api/species/
- CommandLine:
- python -m ibeis.control.manual_species_funcs –test-add_species
- Example:
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_species_funcs import * # NOQA >>> import ibeis >>> import utool as ut >>> ibs = ibeis.opendb('testdb1') >>> species_text_list = [ ... 'jaguar', 'zebra_plains', 'zebra_plains', '____', 'TYPO', ... '____', 'zebra_grevys', 'bear_polar'] >>> species_rowid_list = ibs.add_species(species_text_list) >>> print(ut.list_str(list(zip(species_text_list, species_rowid_list)))) >>> ibs.print_species_table() >>> species_text = ibs.get_species_texts(species_rowid_list) >>> # Ensure we leave testdb1 in a clean state >>> ibs.delete_species(ibs.get_species_rowids_from_text(['jaguar', 'TYPO'])) >>> all_species_rowids = ibs._get_all_species_rowids() >>> result = ut.list_str(species_text, nl=False) + '
- ‘
>>> result += ut.list_str(all_species_rowids, nl=False) + '
- ‘
>>> result += ut.list_str(ibs.get_species_texts(all_species_rowids), nl=False) >>> print(result) ['jaguar', 'zebra_plains', 'zebra_plains', '____', 'typo', '____', 'zebra_grevys', 'bear_polar'] [1, 2, 3] ['zebra_plains', 'zebra_grevys', 'bear_polar']
[u’jaguar’, u’zebra_plains’, u’zebra_plains’, ‘____’, ‘____’, ‘____’, u’zebra_grevys’, u’bear_polar’] [8, 9, 10] [u’zebra_plains’, u’zebra_grevys’, u’bear_polar’]
-
annotation_src_api
(aid=None)[source]¶ Returns the base64 encoded image of annotation <aid>
- RESTful:
- Method: GET URL: /api/annot/<aid>/
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
-
assert_valid_aids
(ibs, aid_list, verbose=False, veryverbose=False, msg=u'', auuid_list=None)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
- verbose (bool) – verbosity flag(default = False)
- veryverbose (bool) – (default = False)
CommandLine:
python -m ibeis.other.ibsfuncs --test-assert_valid_aids
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid_list = ibs.get_valid_aids() >>> verbose = False >>> veryverbose = False >>> print('Asserting multiple') >>> result = assert_valid_aids(ibs, aid_list, verbose, veryverbose) >>> print('Asserting single') >>> result = assert_valid_aids(ibs, aid_list[0:1], verbose, veryverbose) >>> print('Asserting multiple incorrect') >>> auuid_list = ibs.get_annot_uuids(aid_list) + [None] >>> try: >>> result = assert_valid_aids(ibs, aid_list + [0], verbose, veryverbose, auuid_list=auuid_list) >>> except AssertionError: >>> print('Correctly got assertion') >>> else: >>> assert False, 'should have failed' >>> print('Asserting single incorrect') >>> try: >>> result = assert_valid_aids(ibs, [0], verbose, veryverbose) >>> except AssertionError: >>> print('Correctly got assertion') >>> else: >>> assert False, 'should have failed' >>> print(result) >>> print(result)
-
batch_rename_consecutive_via_species
(ibs, imgsetid=None)[source]¶ actually sets the new consectuive names
-
check_annot_consistency
(ibs, aid_list=None)[source]¶ Parameters: - ibs (IBEISController) –
- aid_list (list) –
CommandLine:
python -m ibeis.other.ibsfuncs --test-check_annot_consistency
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis # NOQA >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> result = check_annot_consistency(ibs, aid_list) >>> print(result)
-
check_annot_corrupt_uuids
(ibs, aid_list=None)[source]¶ # del dtool.__SQLITE__.converters[‘UUID’] # import uuid # del dtool.__SQLITE__.adapters[(uuid.UUID, dtool.__SQLITE__.PrepareProtocol)]
>>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis # NOQA >>> ibs = ibeis.opendb('PZ_MTEST') >>> aid_list = ibs.get_valid_aids() >>> check_annot_corrupt_uuids(ibs, aid_list)
-
check_image_consistency
(ibs, gid_list=None)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- gid_list (list) – (default = None)
CommandLine:
python -m ibeis.other.ibsfuncs --exec-check_image_consistency --db=GZ_Master1
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> gid_list = None >>> result = check_image_consistency(ibs, gid_list) >>> print(result)
-
check_name_mapping_consistency
(ibs, nx2_aids)[source]¶ checks that all the aids grouped in a name ahave the same name
-
compare_nested_props
(ibs, aids1_list, aids2_list, getter_func, cmp_func)[source]¶ Compares properties of query vs database annotations
grouped_qaids = aids1_list grouped_groundtruth_list = aids2_list
getter_func = ibs.get_annot_yaws cmp_func = vt.ori_distance
getter_func = ibs.get_annot_image_unixtimes_asfloat cmp_func = ut.unixtime_hourdiff
- ExpandNestedComparisions:
- import itertools list(map(list, itertools.starmap(ut.iprod, zip(aids1_list, aids2_list))))
Parameters: - ibs (IBEISController) – ibeis controller object
- aids1_list (list) –
- aids2_list (list) –
- getter_func –
- cmp_func –
Returns: Return type: list of ndarrays
CommandLine:
python -m ibeis.other.ibsfuncs --exec-compare_nested_props --show
Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='PZ_MTEST') >>> aids1_list = [ibs.get_valid_aids()[8:11]] >>> aids2_list = [ibs.get_valid_aids()[8:11]] >>> getter_func = ibs.get_annot_image_unixtimes_asfloat >>> cmp_func = ut.unixtime_hourdiff >>> result = compare_nested_props(ibs, aids1_list, aids2_list, getter_func, cmp_func) >>> print(result) >>> ut.quit_if_noshow() >>> import plottool as pt >>> ut.show_if_requested()
-
compute_occurrences
(ibs)[source]¶ Clusters ungrouped images into imagesets representing occurrences
CommandLine:
python -m ibeis.control.IBEISControl --test-compute_occurrences
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.IBEISControl import * # NOQA >>> import ibeis # NOQA >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> ibs.compute_occurrences() >>> ibs.update_special_imagesets() >>> # Now we want to remove some images from a non-special imageset >>> nonspecial_imgsetids = [i for i in ibs.get_valid_imgsetids() if i not in ibs.get_special_imgsetids()] >>> images_to_remove = ibs.get_imageset_gids(nonspecial_imgsetids[0:1])[0][0:1] >>> ibs.unrelate_images_and_imagesets(images_to_remove,nonspecial_imgsetids[0:1] * len(images_to_remove)) >>> ibs.update_special_imagesets() >>> ungr_imgsetid = ibs.get_imageset_imgsetids_from_text(const.UNGROUPED_IMAGES_IMAGESETTEXT) >>> ungr_gids = ibs.get_imageset_gids([ungr_imgsetid])[0] >>> #Now let's make sure that when we recompute imagesets, our non-special imgsetid remains the same >>> print('PRE COMPUTE: ImageSets are %r' % ibs.get_valid_imgsetids()) >>> print('Containing: %r' % ibs.get_imageset_gids(ibs.get_valid_imgsetids())) >>> ibs.compute_occurrences() >>> print('COMPUTE: New imagesets are %r' % ibs.get_valid_imgsetids()) >>> print('Containing: %r' % ibs.get_imageset_gids(ibs.get_valid_imgsetids())) >>> ibs.update_special_imagesets() >>> print('UPDATE SPECIAL: New imagesets are %r' % ibs.get_valid_imgsetids()) >>> print('Containing: %r' % ibs.get_imageset_gids(ibs.get_valid_imgsetids())) >>> assert(images_to_remove[0] not in ibs.get_imageset_gids(nonspecial_imgsetids[0:1])[0])
-
compute_occurrences_smart
(ibs, gid_list, smart_xml_fpath)[source]¶ Function to load and process a SMART patrol XML file
-
convert_empty_images_to_annotations
(ibs)[source]¶ images without chips are given an ANNOTATION over the entire image
-
copy_imagesets
(ibs, imgsetid_list)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- imgsetid_list (list) –
Returns: new_imgsetid_list
Return type: list
CommandLine:
python -m ibeis.other.ibsfuncs --test-copy_imagesets
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> ibs.delete_all_imagesets() >>> ibs.compute_occurrences() >>> imgsetid_list = ibs.get_valid_imgsetids() >>> # execute function >>> new_imgsetid_list = copy_imagesets(ibs, imgsetid_list) >>> # verify results >>> result = str(ibs.get_imageset_text(new_imgsetid_list)) >>> assert [2] == list(set(map(len, ibs.get_image_imgsetids(ibs.get_valid_gids())))) >>> print(result) >>> ibs.delete_all_imagesets() >>> ibs.compute_occurrences()
-
create_new_imageset_from_images
(ibs, gid_list, new_imgsetid=None)[source]¶ Parameters: gid_list (list) – CommandLine:
python -m ibeis.other.ibsfuncs --test-create_new_imageset_from_images
Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> gid_list = ibs.get_valid_gids()[::2] >>> # execute function >>> new_imgsetid = create_new_imageset_from_images(ibs, gid_list) >>> # verify results >>> result = new_imgsetid >>> print(result)
-
create_new_imageset_from_names
(ibs, nid_list)[source]¶ Parameters: nid_list (list) – CommandLine:
python -m ibeis.other.ibsfuncs --test-create_new_imageset_from_names
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> nid_list = ibs._get_all_known_nids()[0:2] >>> # execute function >>> new_imgsetid = ibs.create_new_imageset_from_names(nid_list) >>> # clean up >>> ibs.delete_imagesets(new_imgsetid) >>> # verify results >>> result = new_imgsetid >>> print(result)
-
delete_annot_chips
(*args, **kwargs)[source]¶ Clears annotation data (does not remove the annotation)
- RESTful:
- Method: DELETE URL: /api/annot_chip/
-
delete_annot_feats
(*args, **kwargs)[source]¶ annot.feat.delete(aid_list)
Parameters: aid_list – - TemplateInfo:
- Tdeleter_rl_depenant root = annot leaf = feat
CommandLine:
python -m ibeis.control.manual_feat_funcs --test-delete_annot_feats python -m ibeis.control.manual_feat_funcs --test-delete_annot_feats --verb-control
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_feat_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> aid_list = ibs._get_all_aids()[:1] >>> fids_list = ibs.get_annot_feat_rowids(aid_list, config2_=config2_, ensure=True) >>> num_deleted1 = ibs.delete_annot_feats(aid_list, config2_=config2_) >>> ut.assert_eq(num_deleted1, len(fids_list)) >>> num_deleted2 = ibs.delete_annot_feats(aid_list, config2_=config2_) >>> ut.assert_eq(num_deleted2, 0)
-
delete_annot_nids
(*args, **kwargs)[source]¶ Remove name assocation from the list of input aids. Does this by setting each annotations nid to the UNKNOWN name rowid
- RESTful:
- Method: DELETE URL: /api/annot/nids/
-
delete_annot_relations
(*args, **kwargs)[source]¶ Deletes the relationship between an annotation and a label
-
delete_annot_relations_oftype
(*args, **kwargs)[source]¶ Deletes the relationship between an annotation and a label
-
delete_annot_speciesids
(*args, **kwargs)[source]¶ Deletes nids of a list of annotations
- RESTful:
- Method: DELETE URL: /api/annot/speciesids/
-
delete_annotgroup
(ibs, annotgroup_rowid_list, config2_=None)[source]¶ annotgroup.delete(annotgroup_rowid_list)
delete annotgroup rows
Parameters: annotgroup_rowid_list – Returns: num_deleted Return type: int - TemplateInfo:
- Tdeleter_native_tbl tbl = annotgroup
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_annotgroup_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> annotgroup_rowid_list = ibs._get_all_annotgroup_rowids()[:2] >>> num_deleted = ibs.delete_annotgroup(annotgroup_rowid_list) >>> print('num_deleted = %r' % (num_deleted,))
-
delete_annotmatch
(ibs, annotmatch_rowid_list, config2_=None)[source]¶ annotmatch.delete(annotmatch_rowid_list)
delete annotmatch rows
Parameters: annotmatch_rowid_list – Returns: num_deleted Return type: int - TemplateInfo:
- Tdeleter_native_tbl tbl = annotmatch
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids()[:2] >>> num_deleted = ibs.delete_annotmatch(annotmatch_rowid_list) >>> print('num_deleted = %r' % (num_deleted,))
-
delete_annots
(*args, **kwargs)[source]¶ deletes annotations from the database
- RESTful:
- Method: DELETE URL: /api/annot/
Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-delete_annots python -m ibeis.control.manual_annot_funcs --test-delete_annots --debug-api-cache python -m ibeis.control.manual_annot_funcs --test-delete_annots
- SeeAlso:
- back.delete_annot
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> ibs.delete_empty_nids() >>> # Add some annotations to delete >>> num_add = 2 >>> gid_list = ibs.get_valid_gids()[0:num_add] >>> nid = ibs.make_next_nids(1)[0] >>> nid_list = [nid] * num_add >>> bbox_list = [(int(w * .1), int(h * .6), int(w * .5), int(h * .3)) ... for (w, h) in ibs.get_image_sizes(gid_list)] >>> new_aid_list = ibs.add_annots(gid_list, bbox_list=bbox_list, nid_list=nid_list) >>> ibs.get_annot_nids(new_aid_list) >>> ut.assert_lists_eq(ibs.get_annot_nids(new_aid_list), nid_list) >>> assert ibs.get_name_aids(nid) == new_aid_list, 'annots should all have same name' >>> assert new_aid_list == ibs.get_name_aids(nid), 'inverse name mapping should work' >>> before_gids = ibs.get_image_aids(gid_list) >>> print('BEFORE gids: ' + str(before_gids)) >>> result = ibs.delete_annots(new_aid_list) >>> assert ibs.get_name_aids(nid) == [], 'annots should be removed' >>> after_gids = ibs.get_image_aids(gid_list) >>> assert after_gids != before_gids, 'the invalidators must have bugs' >>> print('AFTER gids: ' + str(after_gids)) >>> valid_aids = ibs.get_valid_aids() >>> assert [aid not in valid_aids for aid in new_aid_list], 'should no longer be valid aids' >>> print(result) >>> ibs.delete_empty_nids()
-
delete_cache
(ibs, delete_chips=False, delete_imagesets=False)[source]¶ Deletes the cache directory in the database directory. Can specify to delete encoutners and chips as well.
-
delete_cachedir
(ibs)[source]¶ Deletes the cache directory in the database directory.
(does not remove chips)
-
delete_configs
(*args, **kwargs)[source]¶ deletes images from the database that belong to fids
- RESTful:
- Method: DELETE URL: /api/config/
-
delete_contributors
(*args, **kwargs)[source]¶ deletes contributors from the database and all information associated
- RESTful:
- Method: DELETE URL: /api/contributor/
-
delete_empty_imgsetids
(ibs)[source]¶ Removes imagesets without images
Parameters: ibs (IBEISController) – ibeis controller object CommandLine:
python -m ibeis.control.manual_gsgrelate_funcs --test-delete_empty_imgsetids
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_gsgrelate_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> # execute function >>> result = ibs.delete_empty_imgsetids() >>> # verify results >>> print(result)
-
delete_empty_nids
(ibs)[source]¶ Removes names that have no Rois from the database
- RESTful:
- Method: DELETE URL: /api/name/empty_nids/
-
delete_gar
(ibs, gar_rowid_list, config2_=None)[source]¶ gar.delete(gar_rowid_list)
delete gar rows
Parameters: gar_rowid_list – Returns: num_deleted Return type: int - TemplateInfo:
- Tdeleter_native_tbl tbl = gar
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_garelate_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> gar_rowid_list = ibs._get_all_gar_rowids()[:2] >>> num_deleted = ibs.delete_gar(gar_rowid_list) >>> print('num_deleted = %r' % (num_deleted,))
-
delete_gsgr_image_relations
(*args, **kwargs)[source]¶ Removes relationship between input images and all imagesets
-
delete_gsgr_imageset_relations
(*args, **kwargs)[source]¶ Removes relationship between input imagesets and all images
-
delete_image_thumbs
(*args, **kwargs)[source]¶ Removes image thumbnails from disk
- RESTful:
- Method: DELETE URL: /api/image/thumbs/
Example
>>> # UNPORTED_DOCTEST >>> gpath_list = grabdata.get_test_gpaths(ndata=None)[0:4] >>> gid_list = ibs.add_images(gpath_list) >>> bbox_list = [(0, 0, 100, 100)] * len(gid_list) >>> name_list = ['a', 'b', 'a', 'd'] >>> aid_list = ibs.add_annots(gid_list, bbox_list=bbox_list, name_list=name_list) >>> assert len(aid_list) != 0, "No annotations added" >>> thumbpath_list = ibs.get_image_thumbpath(gid_list) >>> gpath_list = ibs.get_image_paths(gid_list) >>> ibs.delete_image_thumbs(gid_list) >>> assert utool.is_list(thumbpath_list), "thumbpath_list is not a list" >>> assert utool.is_list(gpath_list), "gpath_list is not a list" >>> for path in thumbpath_list: >>> assert not utool.checkpath(path), "Thumbnail not deleted" >>> for path in gpath_list: >>> utool.assertpath(path)
-
delete_images
(*args, **kwargs)[source]¶ deletes images from the database that belong to gids
- RESTful:
- Method: DELETE URL: /api/image/
Example
>>> # UNPORTED_DOCTEST >>> gpath_list = grabdata.get_test_gpaths(ndata=None)[0:4] >>> gid_list = ibs.add_images(gpath_list) >>> bbox_list = [(0, 0, 100, 100)] * len(gid_list) >>> name_list = ['a', 'b', 'a', 'd'] >>> aid_list = ibs.add_annots(gid_list, bbox_list=bbox_list, name_list=name_list) >>> gid = gid_list[0] >>> assert gid is not None, "gid is None" >>> aid_list = ibs.get_image_aids(gid) >>> assert len(aid_list) == 1, "Length of aid_list=%r" % (len(aid_list),) >>> aid = aid_list[0] >>> assert aid is not None, "aid is None" >>> cid = ibs.get_annot_chip_rowids(aid, ensure=False) >>> fid = ibs.get_annot_feat_rowids(aid, ensure=False) >>> assert cid is None, "cid=%r should be None" % (cid,) >>> assert fid is None, "fid=%r should be None" % (fid,) >>> cid = ibs.get_annot_chip_rowids(aid, ensure=True) >>> fid = ibs.get_annot_feat_rowids(aid, ensure=True) >>> assert cid is not None, "cid should be computed" >>> assert fid is not None, "fid should be computed" >>> gthumbpath = ibs.get_image_thumbpath(gid) >>> athumbpath = ibs.get_annot_chip_thumbpath(aid) >>> ibs.delete_images(gid) >>> all_gids = ibs.get_valid_gids() >>> all_aids = ibs.get_valid_aids() >>> all_cids = ibs.get_valid_cids() >>> all_fids = ibs.get_valid_fids() >>> assert gid not in all_gids, "gid still exists" >>> assert aid not in all_aids, "rid %r still exists" % aid >>> assert fid not in all_fids, "fid %r still exists" % fid >>> assert cid not in all_cids, "cid %r still exists" % cid >>> assert not utool.checkpath(gthumbpath), "Thumbnail still exists" >>> assert not utool.checkpath(athumbpath), "ANNOTATION Thumbnail still exists"
-
delete_imagesets
(*args, **kwargs)[source]¶ Removes imagesets and thier relationships (images are not effected)
- RESTful:
- Method: DELETE URL: /api/imageset/
-
delete_names
(*args, **kwargs)[source]¶ deletes names from the database
CAREFUL. YOU PROBABLY DO NOT WANT TO USE THIS at least ensure that no annot is associated with any of these nids
- RESTful:
- Method: DELETE URL: /api/name/
Example
>>> # UNPORTED_DOCTEST >>> gpath_list = grabdata.get_test_gpaths(ndata=None)[0:4] >>> gid_list = ibs.add_images(gpath_list) >>> bbox_list = [(0, 0, 100, 100)]*len(gid_list) >>> name_list = ['a', 'b', 'a', 'd'] >>> aid_list = ibs.add_annots(gid_list, bbox_list=bbox_list, name_list=name_list) >>> assert len(aid_list) != 0, "No annotations added" >>> nid_list = ibs.get_valid_nids() >>> assert len(nid_list) != 0, "No names added" >>> nid = nid_list[0] >>> assert nid is not None, "nid is None" >>> ibs.delete_names(nid) >>> all_nids = ibs.get_valid_nids() >>> assert nid not in all_nids, "NID not deleted"
-
delete_qres_cache
(ibs)[source]¶ Parameters: ibs (IBEISController) – ibeis controller object CommandLine:
python -m ibeis --tf delete_qres_cache python -m ibeis --tf delete_qres_cache --db PZ_MTEST python -m ibeis --tf delete_qres_cache --db PZ_Master1
Example
>>> # SCRIPT >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> result = delete_qres_cache(ibs) >>> print(result)
-
delete_species
(*args, **kwargs)[source]¶ deletes species from the database
CAREFUL. YOU PROBABLY DO NOT WANT TO USE THIS at least ensure that no annot is associated with any of these species rowids
- RESTful:
- Method: DELETE URL: /api/species/
-
detect_annot_species_viewpoint_cnn
(ibs, aid_list)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
Returns: species_viewpoint_list
Return type: list
CommandLine:
python -m ibeis_cnn._plugin --exec-detect_annot_species_viewpoint_cnn
Example
>>> # DISABLE_DOCTEST >>> from ibeis_cnn._plugin import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid_list = ibs.get_valid_aids() >>> species_viewpoint_list = detect_annot_species_viewpoint_cnn(ibs, aid_list) >>> result = ('species_viewpoint_list = %s' % (str(species_viewpoint_list),)) >>> print(result)
-
detect_annot_whale_fluke_background_mask
(ibs, aid_list, species=u'whale_fluke', config2_=None)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
Returns: mask_list
Return type: list
-
detect_annot_zebra_background_mask
(ibs, aid_list, species=None, config2_=None)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
Returns: mask_list
Return type: list
-
detect_cnn_yolo
(*args, **kwargs)[source]¶ Runs animal detection in each image. Adds annotations to the database as they are found.
Parameters: gid_list (list) – list of image ids to run detection on Returns: aids_list – list of lists of annotation ids detected in each image Return type: list CommandLine:
python -m ibeis.web.apis_detect --test-detect_cnn_yolo --show
- RESTful:
- Method: PUT, GET URL: /api/detect/cnn/yolo/
Example
>>> # DISABLE_DOCTEST >>> from ibeis.web.apis_detect import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> gid_list = ibs.get_valid_gids()[0:2] >>> # execute function >>> aids_list = ibs.detect_cnn_yolo(gid_list) >>> # Visualize results >>> if ut.show_was_requested(): >>> import plottool as pt >>> from ibeis.viz import viz_image >>> for fnum, gid in enumerate(gid_list): >>> viz_image.show_image(ibs, gid, fnum=fnum) >>> pt.show_if_requested() >>> # Remove newly detected annotations >>> ibs.delete_annots(ut.flatten(aids_list))
-
detect_cnn_yolo_json
(*args, **kwargs)[source]¶ - Runs animal detection in each image and returns json-ready formatted
- results, does not return annotations
Parameters: gid_list (list) – list of image ids to run detection on Returns: results_dict – dict of detection results (not annotations) Return type: list CommandLine:
python -m ibeis.web.apis_detect --test-detect_cnn_yolo_json
Example
>>> # DISABLE_DOCTEST >>> from ibeis.web.apis_detect import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> gid_list = ibs.get_valid_gids()[0:2] >>> # execute function >>> results_dict = ibs.detect_cnn_yolo_json(gid_list) >>> print(results_dict)
-
detect_image_cnn
(ibs, gid, confidence=0.9, extraction=u'bing')[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- gid –
- confidence (float) – (default = 0.9)
- extraction (str) – (default = ‘bing’)
CommandLine:
python -m ibeis_cnn._plugin --exec-detect_image_cnn
Example
>>> # DISABLE_DOCTEST >>> from ibeis_cnn._plugin import * # NOQA >>> from ibeis_cnn._plugin import _suggest_random_candidate_regions, _suggest_bing_candidate_regions # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> gid = 1 >>> confidence = 0.9 >>> extraction = 'bing' >>> result = detect_image_cnn(ibs, gid, confidence, extraction) >>> print(result)
-
detect_random_forest
(*args, **kwargs)[source]¶ Runs animal detection in each image. Adds annotations to the database as they are found.
Parameters: - gid_list (list) – list of image ids to run detection on
- species (str) – string text of the species to identify
Returns: aids_list – list of lists of annotation ids detected in each image
Return type: list
CommandLine:
python -m ibeis.web.apis_detect --test-detect_random_forest --show
- RESTful:
- Method: PUT, GET URL: /api/detect/random_forest/
Example
>>> # DISABLE_DOCTEST >>> from ibeis.web.apis_detect import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> gid_list = ibs.get_valid_gids()[0:2] >>> species = ibeis.const.TEST_SPECIES.ZEB_PLAIN >>> # execute function >>> aids_list = ibs.detect_random_forest(gid_list, species) >>> # Visualize results >>> if ut.show_was_requested(): >>> import plottool as pt >>> from ibeis.viz import viz_image >>> for fnum, gid in enumerate(gid_list): >>> viz_image.show_image(ibs, gid, fnum=fnum) >>> pt.show_if_requested() >>> # Remove newly detected annotations >>> ibs.delete_annots(ut.flatten(aids_list))
-
detect_yolo
(ibs, gid_list)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- gid_list (int) – list of image ids
Returns: aid_list
Return type: list
CommandLine:
python -m ibeis_cnn._plugin --exec-detect_yolo
Example
>>> # DISABLE_DOCTEST >>> from ibeis_cnn._plugin import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='PZ_MTEST') >>> gid_list = ibs.get_valid_gids() >>> aid_list = detect_yolo(ibs, gid_list) >>> print(aid_list)
-
ensure_contributor_rowids
(ibs, user_prompt=False, autolocate=False)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- user_prompt (bool) –
Returns: Return type: list
CommandLine:
python -m ibeis.control.manual_meta_funcs --test-ensure_contributor_rowids
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_meta_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb(db='testdb1') >>> gid_list = ibs.get_valid_gids() >>> ibs.delete_contributors(ibs.get_valid_contrib_rowids()) >>> contrib_rowid_list1 = ibs.get_image_contributor_rowid(gid_list) >>> assert ut.allsame(contrib_rowid_list1) >>> ut.assert_eq(contrib_rowid_list1[0], None) >>> user_prompt = ut.get_argflag('--user-prompt') >>> autolocate = ut.get_argflag('--user-prompt') >>> # execute function >>> result = ensure_contributor_rowids(ibs, user_prompt, autolocate) >>> # verify results >>> ibs.print_contributor_table() >>> print(result) >>> contrib_rowid_list2 = ibs.get_image_contributor_rowid(gid_list) >>> assert ut.allsame(contrib_rowid_list2) >>> ut.assert_eq(contrib_rowid_list2[0], 1)
list(zip(aid_pairs, undirected_tags))
-
filter_aids_custom
(ibs, aid_list)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
Returns: Return type: list
CommandLine:
python -m ibeis.other.ibsfuncs --test-filter_aids_custom
Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb2') >>> aid_list = ibs.get_valid_aids() >>> # execute function >>> aid_list_ = filter_aids_custom(ibs, aid_list) >>> # verify results >>> result = str(aid_list_) >>> print(result)
-
filter_aids_to_species
(ibs, aid_list, species)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
- species –
Returns: Return type: list
CommandLine:
python -m ibeis.other.ibsfuncs --exec-filter_aids_to_species
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid_list = ibs.get_valid_aids() >>> species = ibeis.const.TEST_SPECIES.ZEB_GREVY >>> aid_list_ = filter_aids_to_species(ibs, aid_list, species) >>> result = 'aid_list_ = %r' % (aid_list_,) >>> print(result) aid_list_ = [9, 10]
-
filter_aids_to_viewpoint
(ibs, aid_list, valid_yaws, unknown_ok=True)[source]¶ Removes aids that do not have a valid yaw
TODO: rename to valid_viewpoint because this func uses category labels
valid_yaws = [‘primary’, ‘primary1’, ‘primary-1’]
-
filter_aids_without_timestamps
(ibs, aid_list, invert=False)[source]¶ Removes aids without timestamps aid_list = ibs.get_valid_aids()
Filter / Find / Search for annotations with particular tags
CommandLine:
python -m ibeis.tag_funcs --exec-filter_annots_by_tags --helpx python -m ibeis.tag_funcs --exec-filter_annots_by_tags --db GZ_Master1 python -m ibeis.tag_funcs --exec-filter_annots_by_tags --db GZ_Master1 --min_num=1 python -m ibeis.tag_funcs --exec-filter_annots_by_tags --db GZ_Master1 --has_any=lighting --has_all=lighting:underexposed --show
- SeeAlso:
- python -m ibeis.init.filter_annots –exec-filter_annots_general
Example
>>> # ENABLE_DOCTEST >>> from ibeis.tag_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.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 ibeis.viz.interact >>> ibeis.viz.interact.interact_chip.interact_multichips(ibs, aid_list) >>> ut.show_if_requested()
-
filter_annots_general
(ibs, aid_list=None, filter_kw={}, verbose=False, **kwargs)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (list) – list of annotation rowids
- filter_kw –
- KWargs::
- has_none_annotmatch, any_match_annotmatch, has_all, is_known, any_match_annot, logic_annot, none_match_annotmatch, max_num_annotmatch, any_startswith_annot, has_any, require_quality, species, any_match, view_ext, has_any_annotmatch, view_pername, max_num_annot, min_timedelta, any_startswith, max_numfeat, any_startswith_annotmatch, been_adjusted, any_endswith_annot, require_viewpoint, logic, has_any_annot, min_num_annotmatch, min_num, min_num_annot, has_all_annot, has_none, min_pername, any_endswith_annotmatch, any_endswith, require_timestamp, none_match, contrib_contains, has_all_annotmatch, logic_annotmatch, min_numfeat, none_match_annot, view_ext1, view_ext2, max_num, has_none_annot, minqual, view
CommandLine:
python -m ibeis --tf filter_annots_general python -m ibeis --tf filter_annots_general --db PZ_Master1 --has_any=[needswork,correctable,mildviewpoint] --has_none=[viewpoint,photobomb,error:viewpoint,quality] --show python -m ibeis --tf filter_annots_general --db=GZ_Master1 --max-numfeat=300 --show --minqual=junk --species=None python -m ibeis --tf filter_annots_general --db=lynx --been_adjusted=True
Example
>>> # DISABLE_DOCTEST >>> from ibeis.init.filter_annots import * # NOQA >>> import ibeis >>> filter_kw = ut.argparse_dict(get_default_annot_filter_form(), >>> type_hint=ut.ddict(list, has_any=list, >>> has_none=list, >>> logic=str)) >>> print('filter_kw = %s' % (ut.dict_str(filter_kw),)) >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid_list = ibs.get_valid_aids() >>> #filter_kw = dict(is_known=True, min_num=1, has_any='viewpoint') >>> #filter_kw = dict(is_known=True, min_num=1, any_match='.*error.*') >>> aid_list_ = filter_annots_general(ibs, aid_list, filter_kw) >>> print('len(aid_list_) = %r' % (len(aid_list_),)) >>> 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') >>> ut.print_dict(ibs.get_annot_stats_dict(aid_list_), 'annot_stats') >>> ut.quit_if_noshow() >>> import ibeis.viz.interact >>> ibeis.viz.interact.interact_chip.interact_multichips(ibs, aid_list_) >>> ut.show_if_requested()
-
filter_annots_independent
(ibs, avail_aids, aidcfg, prefix=u'', verbose=False, withpre=False)[source]¶ Filtering that doesn’t have to do with a reference set of aids
TODO make filterflags version
Parameters: - ibs (IBEISController) – ibeis controller object
- avail_aids (list) –
- aidcfg (dict) –
- prefix (str) – (default = ‘’)
- verbose (bool) – verbosity flag(default = False)
Returns: avail_aids
Return type: list
CommandLine:
python -m ibeis --tf filter_annots_independent --veryverbtd
Example
>>> # DISABLE_DOCTEST >>> from ibeis.init.filter_annots import * # NOQA >>> import ibeis >>> from ibeis.expt import annotation_configs >>> ibs = ibeis.opendb(defaultdb='PZ_MTEST') >>> avail_aids = input_aids = ibs.get_valid_aids() >>> aidcfg = annotation_configs.default['dcfg'] >>> aidcfg['require_timestamp'] = True >>> aidcfg['require_quality'] = False >>> aidcfg['is_known'] = True >>> prefix = '' >>> verbose = True >>> avail_aids = filter_annots_independent(ibs, avail_aids, aidcfg, >>> prefix, verbose) >>> result = ('avail_aids = %s' % (str(avail_aids),)) >>> print(result)
-
filter_annots_using_minimum_timedelta
(ibs, aid_list, min_timedelta)[source]¶ Uses a dynamic program to find the maximum number of annotations that are above the minimum timedelta requirement.
Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list –
- min_timedelta –
CommandLine:
python -m ibeis.other.ibsfuncs --exec-filter_annots_using_minimum_timedelta python -m ibeis.other.ibsfuncs --exec-filter_annots_using_minimum_timedelta --db PZ_Master1
Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='PZ_MTEST') >>> aid_list = ibs.get_valid_aids() >>> aid_list = ibs.filter_aids_without_timestamps(aid_list) >>> print('Before') >>> ibs.print_annot_stats(aid_list, min_name_hourdist=True) >>> min_timedelta = 60 * 60 * 24 >>> filtered_aids = filter_annots_using_minimum_timedelta(ibs, aid_list, min_timedelta) >>> print('After') >>> ibs.print_annot_stats(filtered_aids, min_name_hourdist=True) >>> ut.quit_if_noshow() >>> ibeis.other.dbinfo.hackshow_names(ibs, aid_list) >>> ibeis.other.dbinfo.hackshow_names(ibs, filtered_aids) >>> ut.show_if_requested()
-
filter_junk_annotations
(ibs, aid_list)[source]¶ remove junk annotations from a list
Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
Returns: filtered_aid_list
Return type: list
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> filtered_aid_list = filter_junk_annotations(ibs, aid_list) >>> result = str(filtered_aid_list) >>> print(result)
Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (list) – list of annotation rowids
CommandLine:
python -m ibeis --tf filterannots_by_tags utprof.py -m ibeis --tf filterannots_by_tags
- SeeAlso:
- filter_annotmatch_by_tags
Example
>>> # DISABLE_DOCTEST >>> from ibeis.init.filter_annots import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='PZ_Master1') >>> aid_list = ibs.get_valid_aids() >>> has_any = ut.get_argval('--tags', type_=list, >>> default=['SceneryMatch', 'Photobomb']) >>> min_num = ut.get_argval('--min_num', type_=int, default=1) >>> filter_kw = dict(has_any=has_any, min_num=1) >>> aid_list_ = filterannots_by_tags(ibs, aid_list, filter_kw) >>> print('aid_list_ = %r' % (aid_list_,)) >>> ut.quit_if_noshow() >>> pass >>> # TODO: show special annot group in GUI
Filter / Find / Search for annotations with particular tags
-
find_unlabeled_name_members
(ibs, **kwargs)[source]¶ Find annots where some members of a name have information but others do not.
Parameters: ibs (IBEISController) – ibeis controller object CommandLine:
python -m ibeis.other.ibsfuncs --exec-find_unlabeled_name_members --qual
Example
>>> # SCRIPT >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='PZ_Master1') >>> defaultdict = dict(ut.parse_func_kwarg_keys(find_unlabeled_name_members, with_vals=True)) >>> kwargs = ut.argparse_dict(defaultdict) >>> result = find_unlabeled_name_members(ibs, **kwargs) >>> print(result)
-
fix_and_clean_database
(ibs)[source]¶ Function to run all database cleanup scripts
Rename to run_cleanup_scripts
- Break into two funcs:
- run_cleanup_scripts run_fixit_scripts
- CONSITENCY CHECKS TODO:
- check that annotmatches marked as False do not have the same name for similar viewpoints.
- check that photobombs are have different names
- warn if scenery matches have the same name
-
fix_annot_species_viewpoint_quality_cnn
(ibs, aid_list, min_conf=0.8)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
-
fix_exif_data
(ibs, gid_list)[source]¶ TODO CALL SCRIPT
Parameters: - ibs (IBEISController) – ibeis controller object
- gid_list (list) – list of image ids
CommandLine:
python -m ibeis.other.ibsfuncs --exec-fix_exif_data
Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='lynx') >>> gid_list = ibs.get_valid_gids() >>> result = fix_exif_data(ibs, gid_list) >>> print(result)
-
fix_invalid_name_texts
(ibs)[source]¶ Ensure that no name text is empty or ‘____’
Parameters: ibs (IBEISController) – ibeis controller object CommandLine:
python -m ibeis.other.ibsfuncs --test-fix_invalid_names
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis # NOQA >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> # execute function >>> result = fix_invalid_name_texts(ibs) >>> # verify results >>> print(result)
ibs.set_name_texts(nid_list[3], ‘____’) ibs.set_name_texts(nid_list[2], ‘’)
-
fix_invalid_nids
(ibs)[source]¶ Make sure that all rowids are greater than 0
We can only handle there being a name with rowid 0 if it is UNKNOWN. In this case we safely delete it, but anything more complicated needs to be handled anually
Parameters: ibs (IBEISController) – ibeis controller object CommandLine:
python -m ibeis.other.ibsfuncs --test-fix_invalid_nids
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis # NOQA >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> # execute function >>> result = fix_invalid_nids(ibs) >>> # verify results >>> print(result)
-
fix_unknown_exemplars
(ibs)[source]¶ Goes through all of the annotations, and sets their exemplar flag to 0 if it is associated with an unknown annotation
-
flag_aids_count
(ibs, aid_list)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
- pre_unixtime_sort (bool) –
Returns: Return type: list
CommandLine:
python -m ibeis.other.ibsfuncs --test-flag_aids_count
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> # execute function >>> gzc_flag_list = flag_aids_count(ibs, aid_list) >>> result = gzc_flag_list >>> # verify results >>> print(result) [False, True, False, False, True, False, True, True, False, True, False, True, True]
-
generate_species_background
(ibs, chip_list, species=None, nInput=None)[source]¶ TODO: Use this as the primary function
CommandLine:
python -m ibeis_cnn._plugin --exec-generate_species_background --show python -m ibeis_cnn._plugin --exec-generate_species_background --db GZ_Master1 --species=zebra_grevys --save cnn_detect_results_gz.png --diskshow --clipwhite python -m ibeis_cnn._plugin --exec-generate_species_background --db PZ_Master1 --species=zebra_plains --save cnn_detect_results_pz.png --diskshow --clipwhite python -m ibeis_cnn._plugin --exec-generate_species_background --db PZ_Master1 --show python -m ibeis_cnn._plugin --exec-generate_species_background --db GZ_Master1 --show python -m ibeis_cnn._plugin --exec-generate_species_background --db GIRM_Master1 --show --species=giraffe_masai
Example
>>> # ENABLE_DOCTEST >>> import ibeis_cnn >>> import ibeis >>> from ibeis_cnn._plugin import * # NOQA >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid_list = ibs.get_valid_aids()[0:8] >>> species = ut.get_argval('--species', type_=str, default=None) >>> config2_ = None >>> nInput = len(aid_list) >>> chip_iter = ibs.get_annot_chips(aid_list, verbose=True, config2_=config2_, eager=False) >>> mask_iter = generate_species_background(ibs, chip_iter, species=species, nInput=nInput) >>> mask_list = list(mask_iter) >>> ut.quit_if_noshow() >>> import plottool as pt >>> import vtool as vt >>> chip_list = ibs.get_annot_chips(aid_list, verbose=True, config2_=config2_, eager=True) >>> stacked_list = [vt.stack_images(chip, mask)[0] for chip, mask in zip(chip_list, mask_list)] >>> iteract_obj = pt.interact_multi_image.MultiImageInteraction(stacked_list, nPerPage=4) >>> #hough_cpath = ibs.get_annot_probchip_fpath(aid_list, config2_=config2_) >>> #iteract_obj2 = pt.interact_multi_image.MultiImageInteraction(hough_cpath, nPerPage=4) >>> #pt.imshow(mask_list[0]) >>> ut.show_if_requested()
-
generate_species_background_mask
(ibs, chip_fpath_list, species=None)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
Returns: species_viewpoint_list
Return type: list
CommandLine:
python -m ibeis_cnn._plugin --exec-generate_species_background_mask --show --db PZ_Master1 python -m ibeis_cnn --tf generate_species_background_mask --show --db PZ_Master1 --aid 9970
Example
>>> # DISABLE_DOCTEST >>> import ibeis_cnn >>> import ibeis >>> from ibeis_cnn._plugin import * # NOQA >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid_list = ut.get_argval(('--aids', '--aid'), type_=list, default=ibs.get_valid_aids()[0:10]) >>> chip_fpath_list = ibs.get_annot_chip_fpath(aid_list) >>> species = ibs.const.TEST_SPECIES.ZEB_PLAIN >>> mask_list = generate_species_background_mask(ibs, chip_fpath_list, species) >>> ut.quit_if_noshow() >>> import plottool as pt >>> iteract_obj = pt.interact_multi_image.MultiImageInteraction(mask_list, nPerPage=4) >>> #pt.imshow(mask_list[0]) >>> ut.show_if_requested()
#>>> from ibeis_cnn.draw_results import * # NOQA #>>> from ibeis_cnn import ingest_data #>>> data, labels = ingest_data.testdata_patchmatch2() #>>> flat_metadata = {‘fs’: np.arange(len(labels))} #>>> result = interact_siamsese_data_patches(labels, data, flat_metadata) #>>> ut.show_if_requested()
-
get_aidpair_truths
(ibs, aid1_list, aid2_list)[source]¶ Uses NIDS to verify truth
Parameters: - ibs (IBEISController) – ibeis controller object
- aid1_list (list) –
- aid2_list (list) –
Returns: truth
Return type: list[bool]
CommandLine:
python -m ibeis.other.ibsfuncs --test-get_aidpair_truths
Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> aid1_list = ibs.get_valid_aids() >>> aid2_list = ut.list_roll(ibs.get_valid_aids(), -1) >>> # execute function >>> truth = get_aidpair_truths(ibs, aid1_list, aid2_list) >>> # verify results >>> result = str(truth) >>> print(result)
-
get_all_species_nice
(ibs)[source]¶ Returns: list_ – all nids of known animals (does not include unknown names) Return type: list
-
get_all_species_texts
(ibs)[source]¶ Returns: list_ – all nids of known animals (does not include unknown names) Return type: list
-
get_all_uncontributed_configs
(ibs)[source]¶ - RESTful:
- Method: GET URL: /api/contributor/all_uncontributed_configs/
-
get_all_uncontributed_images
(ibs)[source]¶ - RESTful:
- Method: GET URL: /api/contributor/all_uncontributed_images/
-
get_alr_annot_rowids
(*args, **kwargs)[source]¶ Parameters: alrid_list (list of rowids) – annot + label relationship rows get the annot_rowid belonging to each relationship
-
get_alr_annot_rowids_from_lblannot_rowid
(ibs, lblannot_rowid_list)[source]¶ This is a 1toM getter
Get annotation rowids of labels. There may be more than one annotation per label.
Parameters: lblannot_rowid_list (list) – of lblannot (labels of annotations) rowids Returns: aids_list – of lists annotation rowids Return type: list
-
get_alr_confidence
(*args, **kwargs)[source]¶ Parameters: alrid_list (list of rowids) – annot + label relationship rows Returns: alr_confidence_list – confidence in an annotation relationship Return type: list of rowids
-
get_alr_config_rowid
(*args, **kwargs)[source]¶ Parameters: alrid_list (list of rowids) – annot + label relationship rows Returns: config_rowid_list – config_rowid in an annotation relationship Return type: list
-
get_alr_lblannot_rowids
(*args, **kwargs)[source]¶ Parameters: alrid_list (list of rowids) – annot + label relationship rows Returns: lblannot_rowids_list – label rowids (of annotations) Return type: list of rowids
-
get_alrid_from_superkey
(*args, **kwargs)[source]¶ Parameters: - aid_list (list) – list of annotation row-ids
- lblannot_rowid_list (list) – list of lblannot row-ids
- config_rowid_list (list) – list of config row-ids
Returns: alrid_list – annot-label relationship id list
Return type: list
-
get_annot_age_months_est
(ibs, aid_list, eager=True, nInput=None)[source]¶ annot_age_months_est_list <- annot.annot_age_months_est[aid_list]
gets data from the annotation’s native age in months
Parameters: aid_list (list) – Returns: annot_age_months_est_list Return type: list - RESTful:
- Method: GET URL: /api/annot/age_months_est/
-
get_annot_age_months_est_max
(ibs, aid_list, eager=True, nInput=None)[source]¶ annot_age_months_est_max_list <- annot.annot_age_months_est_max[aid_list]
gets data from the “native” column “annot_age_months_est_max” in the “annot” table
Parameters: aid_list (list) – Returns: annot_age_months_est_max_list Return type: list - RESTful:
- Method: GET URL: /api/annot/age_months_est_max/
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> aid_list = ibs._get_all_aids() >>> eager = True >>> annot_age_months_est_max_list = ibs.get_annot_age_months_est_max(aid_list, eager=eager) >>> assert len(aid_list) == len(annot_age_months_est_max_list)
-
get_annot_age_months_est_max_texts
(ibs, aid_list, eager=True, nInput=None)[source]¶ annot_age_months_est_max_texts_list <- annot.annot_age_months_est_max_texts[aid_list]
gets string versions of the annotation’s native max age in months
Parameters: aid_list (list) – Returns: annot_age_months_est_max_list Return type: list - RESTful:
- Method: GET URL: /api/annot/age_months_est_max_texts/
-
get_annot_age_months_est_min
(ibs, aid_list, eager=True, nInput=None)[source]¶ annot_age_months_est_min_list <- annot.annot_age_months_est_min[aid_list]
gets data from the “native” column “annot_age_months_est_min” in the “annot” table
Parameters: aid_list (list) – Returns: annot_age_months_est_min_list Return type: list - RESTful:
- Method: GET URL: /api/annot/age_months_est_min/
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> aid_list = ibs._get_all_aids() >>> eager = True >>> annot_age_months_est_min_list = ibs.get_annot_age_months_est_min(aid_list, eager=eager) >>> assert len(aid_list) == len(annot_age_months_est_min_list)
-
get_annot_age_months_est_min_texts
(ibs, aid_list, eager=True, nInput=None)[source]¶ annot_age_months_est_min_texts_list <- annot.annot_age_months_est_min_texts[aid_list]
gets string versions of the annotation’s native min age in months
Parameters: aid_list (list) – Returns: annot_age_months_est_min_list Return type: list - RESTful:
- Method: GET URL: /api/annot/age_months_est_min_texts/
-
get_annot_age_months_est_texts
(ibs, aid_list, eager=True, nInput=None)[source]¶ annot_age_months_est_texts_list <- annot.annot_age_months_est_texts[aid_list]
gets string versions of the annotation’s native combined age in months
Parameters: aid_list (list) – Returns: annot_age_months_est_text_list Return type: list - RESTful:
- Method: GET URL: /api/annot/age_months_est_texts/
-
get_annot_aid
(*args, **kwargs)[source]¶ self verifier .. rubric:: Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.IBEISControl import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() + [None, -1, 10434320432] >>> aid_list_ = ibs.get_annot_aid(aid_list) >>> assert [r is None for r in aid_list_[-3:]] >>> assert [r is not None for r in aid_list_[0:-3]]
-
get_annot_aids_from_semantic_uuid
(*args, **kwargs)[source]¶ Parameters: semantic_uuid_list (list) – Returns: annot rowids Return type: list - RESTful:
- Method: GET URL: /api/annot/aids_from_semantic_uuid/
-
get_annot_aids_from_uuid
(*args, **kwargs)[source]¶ Returns: list_ – annot rowids Return type: list - RESTful:
- Method: GET URL: /api/annot/aids_from_uuid/
-
get_annot_aids_from_visual_uuid
(*args, **kwargs)[source]¶ Parameters: visual_uuid_list (list) – Returns: annot rowids Return type: list - RESTful:
- Method: GET URL: /api/annot/aids_from_visual_uuid/
CommandLine:
python -m ibeis.tag_funcs --exec-get_annot_all_tags --db GZ_Master1
Example
>>> # ENABLE_DOCTEST >>> from ibeis.tag_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.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)
-
get_annot_alrids
(*args, **kwargs)[source]¶ FIXME: __name__ Get all the relationship ids belonging to the input annotations if lblannot lbltype is specified the relationship ids are filtered to be only of a specific lbltype/category/type
-
get_annot_alrids_oftype
(*args, **kwargs)[source]¶ Get all the relationship ids belonging to the input annotations where the relationship ids are filtered to be only of a specific lbltype/category/type
Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (list) – list of annotation rowids
Returns: annotmatch_tags_list
Return type: list
CommandLine:
python -m ibeis.tag_funcs --exec-get_annot_annotmatch_tags --db GZ_Master1
Example
>>> # ENABLE_DOCTEST >>> from ibeis.tag_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.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)
-
get_annot_bboxes
(input_, *args, **kwargs)[source]¶ Returns: bbox_list – annotation bounding boxes in image space Return type: list - RESTful:
- Method: GET URL: /api/annot/bboxes/
-
get_annot_been_adjusted
(ibs, aid_list)[source]¶ Returns if a bounding box has been adjusted from defaults set in use_images_as_annotations Very hacky very heurstic.
returns list of tags. Use instead of get_annot_tag_text
Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (list) – list of annotation rowids
Returns: tags_list
Return type: list
CommandLine:
python -m ibeis.tag_funcs --exec-get_annot_case_tags
Example
>>> # ENABLE_DOCTEST >>> from ibeis.tag_funcs import * # NOQA >>> from ibeis.tag_funcs import _parse_note # NOQA >>> import ibeis >>> ibs = ibeis.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)
-
get_annot_chip_dlensqrd
(ibs, aid_list, config2_=None)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (list) –
Returns: topx2_dlen_sqrd
Return type: list
CommandLine:
python -m ibeis.control.manual_chip_funcs --test-get_annot_chip_dlensqrd
- RESTful:
- Method: GET URL: /api/annot_chip/dlensqrd/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_chip_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> config2_ = {'dim_size': 450, 'resize_dim': 'area'} >>> topx2_dlen_sqrd = ibs.get_annot_chip_dlensqrd(aid_list, config2_=config2_) >>> result = str(topx2_dlen_sqrd) >>> print(result) [435409, 476505, 422500, 422500, 422500, 437924, 405000, 405000, 447805, 420953, 405008, 406265, 512674]
-
get_annot_chip_fpath
(*args, **kwargs)[source]¶ Returns the cached chip uri based off of the current configuration.
Returns: chip_fpath_list – cfpaths defined by ANNOTATIONs Return type: list - RESTful:
- Method: GET URL: /api/annot_chip/fpath/
-
get_annot_chip_sizes
(*args, **kwargs)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
- ensure (bool) – eager evaluation if True
Returns: chipsz_list - the (width, height) of computed annotation chips.
Return type: list
CommandLine:
python -m ibeis.control.manual_chip_funcs --test-get_annot_chip_sizes
- RESTful:
- Method: GET URL: /api/annot_chip/sizes/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_chip_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[0:3] >>> ensure = True >>> config2_ = {'dim_size': 450, 'resize_dim': 'area'} >>> # execute function >>> chipsz_list = get_annot_chip_sizes(ibs, aid_list, ensure, config2_=config2_) >>> # verify results >>> result = str(chipsz_list) >>> print(result) [(545, 372), (603, 336), (520, 390)]
-
get_annot_chip_thumbpath
(*args, **kwargs)[source]¶ just constructs the path. does not compute it. that is done by api_thumb_delegate
- RESTful:
- Method: GET URL: /api/annot_chip/thumbpath/
-
get_annot_chip_thumbtup
(*args, **kwargs)[source]¶ get chip thumb info The return type of this is interpreted and computed in ~/code/guitool/guitool/api_thumb_delegate.py
Parameters: - aid_list (list) –
- thumbsize (int) –
Returns: thumbtup_list - [(thumb_path, img_path, imgsize, bboxes, thetas)]
Return type: list
CommandLine:
python -m ibeis.control.manual_chip_funcs --test-get_annot_chip_thumbtup
- RESTful:
- Method: GET URL: /api/annot_chip/thumbtup/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_chip_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> thumbsize = 128 >>> result = get_annot_chip_thumbtup(ibs, aid_list, thumbsize) >>> print(result)
-
get_annot_chips
(*args, **kwargs)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
- ensure (bool) – eager evaluation if True
- config2 (QueryRequest) – query request object with hyper-parameters
Returns: chip_list
Return type: list
CommandLine:
python -m ibeis.control.manual_chip_funcs --test-get_annot_chips python -m ibeis.templates.template_generator --key chip --funcname-filter '\<get_annot_chips\>'
- RESTful:
- Method: GET URL: /api/annot_chip/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_chip_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[0:5] >>> config2_ = {'dim_size': 450, 'resize_dim': 'area'} >>> chip_list = get_annot_chips(ibs, aid_list, config2_) >>> chip_sum_list = list(map(np.sum, chip_list)) >>> ut.assert_almost_eq(chip_sum_list, [96053500, 65152954, 67223241, 109358624, 73995960], 2000) >>> print(chip_sum_list)
-
get_annot_class_labels
(ibs, aid_list)[source]¶ DEPRICATE?
Returns: identifying animal name and view Return type: list of tuples - RESTful:
- Method: GET URL: /api/annot/class_labels/
-
get_annot_contact_aids
(*args, **kwargs)[source]¶ Returns the other aids that appear in the same image that this annotation is from.
Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (list) –
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_contact_aids;1
- RESTful:
- Method: GET URL: /api/annot/contact_aids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> # execute function >>> contact_aids = ibs.get_annot_contact_aids(aid_list) >>> # verify results >>> contact_gids = ibs.unflat_map(ibs.get_annot_gids, contact_aids) >>> gid_list = ibs.get_annot_gids(aid_list) >>> for gids, gid, aids, aid in zip(contact_gids, gid_list, contact_aids, aid_list): ... assert ut.allsame(gids), 'annots should be from same image' ... assert len(gids) == 0 or gids[0] == gid, 'and same image as parent annot' ... assert aid not in aids, 'should not include self'
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb2') >>> aid_list = ibs.get_valid_aids() >>> # execute function >>> contact_aids = ibs.get_annot_contact_aids(aid_list) >>> # verify results >>> contact_gids = ibs.unflat_map(ibs.get_annot_gids, contact_aids) >>> gid_list = ibs.get_annot_gids(aid_list) >>> print('contact_aids = %r' % (contact_aids,)) >>> for gids, gid, aids, aid in zip(contact_gids, gid_list, contact_aids, aid_list): ... assert ut.allsame(gids), 'annots should be from same image' ... assert len(gids) == 0 or gids[0] == gid, 'and same image as parent annot' ... assert aid not in aids, 'should not include self'
-
get_annot_detect_confidence
(*args, **kwargs)[source]¶ Returns: list_ – a list confidences that the annotations is a valid detection Return type: list - RESTful:
- Method: GET URL: /api/annot/detect_confidence/
-
get_annot_exemplar_flags
(*args, **kwargs)[source]¶ returns if an annotation is an exemplar
Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
Returns: annot_exemplar_flag_list - True if annotation is an exemplar
Return type: list
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_exemplar_flags
- RESTful:
- Method: GET URL: /api/annot/exemplar_flags/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> # execute function >>> gid_list = get_annot_exemplar_flags(ibs, aid_list) >>> # verify results >>> result = str(gid_list) >>> print(result)
-
get_annot_featweight_rowids
(ibs, aid_list, config2_=None, ensure=True, eager=True, nInput=None)[source]¶
-
get_annot_gar_rowids
(*args, **kwargs)[source]¶ Auto-docstr for ‘get_annot_gar_rowids’
- RESTful:
- Method: GET URL: /api/annot/gar_rowids/
-
get_annot_gids
(input_, *args, **kwargs)[source]¶ Get parent image rowids of annotations
Parameters: aid_list (list) – Returns: gid_list – image rowids Return type: list - RESTful:
- Method: GET URL: /api/annot/gids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> result = get_annot_gids(ibs, aid_list) >>> print(result)
-
get_annot_groundfalse
(*args, **kwargs)[source]¶ gets all annotations with different names
Returns: groundfalse_list – a list of aids which are known to be different for each Return type: list #Example: # >>> # ENABLE_DOCTEST # >>> import ibeis # >>> ibs = ibeis.opendb(‘PZ_MTEST’) # >>> aid_list = ibs.get_valid_aids() # >>> is_exemplar, noself, daid_list = None, True, None # >>> groundfalse_list = ibs.get_annot_groundfalse(aid_list) # >>> result = str(groundtruth_list) # >>> print(result)
- RESTful:
- Method: GET URL: /api/annot/groundfalse/
-
get_annot_groundtruth
(*args, **kwargs)[source]¶ gets all annotations with the same names
Parameters: - aid_list (list) – list of annotation rowids to get groundtruth of
- is_exemplar (None) –
- noself (bool) –
- daid_list (list) –
Returns: groundtruth_list – a list of aids with the same name foreach aid in aid_list. a set of aids belonging to the same name is called a groundtruth. A list of these is called a groundtruth_list.
Return type: list
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_groundtruth:0 python -m ibeis.control.manual_annot_funcs --test-get_annot_groundtruth:1 python -m ibeis.control.manual_annot_funcs --test-get_annot_groundtruth:2 python -m --tf get_annot_groundtruth:0 --db=PZ_Master0 --aids=97 --exec-mode
- RESTful:
- Method: GET URL: /api/annot/groundtruth/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid_list = ut.get_argval('--aids', list, ibs.get_valid_aids()) >>> is_exemplar, noself, daid_list = None, True, None >>> groundtruth_list = ibs.get_annot_groundtruth(aid_list, is_exemplar, noself, daid_list) >>> result = 'groundtruth_list = ' + str(groundtruth_list) >>> print(result) groundtruth_list = [[], [3], [2], [], [6], [5], [], [], [], [], [], [], []]
- Example1:
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> is_exemplar, noself, daid_list = True, True, None >>> groundtruth_list = ibs.get_annot_groundtruth(aid_list, is_exemplar, noself, daid_list) >>> result = str(groundtruth_list) >>> print(result) [[], [3], [2], [], [6], [5], [], [], [], [], [], [], []]
- Example2:
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> is_exemplar, noself, daid_list = False, False, aid_list >>> groundtruth_list = ibs.get_annot_groundtruth(aid_list, is_exemplar, noself, daid_list) >>> result = str(groundtruth_list) >>> print(result) [[1], [], [], [4], [], [], [], [], [9], [], [11], [], []]
-
get_annot_has_groundtruth
(*args, **kwargs)[source]¶ Parameters: - aid_list (list) –
- is_exemplar (None) –
- noself (bool) –
- daid_list (list) –
Returns: has_gt_list
Return type: list
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_has_groundtruth
- RESTful:
- Method: GET URL: /api/annot/has_groundtruth/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> is_exemplar = None >>> noself = True >>> daid_list = None >>> has_gt_list = get_annot_has_groundtruth(ibs, aid_list, is_exemplar, noself, daid_list) >>> result = str(has_gt_list) >>> print(result)
-
get_annot_hashid_semantic_uuid
(ibs, aid_list, prefix=u'', pathsafe=False)[source]¶ builds an aggregate semantic hash id for a list of aids
- Args:
ibs (ibeis.IBEISController): ibeis controller object aid_list (list): list of annotation rowids prefix (str): (default = ‘’) _new (bool): Eventually we will change the hashing scheme and all old
data will be invalidated. (default=False)- Returns:
- str: semantic_uuid_hashid
- RESTful:
- Method: GET URL: /api/annot/hashid_semantic_uuid/
- CommandLine:
- python -m ibeis.control.manual_annot_funcs –test-get_annot_hashid_semantic_uuid
- Example:
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid_list = ibs.get_valid_aids()[0:2] >>> prefix = '' >>> semantic_uuid_hashid = get_annot_hashid_semantic_uuid(ibs, aid_list, prefix) >>> result = ut.list_str(ibs.get_annot_semantic_uuids(aid_list)) + '
- ‘
>>> result += ('semantic_uuid_hashid = %s' % (str(semantic_uuid_hashid),)) >>> print(result) [ UUID('bf774bf3-582d-dbce-6ca6-329adeb086a6'), UUID('60f10a02-1bd1-c2b4-75bb-a34c0a4b6867'), ] semantic_uuid_hashid = _SUUIDS((2)biovwevqycuemoik)
-
get_annot_hashid_uuid
(ibs, aid_list, prefix=u'')[source]¶ builds an aggregate random hash id for a list of aids
- RESTful:
- Method: GET URL: /api/annot/hashid_uuid/
-
get_annot_hashid_visual_uuid
(ibs, aid_list, prefix=u'', pathsafe=False)[source]¶ builds an aggregate visual hash id for a list of aids
Parameters: _new (bool) – Eventually we will change the hashing scheme and all old data will be invalidated. (default=False) - RESTful:
- Method: GET URL: /api/annot/hashid_visual_uuid/
-
get_annot_image_contributor_tag
(*args, **kwargs)[source]¶ Auto-docstr for ‘get_annot_image_contributor_tag’
- RESTful:
- Method: GET URL: /api/annot/image_contributor_tag/
-
get_annot_image_datetime
(*args, **kwargs)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
Returns: datetime_list
Return type: list
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_image_datetime
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> # execute function >>> datetime_list = get_annot_image_datetime(ibs, aid_list) >>> # verify results >>> result = str(datetime_list) >>> print(result)
-
get_annot_image_gps
(*args, **kwargs)[source]¶ Parameters: aid_list (list) – Returns: unixtime_list Return type: list - RESTful:
- Method: GET URL: /api/annot/image_gps/
-
get_annot_image_names
(*args, **kwargs)[source]¶ Parameters: aid_list (list) – Returns: gname_list the image names of each annotation Return type: list of strs - RESTful:
- Method: GET URL: /api/annot/image_names/
-
get_annot_image_paths
(*args, **kwargs)[source]¶ Parameters: aid_list (list) – Returns: gpath_list the image paths of each annotation Return type: list of strs - RESTful:
- Method: GET URL: /api/annot/image_paths/
-
get_annot_image_unixtimes
(*args, **kwargs)[source]¶ Parameters: aid_list (list) – Returns: unixtime_list Return type: list - RESTful:
- Method: GET URL: /api/annot/image_unixtimes/
-
get_annot_image_unixtimes_asfloat
(*args, **kwargs)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (list) – list of annotation rowids
Returns: unixtime_list
Return type: list
CommandLine:
python -m ibeis.control.manual_annot_funcs --exec-get_annot_image_unixtimes_asfloat --show --db PZ_MTEST
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid_list = ibs.get_valid_aids() >>> unixtime_list = get_annot_image_unixtimes_asfloat(ibs, aid_list) >>> result = ('unixtime_list = %s' % (str(unixtime_list),)) >>> print(result) >>> ut.quit_if_noshow() >>> import plottool as pt >>> ut.show_if_requested()
-
get_annot_image_uuids
(*args, **kwargs)[source]¶ Parameters: aid_list (list) – Returns: image_uuid_list Return type: list CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_image_uuids --enableall
- RESTful:
- Method: GET URL: /api/annot/image_uuids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[0:1] >>> result = get_annot_image_uuids(ibs, aid_list) >>> print(result) [UUID('66ec193a-1619-b3b6-216d-1784b4833b61')]
-
get_annot_images
(*args, **kwargs)[source]¶ Parameters: aid_list (list) – Returns: the images of each annotation Return type: list of ndarrays CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_images
- RESTful:
- Method: GET URL: /api/annot/images/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[0:1] >>> image_list = ibs.get_annot_images(aid_list) >>> result = str(map(np.shape, image_list)) >>> print(result) [(715, 1047, 3)]
-
get_annot_imgsetids
(input_, *args, **kwargs)[source]¶ Get parent image rowids of annotations
Parameters: aid_list (list) – Returns: imgsetid_list – imageset rowids Return type: list - RESTful:
- Method: GET URL: /api/annot/imgsetids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> result = get_annot_gids(ibs, aid_list) >>> print(result)
-
get_annot_info
(*args, **kwargs)[source]¶ Parameters: - ibs (ibeis.IBEISController) – ibeis controller object
- aid_list (list) – list of annotation rowids
- default (bool) – (default = False)
Returns: infodict_list
Return type: list
CommandLine:
python -m ibeis.other.ibsfuncs --exec-get_annot_info --tb
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid_list = ibs.get_valid_aids()[0:2] >>> default = True >>> infodict_list = ibs.get_annot_info(1, default) >>> result = ('infodict_list = %s' % (ut.obj_str(infodict_list, nl=4),)) >>> print(result)
-
get_annot_intermediate_viewpoint_stats
(ibs, aids, size=2)[source]¶ >>> from ibeis.other.ibsfuncs import * # NOQA >>> aids = available_aids
-
get_annot_is_hard
(ibs, aid_list)[source]¶ - CmdLine:
- ./dev.py –cmd –db PZ_Mothers
Parameters: - ibs (IBEISController) –
- aid_list (list) –
Returns: is_hard_list
Return type: list
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis # NOQA >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[0::2] >>> is_hard_list = get_annot_is_hard(ibs, aid_list) >>> result = str(is_hard_list) >>> print(result) [False, False, False, False, False, False, False]
-
get_annot_isjunk
(*args, **kwargs)[source]¶ Auto-docstr for ‘get_annot_isjunk’
- RESTful:
- Method: GET URL: /api/annot/isjunk/
-
get_annot_kpts
(input_, *args, **kwargs)[source]¶ Parameters: - aid_list (int) – list of annotation ids
- ensure (bool) – eager evaluation if True
- eager (bool) –
- nInput (None) –
- config2 (QueryRequest) – query request object with hyper-parameters
Returns: kpts_list – annotation descriptor keypoints
Return type: list
CommandLine:
python -m ibeis.control.manual_feat_funcs --test-get_annot_kpts --show python -m ibeis.control.manual_feat_funcs --test-get_annot_kpts --show --darken .9 python -m ibeis.control.manual_feat_funcs --test-get_annot_kpts --show --darken .9 --verbose python -m ibeis.control.manual_feat_funcs --test-get_annot_kpts --show --darken .9 --verbose --no-affine-invariance python -m ibeis.control.manual_feat_funcs --test-get_annot_kpts --show --darken .9 --verbose --no-affine-invariance --scale_max=20 python -m ibeis.control.manual_feat_funcs --test-get_annot_kpts --show --feat_type=hesaff+siam128 ipython -i -- --show --feat_type=hesaff+siam128
Example
>>> # SLOW_DOCTEST >>> from ibeis.control.manual_feat_funcs import * # NOQA >>> import vtool as vt >>> import numpy as np >>> import ibeis >>> import ibeis.viz.interact >>> # build test data >>> qreq1_ = ibeis.testdata_qreq_(defaultdb='testdb1', p=['default:RI=True']) >>> qreq2_ = ibeis.testdata_qreq_(defaultdb='testdb1', p=['default:RI=False']) >>> ibs = qreq1_.ibs >>> aid_list = qreq1_.get_external_qaids() >>> with ut.Indenter('[TEST_GET_ANNOT_KPTS]'): ... print('qreq1 params: ' + qreq1_.qparams.feat_cfgstr) ... print('qreq2 params: ' + qreq2_.qparams.feat_cfgstr) ... print('id(qreq1): ' + str(id(qreq1_))) ... print('id(qreq2): ' + str(id(qreq2_))) ... #print('feat_config_rowid1 = %r' % (ibs.get_feat_config_rowid(config2_=qreq1_.get_external_query_config2()),)) ... #print('feat_config_rowid2 = %r' % (ibs.get_feat_config_rowid(config2_=qreq2_.get_external_query_config2()),)) >>> # Force recomputation of features >>> with ut.Indenter('[DELETE1]'): ... ibs.delete_annot_feats(aid_list, config2_=qreq1_.get_external_query_config2()) >>> with ut.Indenter('[DELETE2]'): ... ibs.delete_annot_feats(aid_list, config2_=qreq2_.get_external_query_config2()) >>> eager, ensure, nInput = True, True, None >>> # execute function >>> with ut.Indenter('[GET1]'): ... kpts1_list = get_annot_kpts(ibs, aid_list, ensure, eager, nInput, qreq1_.get_external_query_config2()) >>> with ut.Indenter('[GET2]'): ... kpts2_list = get_annot_kpts(ibs, aid_list, ensure, eager, nInput, qreq2_.get_external_query_config2()) >>> # verify results >>> assert not np.all(vt.get_oris(kpts1_list[0]) == 0) >>> assert np.all(vt.get_oris(kpts2_list[0]) == 0) >>> ut.quit_if_noshow() >>> #ibeis.viz.viz_chip.show_chip(ibs, aid_list[0], config2_=qreq1_, ori=True) >>> ibeis.viz.interact.interact_chip.ishow_chip(ibs, aid_list[0], config2_=qreq1_.get_external_query_config2(), ori=True, fnum=1) >>> ibeis.viz.interact.interact_chip.ishow_chip(ibs, aid_list[0], config2_=qreq2_.get_external_query_config2(), ori=True, fnum=2) >>> ut.show_if_requested()
-
get_annot_kpts_distinctiveness
(ibs, aid_list, config2_=None, **kwargs)[source]¶ very hacky, but cute way to cache keypoint distinctivness
Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (list) –
- dstncvs_normer (None) –
Returns: dstncvs_list
Return type: list
CommandLine:
python -m ibeis.control.manual_ibeiscontrol_funcs --test-get_annot_kpts_distinctiveness
Example
>>> # SLOW_DOCTEST >>> from ibeis.control.manual_ibeiscontrol_funcs import * # NOQA >>> from ibeis.algo.hots import distinctiveness_normalizer >>> import ibeis >>> import numpy as np >>> config2_ = None >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids(species=const.TEST_SPECIES.ZEB_PLAIN) >>> # execute function >>> aid_list1 = aid_list[::2] >>> aid_list2 = aid_list[1::3] >>> dstncvs_list1 = get_annot_kpts_distinctiveness(ibs, aid_list1) >>> dstncvs_list2 = get_annot_kpts_distinctiveness(ibs, aid_list2) >>> dstncvs_list = get_annot_kpts_distinctiveness(ibs, aid_list) >>> print(ut.depth_profile(dstncvs_list1)) >>> stats_dict = ut.dict_stack([ut.get_stats(dstncvs) for dstncvs in dstncvs_list]) >>> print(ut.dict_str(stats_dict)) >>> assert np.all(np.array(stats_dict['min']) >= 0), 'distinctiveness was out of bounds' >>> assert np.all(np.array(stats_dict['max']) <= 1), 'distinctiveness was out of bounds'
-
get_annot_lazy_dict
(ibs, aid, config2_=None)[source]¶ Parameters: - ibs (ibeis.IBEISController) – image analysis api
- aid (int) – annotation id
- config2 (dict) – (default = None)
Returns: metadata
Return type: ut.LazyDict
CommandLine:
python -m ibeis.other.ibsfuncs --exec-get_annot_lazy_dict --show
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid = 1 >>> config2_ = None >>> metadata = get_annot_lazy_dict(ibs, aid, config2_) >>> result = ('metadata = %s' % (ut.repr3(metadata),)) >>> print(result)
-
get_annot_lazy_dict2
(ibs, aid, config=None)[source]¶ Parameters: - ibs (ibeis.IBEISController) – image analysis api
- aid (int) – annotation id
- config (dict) – (default = None)
Returns: metadata
Return type: ut.LazyDict
CommandLine:
python -m ibeis.other.ibsfuncs --exec-get_annot_lazy_dict2 --show
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid = 1 >>> config = {'dim_size': 450} >>> metadata = get_annot_lazy_dict2(ibs, aid, config) >>> result = ('metadata = %s' % (ut.repr3(metadata),)) >>> print(result)
-
get_annot_lblannot_rowids
(*args, **kwargs)[source]¶ Returns: list_ – the name id of each annotation. Return type: list
-
get_annot_lblannot_rowids_oftype
(*args, **kwargs)[source]¶ Returns: list_ – the name id of each annotation. Return type: list
-
get_annot_lblannot_value_of_lbltype
(*args, **kwargs)[source]¶ Returns: lblannot_value_list – a list of strings [‘fred’, ‘sue’, ...] for each chip identifying the animal Return type: list
-
get_annot_missing_uuid
(*args, **kwargs)[source]¶ Returns: list_ – a list of missing annot uuids Return type: list - RESTful:
- Method: GET URL: /api/annot/missing_uuid/
-
get_annot_name_rowids
(input_, *args, **kwargs)[source]¶ Returns: list_ – the name id of each annotation. Return type: list - RESTful:
- Method: GET URL: /api/annot/name_rowids/
CommandLine:
python -m ibeis.control.manual_annot_funcs --exec-get_annot_name_rowids
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> from ibeis import constants as const >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> distinguish_unknowns = True >>> nid_arr1 = np.array(ibs.get_annot_name_rowids(aid_list, distinguish_unknowns=distinguish_unknowns)) >>> nid_arr2 = np.array(ibs.get_annot_name_rowids(aid_list, distinguish_unknowns=False)) >>> nid_arr2 = np.array(ibs.get_annot_name_rowids(None, distinguish_unknowns=True)) >>> assert const.UNKNOWN_LBLANNOT_ROWID == 0 >>> assert np.all(nid_arr1[np.where(const.UNKNOWN_LBLANNOT_ROWID == nid_arr2)[0]] < 0)
-
get_annot_name_texts
(*args, **kwargs)[source]¶ Parameters: aid_list (list) – Returns: name_list. e.g: [‘fred’, ‘sue’, ...] for each annotation identifying the individual Return type: list or strs - RESTful:
- Method: GET URL: /api/annot/name_texts/
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_name_texts
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[::2] >>> result = ut.list_str(get_annot_name_texts(ibs, aid_list), nl=False) >>> print(result) ['____', 'easy', 'hard', 'jeff', '____', '____', 'zebra']
-
get_annot_nids
(ibs, aid_list, distinguish_unknowns=True)[source]¶ alias
- RESTful:
- Method: GET URL: /api/annot/nids/
-
get_annot_notes
(*args, **kwargs)[source]¶ Returns: annotation_notes_list – a list of annotation notes Return type: list - RESTful:
- Method: GET URL: /api/annot/notes/
-
get_annot_num_contact_aids
(*args, **kwargs)[source]¶ Auto-docstr for ‘get_annot_num_contact_aids’
- RESTful:
- Method: GET URL: /api/annot/num_contact_aids/
-
get_annot_num_feats
(*args, **kwargs)[source]¶ Parameters: aid_list (list) – Returns: nFeats_list – num descriptors per annotation Return type: list CommandLine:
python -m ibeis.control.manual_feat_funcs --test-get_annot_num_feats
Example
>>> # ENABLE_DOCTEST >>> # this test might fail on different machines due to >>> # determenism bugs in hesaff maybe? or maybe jpeg... >>> # in which case its hopeless >>> from ibeis.control.manual_feat_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[0:3] >>> config2_ = {'dim_size': 450, 'resize_dim': 'area'} >>> nFeats_list = get_annot_num_feats(ibs, aid_list, ensure=True, config2_=config2_) >>> print('nFeats_list = %r' % (nFeats_list,)) >>> assert len(nFeats_list) == 3 >>> ut.assert_inbounds(nFeats_list[0], 1200, 1258) >>> ut.assert_inbounds(nFeats_list[1], 900, 922) >>> ut.assert_inbounds(nFeats_list[2], 1300, 1343)
-
get_annot_num_groundtruth
(*args, **kwargs)[source]¶ Returns: list_ – number of other chips with the same name Return type: list - RESTful:
- Method: GET URL: /api/annot/num_groundtruth/
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_num_groundtruth python -m ibeis.control.manual_annot_funcs --test-get_annot_num_groundtruth:0 python -m ibeis.control.manual_annot_funcs --test-get_annot_num_groundtruth:1
- Example1:
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> noself = True >>> result = get_annot_num_groundtruth(ibs, aid_list, noself=noself) >>> print(result) [0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0]
- Example2:
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> noself = False >>> result = get_annot_num_groundtruth(ibs, aid_list, noself=noself) >>> print(result) [1, 2, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1]
-
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 ibeis.annotmatch_funcs --test-get_annot_num_reviewed_matching_aids
Example
>>> # DISABLE_DOCTEST >>> from ibeis.annotmatch_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb2') >>> aid1_list = ibs.get_valid_aids() >>> eager = True >>> nInput = None >>> # execute function >>> num_annot_reviewed_list = get_annot_num_reviewed_matching_aids(ibs, aid_list, eager, nInput) >>> # verify results >>> result = str(num_annot_reviewed_list) >>> print(result)
-
get_annot_num_verts
(*args, **kwargs)[source]¶ Returns: nVerts_list – the number of vertices that form the polygon of each chip Return type: list - RESTful:
- Method: GET URL: /api/annot/num_verts/
-
get_annot_otherimage_aids
(*args, **kwargs)[source]¶ Auto-docstr for ‘get_annot_otherimage_aids’
- RESTful:
- Method: GET URL: /api/annot/otherimage_aids/
-
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 ibeis.annotmatch_funcs --test-get_annot_pair_is_reviewed
Example
>>> # DISABLE_DOCTEST >>> from ibeis.annotmatch_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.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) >>> # execute function >>> annotmatch_reviewed_list = get_annot_pair_is_reviewed(ibs, aid1_list, aid2_list) >>> # verify results >>> reviewed_pairs = ut.compress(pairs, annotmatch_reviewed_list) >>> result = len(reviewed_pairs) >>> print(result) 104
-
get_annot_pair_lazy_dict
(ibs, qaid, daid, qconfig2_=None, dconfig2_=None)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- qaid (int) – query annotation id
- daid –
- qconfig2 (dict) – (default = None)
- dconfig2 (dict) – (default = None)
CommandLine:
python -m ibeis.other.ibsfuncs --exec-get_annot_pair_lazy_dict
Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> qaid, daid = ibs.get_valid_aids()[0:2] >>> qconfig2_ = None >>> dconfig2_ = None >>> result = get_annot_pair_lazy_dict(ibs, qaid, daid, qconfig2_, dconfig2_) >>> print(result)
-
get_annot_pair_timdelta
(ibs, aid_list1, aid_list2)[source]¶ Parameters: - ibs (IBEISController) – ibeis 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 ibeis.annotmatch_funcs --test-get_annot_pair_timdelta
Example
>>> # ENABLE_DOCTEST >>> from ibeis.annotmatch_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('PZ_MTEST') >>> aid_list = ibs.get_valid_aids(hasgt=True) >>> unixtimes = ibs.get_annot_image_unixtimes(aid_list) >>> aid_list = ut.compress(aid_list, np.array(unixtimes) != -1) >>> gt_aids_list = ibs.get_annot_groundtruth(aid_list, daid_list=aid_list) >>> aid_list1 = [aid for aid, gt_aids in zip(aid_list, gt_aids_list) if len(gt_aids) > 0][0:5] >>> aid_list2 = [gt_aids[0] for gt_aids in gt_aids_list if len(gt_aids) > 0][0:5] >>> timedelta_list = ibs.get_annot_pair_timdelta(aid_list1, aid_list2) >>> result = ut.numpy_str(timedelta_list, precision=2) >>> print(result) np.array([ 7.57e+07, 7.57e+07, 2.41e+06, 1.98e+08, 9.69e+07], dtype=np.float64)
-
get_annot_pair_truth
(ibs, aid1_list, aid2_list)[source]¶ CAREFUL: uses annot match table for truth, so only works if reviews have happend
-
get_annot_parent_aid
(*args, **kwargs)[source]¶ Returns: list_ – a list of parent (in terms of parts) annotation rowids. Return type: list - RESTful:
- Method: GET URL: /api/annot/parent_aid/
-
get_annot_probchip_fpath
(*args, **kwargs)[source]¶ Returns paths to probability images.
Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (list) – list of annotation rowids
- config2 (dict) – (default = None)
- RESTful:
- Method: GET URL: /api/annot/probchip_fpath/
Returns: probchip_fpath_list Return type: list CommandLine:
python -m ibeis.control.manual_annot_funcs --exec-get_annot_probchip_fpath --show
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='PZ_MTEST') >>> aid_list = ibs.get_valid_aids()[0:10] >>> config2_ = ibs.new_query_params({'fw_detector': 'cnn'}) >>> probchip_fpath_list = get_annot_probchip_fpath(ibs, aid_list, config2_) >>> result = ('probchip_fpath_list = %s' % (str(probchip_fpath_list),)) >>> print(result) >>> ut.quit_if_noshow() >>> import plottool as pt >>> iteract_obj = pt.interact_multi_image.MultiImageInteraction(probchip_fpath_list, nPerPage=4) >>> iteract_obj.start() >>> ut.show_if_requested()
-
get_annot_qualities
(*args, **kwargs)[source]¶ annot_quality_list <- annot.annot_quality[aid_list]
gets data from the “native” column “annot_quality” in the “annot” table
Parameters: aid_list (list) – Returns: annot_quality_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annot_quality tbl = annot
- SeeAlso:
- ibeis.const.QUALITY_INT_TO_TEXT
- RESTful:
- Method: GET URL: /api/annot/qualities/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> ibs, qreq_ = testdata_ibs() >>> aid_list = ibs._get_all_aids() >>> eager = True >>> annot_quality_list = ibs.get_annot_qualities(aid_list, eager=eager) >>> print('annot_quality_list = %r' % (annot_quality_list,)) >>> assert len(aid_list) == len(annot_quality_list)
-
get_annot_quality_texts
(*args, **kwargs)[source]¶ Auto-docstr for ‘get_annot_quality_texts’
- RESTful:
- Method: GET URL: /api/annot/quality_texts/
-
get_annot_quality_viewpoint_subset
(ibs, aid_list=None, annots_per_view=2, verbose=False)[source]¶ CommandLine:
python -m ibeis.other.ibsfuncs --exec-get_annot_quality_viewpoint_subset --show
Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb2') >>> aid_list = ibs.get_valid_aids() >>> annots_per_view = 2 >>> new_aid_list, new_flag_list = get_annot_quality_viewpoint_subset(ibs) >>> result = sum(new_flag_list) >>> print(result) 38
-
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
aid_list = ibs.get_valid_aids()
-
get_annot_rotated_verts
(*args, **kwargs)[source]¶ Returns: rotated_vert_list – verticies after rotation by theta. Return type: list - RESTful:
- Method: GET URL: /api/annot/rotated_verts/
-
get_annot_rowids_from_partial_vuuids
(*args, **kwargs)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- partial_uuid_list (list) –
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annots_from_partial_uuids
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[::2] >>> vuuids = ibs.get_annot_visual_uuids(aid_list) >>> partial_vuuid_strs = [u[0:4] for u in map(str, vuuids)] >>> aids_list = get_annot_rowids_from_partial_vuuids(ibs, partial_uuid_list) >>> print(result) [[1], [3], [5], [7], [9], [11], [13]]
-
get_annot_rows
(ibs, aid_list)[source]¶ Auto-docstr for ‘get_annot_rows’
- RESTful:
- Method: GET URL: /api/annot/rows/
-
get_annot_semantic_uuid_info
(ibs, aid_list, _visual_infotup=None)[source]¶ Semenatic uuids are made up of visual and semantic information. Semantic information is name, species, viewpoint. Visual info is image uuid, verts, and theta
Parameters: - aid_list (list) –
- _visual_infotup (tuple) – internal use only
Returns: semantic_infotup (image_uuid_list, verts_list, theta_list, yaw_list, name_list, species_list)
Return type: tuple
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_semantic_uuid_info
- RESTful:
- Method: GET URL: /api/annot/semantic_uuid_info/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.algo.preproc.preproc_annot import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[0:2] >>> semantic_infotup = ibs.get_annot_semantic_uuid_info(aid_list) >>> result = str(list(zip(*semantic_infotup))[1]) >>> print(result) (UUID('d8903434-942f-e0f5-d6c2-0dcbe3137bf7'), ((0, 0), (1035, 0), (1035, 576), (0, 576)), 0.0, None, u'easy', u'zebra_plains')
-
get_annot_semantic_uuids
(*args, **kwargs)[source]¶ annot_semantic_uuid_list <- annot.annot_semantic_uuid[aid_list]
gets data from the “native” column “annot_semantic_uuid” in the “annot” table
Parameters: aid_list (list) – Returns: annot_semantic_uuid_list Return type: list CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_semantic_uuids
- RESTful:
- Method: GET URL: /api/annot/semantic_uuids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> ibs, qreq_ = testdata_ibs() >>> aid_list = ibs._get_all_aids()[0:1] >>> annot_semantic_uuid_list = ibs.get_annot_semantic_uuids(aid_list) >>> assert len(aid_list) == len(annot_semantic_uuid_list) >>> result = annot_semantic_uuid_list [UUID('bf774bf3-582d-dbce-6ca6-329adeb086a6')]
[UUID(‘215ab5f9-fe53-d7d1-59b8-d6b5ce7e6ca6’)]
-
get_annot_sex
(ibs, aid_list, eager=True, nInput=None)[source]¶ Auto-docstr for ‘get_annot_sex’
- RESTful:
- Method: GET URL: /api/annot/sex/
-
get_annot_sex_texts
(ibs, aid_list, eager=True, nInput=None)[source]¶ Auto-docstr for ‘get_annot_sex_texts’
- RESTful:
- Method: GET URL: /api/annot/sex_texts/
-
get_annot_species_rowids
(input_, *args, **kwargs)[source]¶ species_rowid_list <- annot.species_rowid[aid_list]
gets data from the “native” column “species_rowid” in the “annot” table
Parameters: aid_list (list) – Returns: species_rowid_list Return type: list - RESTful:
- Method: GET URL: /api/annot/species_rowids/
-
get_annot_species_texts
(*args, **kwargs)[source]¶ Parameters: aid_list (list) – Returns: species_list - a list of strings [‘plains_zebra’, ‘grevys_zebra’, ...] for each annotation identifying the species Return type: list CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_species_texts
- Example1:
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[1::3] >>> result = ut.list_str(get_annot_species_texts(ibs, aid_list), nl=False) >>> print(result) ['zebra_plains', 'zebra_plains', '____', 'bear_polar']
- Example2:
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('PZ_MTEST') >>> aid_list = ibs.get_valid_aids() >>> species_list = get_annot_species_texts(ibs, aid_list) >>> result = ut.list_str(list(set(species_list)), nl=False) >>> print(result) ['zebra_plains']
- RESTful:
- Method: GET URL: /api/annot/species_texts/
-
get_annot_stats_dict
(ibs, aids, prefix=u'', forceall=False, old=True, **kwargs)[source]¶ stats for a set of annots
Parameters: - ibs (ibeis.IBEISController) – ibeis controller object
- aids (list) – list of annotation rowids
- prefix (str) – (default = ‘’)
- Kwargs:
- hashid, per_name, per_qual, per_vp, per_name_vpedge, per_image, min_name_hourdist
Returns: aid_stats_dict Return type: dict CommandLine:
python -m ibeis.other.ibsfuncs --exec-get_annot_stats_dict python -m ibeis.other.ibsfuncs --exec-get_annot_stats_dict --db PZ_Master1 --per_name_vpedge=True python -m ibeis.other.ibsfuncs --exec-get_annot_stats_dict --db PZ_Master1 --min_name_hourdist=True python -m ibeis.other.ibsfuncs --exec-get_annot_stats_dict --db GZ_ALL --min_name_hourdist=True --all python -m ibeis.other.ibsfuncs --exec-get_annot_stats_dict --db PZ_Master1 --min_name_hourdist=True --all python -m ibeis.other.ibsfuncs --exec-get_annot_stats_dict --db NNP_MasterGIRM_core --min_name_hourdist=True --all
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aids = ibs.get_valid_aids() >>> prefix = '' >>> kwkeys = ut.parse_func_kwarg_keys(get_annot_stats_dict) >>> #default = True if ut.get_argflag('--all') else None >>> default = None if ut.get_argflag('--notall') else True >>> kwargs = ut.argparse_dict(dict(zip(kwkeys, [default] * len(kwkeys)))) >>> print('kwargs = %r' % (kwargs,)) >>> aid_stats_dict = get_annot_stats_dict(ibs, aids, prefix, **kwargs) >>> result = ('aid_stats_dict = %s' % (ut.dict_str(aid_stats_dict, strvals=True, nl=True),)) >>> print(result)
-
get_annot_tag_filterflags
(ibs, aid_list, filter_kw, request_defaultkw=False)[source]¶ Filters annotations by tags including those that is belongs to in a pair
-
get_annot_tag_text
(*args, **kwargs)[source]¶ annot_tags_list <- annot.annot_tags[aid_list]
gets data from the “native” column “annot_tags” in the “annot” table
Parameters: aid_list (list) – Returns: annot_tags_list Return type: list Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> aid_list = ibs._get_all_aids() >>> eager = True >>> annot_tags_list = ibs.get_annot_tag_text(aid_list, eager=eager) >>> assert len(aid_list) == len(annot_tags_list)
-
get_annot_thetas
(*args, **kwargs)[source]¶ Returns: theta_list – a list of floats describing the angles of each chip Return type: list CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_thetas
- RESTful:
- Method: GET URL: /api/annot/thetas/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('NAUT_test') >>> aid_list = ibs.get_valid_aids() >>> result = get_annot_thetas(ibs, aid_list) >>> print(result) [2.75742, 0.792917, 2.53605, 2.67795, 0.946773, 2.56729]
-
get_annot_uuids
(*args, **kwargs)[source]¶ Returns: annot_uuid_list a list of image uuids by aid Return type: list - RESTful:
- Method: GET URL: /api/annot/uuids/
-
get_annot_vecs
(*args, **kwargs)[source]¶ Returns: vecs_list – annotation descriptor vectors Return type: list
-
get_annot_vecs_cache
(ibs, aids)[source]¶ When you have a list with duplicates and you dont want to copy data creates a reference to each data object indexed by a dict
-
get_annot_verts
(*args, **kwargs)[source]¶ Returns: vert_list – the vertices that form the polygon of each chip Return type: list - RESTful:
- Method: GET URL: /api/annot/verts/
-
get_annot_visual_uuid_info
(ibs, aid_list)[source]¶ Returns information used to compute annotation UUID. The image uuid, annotation verticies, are theta is hashted together to
compute the visual uuid.The visual uuid does not include name or species information.
get_annot_visual_uuid_info
Parameters: aid_list (list) – Returns: visual_infotup (image_uuid_list, verts_list, theta_list) Return type: tuple - SeeAlso:
- get_annot_visual_uuids get_annot_semantic_uuid_info
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_visual_uuid_info
- RESTful:
- Method: GET URL: /api/annot/visual_uuid_info/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.algo.preproc.preproc_annot import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[0:2] >>> visual_infotup = ibs.get_annot_visual_uuid_info(aid_list) >>> result = str(list(zip(*visual_infotup))[0]) >>> print(result) (UUID('66ec193a-1619-b3b6-216d-1784b4833b61'), ((0, 0), (1047, 0), (1047, 715), (0, 715)), 0.0)
-
get_annot_visual_uuids
(*args, **kwargs)[source]¶ The image uuid, annotation verticies, are theta is hashted together to compute the visual uuid. The visual uuid does not include name or species information.
annot_visual_uuid_list <- annot.annot_visual_uuid[aid_list]
gets data from the “native” column “annot_visual_uuid” in the “annot” table
Parameters: aid_list (list) – Returns: annot_visual_uuid_list Return type: list CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_visual_uuids
- RESTful:
- Method: GET URL: /api/annot/visual_uuids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> ibs, qreq_ = testdata_ibs() >>> aid_list = ibs._get_all_aids()[0:1] >>> annot_visual_uuid_list = ibs.get_annot_visual_uuids(aid_list) >>> assert len(aid_list) == len(annot_visual_uuid_list) >>> result = annot_visual_uuid_list [UUID('8687dcb6-1f1f-fdd3-8b72-8f36f9f41905')]
[UUID(‘76de0416-7c92-e1b3-4a17-25df32e9c2b4’)]
-
get_annot_yaw_texts
(*args, **kwargs)[source]¶ Auto-docstr for ‘get_annot_yaw_texts’
- RESTful:
- Method: GET URL: /api/annot/yaw_texts/
-
get_annot_yaws
(*args, **kwargs)[source]¶ A yaw is the yaw of the annotation in radians Viewpoint yaw is inverted. Will be fixed soon.
- The following views have these angles of yaw:
left side - 0.50 tau radians front side - 0.25 tau radians right side - 0.00 tau radians back side - 0.75 tau radians
tau = 2 * pi
- SeeAlso:
- ibies.const.VIEWTEXT_TO_YAW_RADIANS
Returns: yaw_list – the yaw (in radians) for the annotation Return type: list CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_yaws
- RESTful:
- Method: GET URL: /api/annot/yaws/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[::3] >>> result = get_annot_yaws(ibs, aid_list) >>> print(result) [None, None, None, None, None]
-
get_annotconfig_stats
(ibs, qaids, daids, verbose=True, combined=False, **kwargs)[source]¶ Gets statistics about a query / database set of annotations
USEFUL DEVELOPER FUNCTION
TODO: this function should return non-string values in dictionaries. The print function should do string conversions
Parameters: - ibs (IBEISController) – ibeis controller object
- qaids (list) – query annotation ids
- daids (list) – database annotation ids
- SeeAlso:
- ibeis.dbinfo.print_qd_info ibs.get_annot_stats_dict ibs.print_annotconfig_stats(qaid_list, daid_list)
CommandLine:
python -m ibeis.other.ibsfuncs --exec-get_annotconfig_stats --db PZ_MTEST -a default python -m ibeis.other.ibsfuncs --exec-get_annotconfig_stats --db testdb1 -a default python -m ibeis.other.ibsfuncs --exec-get_annotconfig_stats --db PZ_MTEST -a controlled python -m ibeis.other.ibsfuncs --exec-get_annotconfig_stats --db PZ_FlankHack -a default:qaids=allgt python -m ibeis.other.ibsfuncs --exec-get_annotconfig_stats --db PZ_MTEST -a controlled:per_name=2,min_gt=4
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> from ibeis.init import main_helpers >>> kwargs = {'per_enc': True, 'enc_per_name': True} >>> ibs, qaids, daids = main_helpers.testdata_expanded_aids(defaultdb='testdb1') >>> _ = get_annotconfig_stats(ibs, qaids, daids, **kwargs)
-
get_annotgroup_gar_rowids
(*args, **kwargs)[source]¶ Auto-docstr for ‘get_annotgroup_gar_rowids’
- RESTful:
- Method: GET URL: /api/annotgroup/gar_rowids/
-
get_annotgroup_note
(*args, **kwargs)[source]¶ annotgroup_note_list <- annotgroup.annotgroup_note[annotgroup_rowid_list]
gets data from the “native” column “annotgroup_note” in the “annotgroup” table
Parameters: annotgroup_rowid_list (list) – Returns: annotgroup_note_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotgroup_note tbl = annotgroup
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annotgroup_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> annotgroup_rowid_list = ibs._get_all_annotgroup_rowids() >>> eager = True >>> annotgroup_note_list = ibs.get_annotgroup_note(annotgroup_rowid_list, eager=eager) >>> assert len(annotgroup_rowid_list) == len(annotgroup_note_list)
-
get_annotgroup_rowid_from_superkey
(ibs, annotgroup_text_list, eager=True, nInput=None)[source]¶ annotgroup_rowid_list <- annotgroup[annotgroup_text_list]
Parameters: lists (superkey) – annotgroup_text_list Returns: annotgroup_rowid_list - TemplateInfo:
- Tgetter_native_rowid_from_superkey tbl = annotgroup
-
get_annotgroup_text
(*args, **kwargs)[source]¶ annotgroup_text_list <- annotgroup.annotgroup_text[annotgroup_rowid_list]
gets data from the “native” column “annotgroup_text” in the “annotgroup” table
Parameters: annotgroup_rowid_list (list) – Returns: annotgroup_text_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotgroup_text tbl = annotgroup
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annotgroup_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> annotgroup_rowid_list = ibs._get_all_annotgroup_rowids() >>> eager = True >>> annotgroup_text_list = ibs.get_annotgroup_text(annotgroup_rowid_list, eager=eager) >>> assert len(annotgroup_rowid_list) == len(annotgroup_text_list)
-
get_annotgroup_uuid
(*args, **kwargs)[source]¶ annotgroup_uuid_list <- annotgroup.annotgroup_uuid[annotgroup_rowid_list]
gets data from the “native” column “annotgroup_uuid” in the “annotgroup” table
Parameters: annotgroup_rowid_list (list) – Returns: annotgroup_uuid_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotgroup_uuid tbl = annotgroup
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annotgroup_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> annotgroup_rowid_list = ibs._get_all_annotgroup_rowids() >>> eager = True >>> annotgroup_uuid_list = ibs.get_annotgroup_uuid(annotgroup_rowid_list, eager=eager) >>> assert len(annotgroup_rowid_list) == len(annotgroup_uuid_list)
-
get_annotmatch_aid1
(*args, **kwargs)[source]¶ aid1_list <- annotmatch.aid1[annotmatch_rowid_list]
gets data from the “native” column “aid1” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: aid1_list Return type: list - TemplateInfo:
- Tgetter_table_column col = aid1 tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> aid1_list = ibs.get_annotmatch_aid1(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(aid1_list)
-
get_annotmatch_aid2
(*args, **kwargs)[source]¶ aid2_list <- annotmatch.aid2[annotmatch_rowid_list]
gets data from the “native” column “aid2” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: aid2_list Return type: list - TemplateInfo:
- Tgetter_table_column col = aid2 tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> aid2_list = ibs.get_annotmatch_aid2(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(aid2_list)
Parameters: - ibs (IBEISController) – ibeis controller object
- annotmatch_rowids –
Returns: filtered_aid_list
Return type: list
CommandLine:
python -m ibeis.tag_funcs --exec-get_annotmatch_case_tags
Example
>>> # DISABLE_DOCTEST >>> from ibeis.tag_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.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']]
-
get_annotmatch_confidence
(*args, **kwargs)[source]¶ annotmatch_confidence_list <- annotmatch.annotmatch_confidence[annotmatch_rowid_list]
gets data from the “native” column “annotmatch_confidence” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: annotmatch_confidence_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotmatch_confidence tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> annotmatch_confidence_list = ibs.get_annotmatch_confidence(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(annotmatch_confidence_list)
-
get_annotmatch_config_hashid
(*args, **kwargs)[source]¶ config_hashid_list <- annotmatch.config_hashid[annotmatch_rowid_list]
gets data from the “native” column “config_hashid” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: config_hashid_list Return type: list - TemplateInfo:
- Tgetter_table_column col = config_hashid tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> config_hashid_list = ibs.get_annotmatch_config_hashid(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(config_hashid_list)
-
get_annotmatch_pairwise_prob
(*args, **kwargs)[source]¶ annotmatch_pairwise_prob_list <- annotmatch.annotmatch_pairwise_prob[annotmatch_rowid_list]
gets data from the “native” column “annotmatch_pairwise_prob” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: annotmatch_pairwise_prob_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotmatch_pairwise_prob tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> annotmatch_pairwise_prob_list = ibs.get_annotmatch_pairwise_prob(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(annotmatch_pairwise_prob_list)
-
get_annotmatch_posixtime_modified
(*args, **kwargs)[source]¶ annotmatch_posixtime_modified_list <- annotmatch.annotmatch_posixtime_modified[annotmatch_rowid_list]
gets data from the “native” column “annotmatch_posixtime_modified” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: annotmatch_posixtime_modified_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotmatch_posixtime_modified tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> annotmatch_posixtime_modified_list = ibs.get_annotmatch_posixtime_modified(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(annotmatch_posixtime_modified_list)
-
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 ibeis.tag_funcs --exec-get_annotmatch_prop
Example
>>> # DISABLE_DOCTEST >>> # Test setting and getting standard keys >>> from ibeis.tag_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.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 ibeis.tag_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.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,))
-
get_annotmatch_reviewed
(*args, **kwargs)[source]¶ annotmatch_reviewed_list <- annotmatch.annotmatch_reviewed[annotmatch_rowid_list]
gets data from the “native” column “annotmatch_reviewed” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: annotmatch_reviewed_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotmatch_reviewed tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> annotmatch_reviewed_list = ibs.get_annotmatch_reviewed(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(annotmatch_reviewed_list)
-
get_annotmatch_reviewer
(*args, **kwargs)[source]¶ annotmatch_reviewer_list <- annotmatch.annotmatch_reviewer[annotmatch_rowid_list]
gets data from the “native” column “annotmatch_reviewer” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: annotmatch_reviewer_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotmatch_reviewer tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> annotmatch_reviewer_list = ibs.get_annotmatch_reviewer(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(annotmatch_reviewer_list)
-
get_annotmatch_rowid
(*args, **kwargs)[source]¶ annotmatch_rowid_list <- annotmatch.annotmatch_rowid[annotmatch_rowid_list]
gets data from the “native” column “annotmatch_rowid” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: annotmatch_rowid_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotmatch_rowid tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> annotmatch_rowid_list = ibs.get_annotmatch_rowid(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(annotmatch_rowid_list)
-
get_annotmatch_rowid_from_superkey
(ibs, aid1_list, aid2_list, eager=True, nInput=None)[source]¶ annotmatch_rowid_list <- annotmatch[aid1_list, aid2_list]
Parameters: lists (superkey) – aid1_list, aid2_list Returns: annotmatch_rowid_list - TemplateInfo:
- Tgetter_native_rowid_from_superkey tbl = annotmatch
-
get_annotmatch_rowids_from_aid
(ibs, aid_list, eager=True, nInput=None, force_method=None)[source]¶ Undirected version
TODO autogenerate
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 ibeis.annotmatch_funcs --exec-get_annotmatch_rowids_from_aid python -m ibeis.annotmatch_funcs --exec-get_annotmatch_rowids_from_aid:1 --show
Example
>>> # DISABLE_DOCTEST >>> from ibeis.annotmatch_funcs import * # NOQA >>> import ibeis >>> # setup_pzmtest_subgraph() >>> ibs = ibeis.opendb(defaultdb='PZ_MTEST') >>> aid_list = ibs.get_valid_aids()[0:4] >>> eager = True >>> nInput = None >>> annotmatch_rowid_list = get_annotmatch_rowids_from_aid(ibs, aid_list, >>> eager, nInput) >>> result = ('annotmatch_rowid_list = %s' % (str(annotmatch_rowid_list),)) >>> print(result)
- Example2:
>>> # TIME TEST >>> # setup_pzmtest_subgraph() >>> from ibeis.annotmatch_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='PZ_Master1') >>> aid_list = ibs.get_valid_aids() >>> from functools import partial >>> func_list = [ >>> partial(ibs.get_annotmatch_rowids_from_aid), >>> partial(ibs.get_annotmatch_rowids_from_aid, force_method=1), >>> partial(ibs.get_annotmatch_rowids_from_aid, force_method=2), >>> ] >>> num_list = [1, 10, 50, 100, 300, 325, 350, 400, 500] >>> def args_list(count, aid_list=aid_list, num_list=num_list): >>> return (aid_list[0:num_list[count]],) >>> searchkw = dict( >>> func_labels=['combo', 'sql', 'numpy'], >>> count_to_xtick=lambda count, args: len(args[0]), >>> title='Timings of get_annotmatch_rowids_from_aid', >>> ) >>> niters = len(num_list) >>> time_result = ut.gridsearch_timer(func_list, args_list, niters, **searchkw) >>> time_result['plot_timings']() >>> ut.show_if_requested()
-
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: ibeis controller object :type ibs: IBEISController :param aid1_list: :type aid1_list: list :param eager: (default = True) :type eager: bool :param nInput: (default = None)
Returns: annotmatch_rowid_list Return type: list
-
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
TODO autogenerate
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 ibeis.annotmatch_funcs --exec-get_annotmatch_rowids_from_aid2 --show
- Example2:
>>> # TIME TEST >>> # setup_pzmtest_subgraph() >>> from ibeis.annotmatch_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='PZ_Master1') >>> aid2_list = ibs.get_valid_aids() >>> func_list = [ >>> partial(ibs.get_annotmatch_rowids_from_aid2, force_method=1), >>> partial(ibs.get_annotmatch_rowids_from_aid2, force_method=2), >>> ] >>> num_list = [1, 10, 50, 100, 300, 325, 350, 400, 500] >>> def args_list(count, aid2_list=aid2_list, num_list=num_list): >>> return (aid2_list[0:num_list[count]],) >>> searchkw = dict( >>> func_labels=['sql', 'numpy'], >>> count_to_xtick=lambda count, args: len(args[0]), >>> title='Timings of get_annotmatch_rowids_from_aid2', >>> ) >>> niters = len(num_list) >>> time_result = ut.gridsearch_timer(func_list, args_list, niters, **searchkw) >>> time_result['plot_timings']() >>> ut.show_if_requested()
-
get_annotmatch_tag_text
(*args, **kwargs)[source]¶ annotmatch_tag_text_list <- annotmatch.annotmatch_tag_text[annotmatch_rowid_list]
gets data from the “native” column “annotmatch_tag_text” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: annotmatch_tag_text_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotmatch_tag_text tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> annotmatch_tag_text_list = ibs.get_annotmatch_tag_text(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(annotmatch_tag_text_list)
-
get_annotmatch_truth
(*args, **kwargs)[source]¶ annotmatch_truth_list <- annotmatch.annotmatch_truth[annotmatch_rowid_list]
gets data from the “native” column “annotmatch_truth” in the “annotmatch” table
Parameters: annotmatch_rowid_list (list) – Returns: annotmatch_truth_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotmatch_truth tbl = annotmatch
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_annotmatch_funcs import * # NOQA >>> ibs, config2_ = testdata_annotmatch() >>> annotmatch_rowid_list = ibs._get_all_annotmatch_rowids() >>> eager = True >>> annotmatch_truth_list = ibs.get_annotmatch_truth(annotmatch_rowid_list, eager=eager) >>> assert len(annotmatch_rowid_list) == len(annotmatch_truth_list)
-
get_config_contributor_rowid
(*args, **kwargs)[source]¶ Returns: cfgsuffix_list – contributor’s rowid for algorithm configs Return type: list - RESTful:
- Method: GET URL: /api/contributor/config_rowid/
-
get_config_rowid_from_suffix
(*args, **kwargs)[source]¶ Gets an algorithm configuration as a string
DEPRICATE
- RESTful:
- Method: GET URL: /api/contributor/config_rowid_from_suffix/
Parameters: - ibs (IBEISController) – ibeis controller object
- cfgsuffix_list (list) –
Returns: gid_list
Return type: list
CommandLine:
python -m ibeis.control.manual_meta_funcs --exec-get_config_rowid_from_suffix
-
get_config_suffixes
(*args, **kwargs)[source]¶ Returns: cfgsuffix_list – suffixes for algorithm configs Return type: list - RESTful:
- Method: GET URL: /api/contributor/config_suffixes/
-
get_consecutive_newname_list_via_species
(ibs, imgsetid=None)[source]¶ Just creates the nams, but does not set them
Parameters: ibs (IBEISController) – ibeis controller object CommandLine:
python -m ibeis.other.ibsfuncs --test-get_consecutive_newname_list_via_species
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> ibs._clean_species() >>> # execute function >>> imgsetid = None >>> new_nid_list, new_name_list = get_consecutive_newname_list_via_species(ibs, imgsetid=imgsetid) >>> result = ut.list_str((new_nid_list, new_name_list)) >>> # verify results >>> print(result) ( [1, 2, 3, 4, 5, 6, 7], ['IBEIS_PZ_0001', 'IBEIS_PZ_0002', 'IBEIS_UNKNOWN_0001', 'IBEIS_UNKNOWN_0002', 'IBEIS_GZ_0001', 'IBEIS_PB_0001', 'IBEIS_UNKNOWN_0003'], )
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> ibs._clean_species() >>> ibs.delete_all_imagesets() >>> ibs.compute_occurrences() >>> # execute function >>> imgsetid = ibs.get_valid_imgsetids()[1] >>> new_nid_list, new_name_list = get_consecutive_newname_list_via_species(ibs, imgsetid=imgsetid) >>> result = ut.list_str((new_nid_list, new_name_list)) >>> # verify results >>> print(result) ( [4, 5, 6, 7], ['IBEIS_UNKNOWN_Occurrence_1_0001', 'IBEIS_GZ_Occurrence_1_0001', 'IBEIS_PB_Occurrence_1_0001', 'IBEIS_UNKNOWN_Occurrence_1_0002'], )
-
get_contributor_city
(*args, **kwargs)[source]¶ Returns: contrib_city_list – a contributor’s location - city Return type: list - RESTful:
- Method: GET URL: /api/contributor/city/
-
get_contributor_config_rowids
(*args, **kwargs)[source]¶ Returns: config_rowid_list – config rowids for a contributor Return type: list - RESTful:
- Method: GET URL: /api/contributor/config_rowids/
-
get_contributor_country
(*args, **kwargs)[source]¶ Returns: contrib_country_list – a contributor’s location - country Return type: list - RESTful:
- Method: GET URL: /api/contributor/country/
-
get_contributor_first_name
(*args, **kwargs)[source]¶ Returns: contrib_name_first_list – a contributor’s first name Return type: list - RESTful:
- Method: GET URL: /api/contributor/first_name/
-
get_contributor_gids
(*args, **kwargs)[source]¶ TODO: Template 1_M reverse getter
Returns: gid_list – gids for a contributor Return type: list - RESTful:
- Method: GET URL: /api/contributor/gids/
-
get_contributor_imgsetids
(*args, **kwargs)[source]¶ Returns: imgsetid_list – imgsetids for a contributor Return type: list - RESTful:
- Method: GET URL: /api/contributor/imgsetids/
-
get_contributor_last_name
(*args, **kwargs)[source]¶ Returns: contrib_name_last_list – a contributor’s last name Return type: list - RESTful:
- Method: GET URL: /api/contributor/last_name/
-
get_contributor_location_string
(*args, **kwargs)[source]¶ Returns: contrib_list – a contributor’s location Return type: list - RESTful:
- Method: GET URL: /api/contributor/location_string/
-
get_contributor_name_string
(*args, **kwargs)[source]¶ Returns: contrib_name_list – a contributor’s full name Return type: list - RESTful:
- Method: GET URL: /api/contributor/name_string/
-
get_contributor_note
(*args, **kwargs)[source]¶ Returns: contrib_note_list – a contributor’s note Return type: list - RESTful:
- Method: GET URL: /api/contributor/note/
-
get_contributor_rowid_from_tag
(*args, **kwargs)[source]¶ Returns: contrib_rowid_list – a contributor Return type: list - RESTful:
- Method: GET URL: /api/contributor/rowid_from_tag/
-
get_contributor_rowid_from_uuid
(*args, **kwargs)[source]¶ Returns: contrib_rowid_list – a contributor Return type: list - RESTful:
- Method: GET URL: /api/contributor/rowid_from_uuid/
-
get_contributor_state
(*args, **kwargs)[source]¶ Returns: list_ – a contributor’s location - state Return type: list - RESTful:
- Method: GET URL: /api/contributor/state/
-
get_contributor_tag
(*args, **kwargs)[source]¶ contributor_tag_list <- contributor.contributor_tag[contributor_rowid_list]
gets data from the “native” column “contributor_tag” in the “contributor” table
Parameters: contributor_rowid_list (list) – Returns: contributor_tag_list - a contributor’s tag Return type: list - TemplateInfo:
- Tgetter_table_column col = contributor_tag tbl = contributor
CommandLine:
python -m ibeis.templates.template_generator --key contributor --Tcfg with_api_cache=False with_deleters=False
- RESTful:
- Method: GET URL: /api/contributor/tag/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_meta_funcs import * # NOQA >>> ibs, qreq_ = testdata_ibs() >>> contributor_rowid_list = ibs._get_all_contributor_rowids() >>> eager = True >>> contributor_tag_list = ibs.get_contributor_tag(contributor_rowid_list, eager=eager) >>> assert len(contributor_rowid_list) == len(contributor_tag_list)
-
get_contributor_uuid
(*args, **kwargs)[source]¶ Returns: contrib_uuid_list – a contributor’s uuid Return type: list - RESTful:
- Method: GET URL: /api/contributor/uuid/
-
get_contributor_zip
(*args, **kwargs)[source]¶ Returns: contrib_zip_list – a contributor’s location - zip Return type: list - RESTful:
- Method: GET URL: /api/contributor/zip/
-
get_database_species
(ibs, aid_list=None)[source]¶ CommandLine:
python -m ibeis.other.ibsfuncs --test-get_database_species
- Example1:
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis # NOQA >>> ibs = ibeis.opendb('testdb1') >>> result = ut.list_str(ibs.get_database_species(), nl=False) >>> print(result) ['____', 'bear_polar', 'zebra_grevys', 'zebra_plains']
- Example2:
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis # NOQA >>> ibs = ibeis.opendb('PZ_MTEST') >>> result = ut.list_str(ibs.get_database_species(), nl=False) >>> print(result) ['zebra_plains']
-
get_database_species_count
(ibs, aid_list=None)[source]¶ CommandLine:
python -m ibeis.other.ibsfuncs --test-get_database_species_count
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis # NOQA >>> #print(ut.dict_str(ibeis.opendb('PZ_Master0').get_database_species_count())) >>> ibs = ibeis.opendb('testdb1') >>> result = ut.dict_str(ibs.get_database_species_count(), nl=False) >>> print(result) {'____': 3, 'bear_polar': 2, 'zebra_grevys': 2, 'zebra_plains': 6}
-
get_database_version
(ibs, db)[source]¶ Gets the specified database version from the controller
- RESTful:
- Method: GET URL: /api/core/dbversion/
-
get_dominant_species
(ibs, aid_list)[source]¶ Parameters: aid_list (int) – list of annotation ids CommandLine:
python -m ibeis.other.ibsfuncs --test-get_dominant_species
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> result = get_dominant_species(ibs, aid_list) >>> print(result) zebra_plains
-
get_empty_nids
(ibs)[source]¶ get name rowids that do not have any annotations (not including UNKONWN)
Returns: nid_list - all names without any animals (does not include unknown names) an nid is not invalid if it has a valid alias Return type: list CommandLine:
python -m ibeis.control.manual_name_funcs --test-get_empty_nids
- RESTful:
- Method: GET URL: /api/name/empty_nids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> new_nid_list = ibs.make_next_nids(num=2) >>> empty_nids = ibs.get_empty_nids() >>> assert len(empty_nids) == 2, 'get_empty_nids fails1' >>> assert new_nid_list == empty_nids, 'get_empty_nids fails2' >>> ibs.delete_empty_nids() >>> empty_nids2 = ibs.get_empty_nids() >>> assert len(empty_nids2) == 0, 'get_empty_nids fails3' >>> result = str(empty_nids2) >>> print(result) []
-
get_gar_aid
(*args, **kwargs)[source]¶ aid_list <- gar.aid[gar_rowid_list]
gets data from the “native” column “aid” in the “gar” table
Parameters: gar_rowid_list (list) – Returns: aid_list Return type: list - TemplateInfo:
- Tgetter_table_column col = aid tbl = gar
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_garelate_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> gar_rowid_list = ibs._get_all_gar_rowids() >>> eager = True >>> aid_list = ibs.get_gar_aid(gar_rowid_list, eager=eager) >>> assert len(gar_rowid_list) == len(aid_list)
-
get_gar_annotgroup_rowid
(*args, **kwargs)[source]¶ annotgroup_rowid_list <- gar.annotgroup_rowid[gar_rowid_list]
gets data from the “native” column “annotgroup_rowid” in the “gar” table
Parameters: gar_rowid_list (list) – Returns: annotgroup_rowid_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotgroup_rowid tbl = gar
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_garelate_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> gar_rowid_list = ibs._get_all_gar_rowids() >>> eager = True >>> annotgroup_rowid_list = ibs.get_gar_annotgroup_rowid(gar_rowid_list, eager=eager) >>> assert len(gar_rowid_list) == len(annotgroup_rowid_list)
-
get_gar_rowid_from_superkey
(ibs, annotgroup_rowid_list, aid_list, eager=True, nInput=None)[source]¶ gar_rowid_list <- gar[annotgroup_rowid_list, aid_list]
Parameters: lists (superkey) – annotgroup_rowid_list, aid_list Returns: gar_rowid_list - TemplateInfo:
- Tgetter_native_rowid_from_superkey tbl = gar
-
get_glr_confidence
(*args, **kwargs)[source]¶ Returns: list_ – confidence in an image relationship Return type: list
-
get_glr_config_rowid
(*args, **kwargs)[source]¶ Returns: list_ – config_rowid in an image relationship Return type: list
-
get_glr_lblimage_rowids
(*args, **kwargs)[source]¶ get the lblimage_rowid belonging to each relationship
-
get_glrid_from_superkey
(*args, **kwargs)[source]¶ Parameters: - gid_list (list) – list of image row-ids
- lblimage_rowid_list (list) – list of lblimage row-ids
- config_rowid_list (list) – list of config row-ids
Returns: glrid_list – image-label relationship id list
Return type: list
-
get_gsgr_rowid_from_superkey
(*args, **kwargs)[source]¶ Returns: gsgrid_list – eg-relate-ids from info constrained to be unique (imgsetid, gid) Return type: list
-
get_image_aids
(*args, **kwargs)[source]¶ Returns: list_ – a list of aids for each image by gid
Return type: list
Parameters: - ibs (IBEISController) – ibeis controller object
- gid_list (list) –
Returns: aids_list
Return type: list
CommandLine:
python -m ibeis.control.manual_image_funcs --test-get_image_aids
- RESTful:
- Method: GET URL: /api/image/aids/
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> gid_list = ibs.get_annot_gids(ibs.get_valid_aids()) >>> gid_list = gid_list + gid_list[::5] >>> # execute function >>> aids_list = get_image_aids(ibs, gid_list) >>> # verify results >>> result = str(aids_list) >>> print(result) [[1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [1], [6], [11]]
-
get_image_aids_of_species
(*args, **kwargs)[source]¶ Returns: list_ – a list of aids for each image by gid filtered by species Return type: list - RESTful:
- Method: GET URL: /api/image/aids_of_species/
-
get_image_contributor_rowid
(*args, **kwargs)[source]¶ contributor_rowid_list <- image.contributor_rowid[image_rowid_list]
gets data from the “native” column “contributor_rowid” in the “image” table
Parameters: image_rowid_list (list) – Returns: contributor_rowid_list - list of image contributor rowids by gid Return type: list - TemplateInfo:
- Tgetter_table_column col = contributor_rowid tbl = image
- RESTful:
- Method: GET URL: /api/image/contributor_rowid/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> image_rowid_list = ibs._get_all_image_rowids() >>> eager = True >>> contributor_rowid_list = ibs.get_image_contributor_rowid(image_rowid_list, eager=eager) >>> assert len(image_rowid_list) == len(contributor_rowid_list)
-
get_image_contributor_tag
(*args, **kwargs)[source]¶ contributor_tag_list <- image.contributor_tag[image_rowid_list]
Parameters: image_rowid_list (list) – Returns: contributor_tag_list Return type: list - TemplateInfo:
- Tgetter_extern tbl = image externtbl = contributor externcol = contributor_tag
- RESTful:
- Method: GET URL: /api/image/contributor_tag/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> image_rowid_list = ibs._get_all_image_rowids() >>> eager = True >>> contributor_tag_list = ibs.get_image_contributor_tag(image_rowid_list, eager=eager) >>> assert len(image_rowid_list) == len(contributor_tag_list)
-
get_image_detect_confidence
(*args, **kwargs)[source]¶ Returns: list_ – image detection confidence as the max of ANNOTATION confidences Return type: list - RESTful:
- Method: GET URL: /api/image/detect_confidence/
-
get_image_detectpaths
(*args, **kwargs)[source]¶ Returns: list_ – a list of image paths resized to a constant area for detection Return type: list - RESTful:
- Method: GET URL: /api/image/detectpaths/
-
get_image_enabled
(*args, **kwargs)[source]¶ Returns: list_ – “Image Enabled” flag, true if the image is enabled Return type: list - RESTful:
- Method: GET URL: /api/image/enabled/
-
get_image_exts
(*args, **kwargs)[source]¶ Returns: list_ – a list of image uuids by gid Return type: list - RESTful:
- Method: GET URL: /api/image/exts/
-
get_image_gid
(*args, **kwargs)[source]¶ self verifier
CommandLine:
python -m ibeis.control.manual_image_funcs --exec-get_image_gid
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.IBEISControl import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> gid_list = ibs.get_valid_gids() + [None, -1, 10434320432] >>> gid_list_ = ibs.get_image_gid(gid_list) >>> assert [r is None for r in gid_list_[-3:]] >>> assert [r is not None for r in gid_list_[0:-3]] >>> print('gid_list_ = %r' % (gid_list_,))
-
get_image_gids_from_uuid
(*args, **kwargs)[source]¶ Returns: list_ – a list of original image names Return type: list - RESTful:
- Method: GET URL: /api/image/gids_from_uuid/
-
get_image_glrids
(*args, **kwargs)[source]¶ FIXME: __name__ Get all the relationship ids belonging to the input images if lblimage lbltype is specified the relationship ids are filtered to be only of a specific lbltype/category/type
-
get_image_gnames
(*args, **kwargs)[source]¶ Parameters: gid_list (list) – Returns: gname_list - a list of original image names Return type: list CommandLine:
python -m ibeis.control.manual_image_funcs --test-get_image_gnames
- RESTful:
- Method: GET URL: /api/image/gnames/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> gid_list = ibs.get_valid_gids() >>> # execute function >>> gname_list = get_image_gnames(ibs, gid_list) >>> # verify results >>> result = ut.list_str(gname_list) >>> print(result) [ 'easy1.JPG', 'easy2.JPG', 'easy3.JPG', 'hard1.JPG', 'hard2.JPG', 'hard3.JPG', 'jeff.png', 'lena.jpg', 'occl1.JPG', 'occl2.JPG', 'polar1.jpg', 'polar2.jpg', 'zebra.jpg', ]
-
get_image_gps
(*args, **kwargs)[source]¶ Returns: gps_list – -1 if no timedata exists for a given gid Return type: list - RESTful:
- Method: GET URL: /api/image/gps/
-
get_image_gsgrids
(*args, **kwargs)[source]¶ Returns: list_ – a list of imageset-image-relationship rowids for each imageid Return type: list
-
get_image_heights
(*args, **kwargs)[source]¶ Returns: list_ – a list of (width, height) tuples Return type: list - RESTful:
- Method: GET URL: /api/image/heights/
-
get_image_imagesettext
(*args, **kwargs)[source]¶ Returns: list_ – a list of imagesettexts for each image by gid Return type: list - RESTful:
- Method: GET URL: /api/image/imagesettext/
-
get_image_imgsetids
(*args, **kwargs)[source]¶ Returns: list_ – a list of imageset ids for each image by gid Return type: list - RESTful:
- Method: GET URL: /api/image/imgsetids/
-
get_image_location_codes
(ibs, image_rowid_list, eager=True)[source]¶ image_location_code_list <- image.image_location_code[image_rowid_list]
gets data from the “native” column “image_location_code” in the “image” table
Parameters: image_rowid_list (list) – Returns: image_location_code_list Return type: list - TemplateInfo:
- Tgetter_table_column col = image_location_code tbl = image
- RESTful:
- Method: GET URL: /api/image/location_codes/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> image_rowid_list = ibs._get_all_image_rowids() >>> eager = True >>> image_location_code_list = ibs.get_image_location_codes(image_rowid_list, eager=eager) >>> assert len(image_rowid_list) == len(image_location_code_list)
-
get_image_missing_uuid
(*args, **kwargs)[source]¶ Returns: list_ – a list of missing image uuids Return type: list - RESTful:
- Method: GET URL: /api/image/missing_uuid/
-
get_image_nids
(*args, **kwargs)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- gid_list (list) –
Returns: nids_list - the name ids associated with an image id
Return type: list
CommandLine:
python -m ibeis.control.manual_image_funcs --test-get_image_nids
- RESTful:
- Method: GET URL: /api/image/nids/
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> gid_list = ibs.get_valid_gids() >>> # execute function >>> nids_list = ibs.get_image_nids(gid_list) >>> # verify results >>> result = str(nids_list) >>> print(result)
-
get_image_notes
(*args, **kwargs)[source]¶ Returns: list_ – image notes Return type: list - RESTful:
- Method: GET URL: /api/image/notes/
-
get_image_num_annotations
(*args, **kwargs)[source]¶ Returns: list_ – the number of chips in each image Return type: list - RESTful:
- Method: GET URL: /api/image/num_annotations/
-
get_image_orientation_str
(*args, **kwargs)[source]¶ - RESTful:
- Method: GET URL: /api/image/orientation_str/
-
get_image_party_rowids
(*args, **kwargs)[source]¶ party_rowid_list <- image.party_rowid[image_rowid_list]
gets data from the “native” column “party_rowid” in the “image” table
Parameters: image_rowid_list (list) – Returns: party_rowid_list Return type: list - TemplateInfo:
- Tgetter_table_column col = party_rowid tbl = image
- RESTful:
- Method: GET URL: /api/image/party_rowids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> image_rowid_list = ibs._get_all_image_rowids() >>> eager = True >>> party_rowid_list = ibs.get_image_party_rowids(image_rowid_list, eager=eager) >>> assert len(image_rowid_list) == len(party_rowid_list)
-
get_image_party_tag
(*args, **kwargs)[source]¶ party_tag_list <- image.party_tag[image_rowid_list]
Parameters: image_rowid_list (list) – Returns: party_tag_list Return type: list - TemplateInfo:
- Tgetter_extern tbl = image externtbl = party externcol = party_tag
- RESTful:
- Method: GET URL: /api/image/party_tag/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> image_rowid_list = ibs._get_all_image_rowids() >>> eager = True >>> party_tag_list = ibs.get_image_party_tag(image_rowid_list, eager=eager) >>> assert len(image_rowid_list) == len(party_tag_list)
-
get_image_paths
(*args, **kwargs)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- gid_list (list) – a list of image absolute paths to img_dir
Returns: gpath_list
Return type: list
CommandLine:
python -m ibeis.control.manual_image_funcs --test-get_image_paths
- RESTful:
- Method: GET URL: /api/image/paths/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> #gid_list = ibs.get_valid_gids() >>> # execute function >>> #gpath_list = get_image_paths(ibs, gid_list) >>> new_gpath = ut.unixpath(ut.grab_test_imgpath('carl.jpg')) >>> gid_list = ibs.add_images([new_gpath], auto_localize=False) >>> new_gpath_list = get_image_paths(ibs, gid_list) >>> # verify results >>> ut.assert_eq(new_gpath, new_gpath_list[0]) >>> result = str(new_gpath_list) >>> # clean up the database! >>> ibs.delete_images(gid_list) >>> # ibs.delete_images(new_gids) >>> print(result)
-
get_image_reviewed
(*args, **kwargs)[source]¶ Returns: list_ – “All Instances Found” flag, true if all objects of interest Return type: list (animals) have an ANNOTATION in the image
- RESTful:
- Method: GET URL: /api/image/reviewed/
-
get_image_sizes
(*args, **kwargs)[source]¶ Returns: list_ – a list of (width, height) tuples Return type: list - RESTful:
- Method: GET URL: /api/image/sizes/
-
get_image_species_rowids
(*args, **kwargs)[source]¶ Returns: list_ – the name ids associated with an image id Return type: list - RESTful:
- Method: GET URL: /api/image/species_rowids/
-
get_image_thumbpath
(*args, **kwargs)[source]¶ Returns: list_ – the thumbnail path of each gid Return type: list - RESTful:
- Method: GET URL: /api/image/thumbpath/
-
get_image_thumbtup
(*args, **kwargs)[source]¶ Returns: thumbtup_list - [(thumb_path, img_path, imgsize, bboxes, thetas)] Return type: list - RESTful:
- Method: GET URL: /api/image/thumbtup/
-
get_image_timedelta_posix
(ibs, image_rowid_list, eager=True)[source]¶ image_timedelta_posix_list <- image.image_timedelta_posix[image_rowid_list]
# TODO: INTEGRATE THIS FUNCTION. CURRENTLY OFFSETS ARE ENCODIED DIRECTLY IN UNIXTIME
gets data from the “native” column “image_timedelta_posix” in the “image” table
Parameters: image_rowid_list (list) – Returns: image_timedelta_posix_list Return type: list - TemplateInfo:
- Tgetter_table_column col = image_timedelta_posix tbl = image
- RESTful:
- Method: GET URL: /api/image/timedelta_posix/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> image_rowid_list = ibs._get_all_image_rowids() >>> eager = True >>> image_timedelta_posix_list = ibs.get_image_timedelta_posix(image_rowid_list, eager=eager) >>> assert len(image_rowid_list) == len(image_timedelta_posix_list)
-
get_image_unixtime
(input_, *args, **kwargs)[source]¶ Returns: list_ – a list of times that the images were taken by gid. Return type: list Returns: list_ – -1 if no timedata exists for a given gid Return type: list - RESTful:
- Method: GET URL: /api/image/unixtime/
-
get_image_uris
(*args, **kwargs)[source]¶ Returns: list_ – a list of image uris relative to the image dir by gid Return type: list - RESTful:
- Method: GET URL: /api/image/uris/
-
get_image_uris_original
(*args, **kwargs)[source]¶ Returns: list_ – a list of (original) image uris relative to the image dir by gid Return type: list - RESTful:
- Method: GET URL: /api/image/uris_original/
-
get_image_uuids
(*args, **kwargs)[source]¶ Returns: list_ – a list of image uuids by gid
Return type: list
Parameters: - ibs (IBEISController) – ibeis controller object
- gid_list (list) –
Returns: image_uuid_list
Return type: list
CommandLine:
python -m ibeis.control.manual_image_funcs --test-get_image_uuids
- RESTful:
- Method: GET URL: /api/image/uuids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> gid_list = ibs.get_valid_gids() >>> # execute function >>> image_uuid_list = ibs.get_image_uuids(gid_list) >>> # verify results >>> result = ut.list_str(image_uuid_list) >>> print(result) [ UUID('66ec193a-1619-b3b6-216d-1784b4833b61'), UUID('d8903434-942f-e0f5-d6c2-0dcbe3137bf7'), UUID('b73b72f4-4acb-c445-e72c-05ce02719d3d'), UUID('0cd05978-3d83-b2ee-2ac9-798dd571c3b3'), UUID('0a9bc03d-a75e-8d14-0153-e2949502aba7'), UUID('2deeff06-5546-c752-15dc-2bd0fdb1198a'), UUID('a9b70278-a936-c1dd-8a3b-bc1e9a998bf0'), UUID('42fdad98-369a-2cbc-67b1-983d6d6a3a60'), UUID('c459d381-fd74-1d99-6215-e42e3f432ea9'), UUID('33fd9813-3a2b-774b-3fcc-4360d1ae151b'), UUID('97e8ea74-873f-2092-b372-f928a7be30fa'), UUID('588bc218-83a5-d400-21aa-d499832632b0'), UUID('163a890c-36f2-981e-3529-c552b6d668a3'), ]
-
get_image_widths
(*args, **kwargs)[source]¶ Returns: list_ – a list of (width, height) tuples Return type: list - RESTful:
- Method: GET URL: /api/image/widths/
-
get_images
(*args, **kwargs)[source]¶ Returns: list_ – a list of images in numpy matrix form by gid
Return type: list
Parameters: - ibs (IBEISController) – ibeis controller object
- gid_list (list) –
Returns: image_list
Return type: list
CommandLine:
python -m ibeis.control.manual_image_funcs --test-get_images
- RESTful:
- Returns the base64 encoded image of image <gid> # Documented and routed in ibeis.web app.py Method: GET URL: /api/image/<gid>
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> gid_list = ibs.get_valid_gids()[0:1] >>> # execute function >>> image_list = get_images(ibs, gid_list) >>> # verify results >>> result = str(image_list[0].shape) >>> print(result) (715, 1047, 3)
-
get_imageset_aids
(*args, **kwargs)[source]¶ Returns: aids_list – a list of list of aids in each imageset Return type: list - RESTful:
- Method: GET URL: /api/imageset/aids/
Parameters: - ibs (IBEISController) – ibeis controller object
- imgsetid_list (list) –
Returns: aids_list
Return type: list
CommandLine:
python -m ibeis.control.manual_imageset_funcs --test-get_imageset_aids
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> ibs.delete_imagesets(ibs.get_valid_imgsetids()) >>> ibs.compute_occurrences() >>> imgsetid_list = ibs.get_valid_imgsetids() >>> aids_list = get_imageset_aids(ibs, imgsetid_list) >>> result = ('aids_list = %s' % (str(aids_list),)) >>> print(result)
-
get_imageset_configid
(*args, **kwargs)[source]¶ Returns: list_ – config_rowid of each imgsetid in imgsetid_list Return type: list - RESTful:
- Method: GET URL: /api/imageset/configid/
-
get_imageset_custom_filtered_aids
(ibs, imgsetid_list)[source]¶ hacks to filter aids to only certain views and qualities
- RESTful:
- Method: GET URL: /api/imageset/custom_filtered_aids/
-
get_imageset_duration
(*args, **kwargs)[source]¶ gets the imageset’s duration
Parameters: imageset_rowid_list (list) – Returns: imageset_duration Return type: list - RESTful:
- Method: GET URL: /api/imageset/duration/
-
get_imageset_end_time_posix
(*args, **kwargs)[source]¶ imageset_end_time_posix_list <- imageset.imageset_end_time_posix[imageset_rowid_list]
gets data from the “native” column “imageset_end_time_posix” in the “imageset” table
Parameters: imageset_rowid_list (list) – Returns: imageset_end_time_posix_list Return type: list - TemplateInfo:
- Tgetter_table_column col = imageset_end_time_posix tbl = imageset
- RESTful:
- Method: GET URL: /api/imageset/end_time_posix/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> imageset_rowid_list = ibs._get_all_imageset_rowids() >>> imageset_end_time_posix_list = ibs.get_imageset_end_time_posix(imageset_rowid_list) >>> assert len(imageset_rowid_list) == len(imageset_end_time_posix_list)
-
get_imageset_expanded_aids
(ibs, aid_list=None)[source]¶ Example
>>> import ibeis >>> from ibeis.other.ibsfuncs import * # NOQA >>> ibs = ibeis.opendb(defaultdb='lynx') >>> a = ['default:hack_imageset=True', ] >>> from ibeis.expt import experiment_helpers >>> acfg_list, expanded_aids_list = experiment_helpers.get_annotcfg_list(ibs, [a[0]], use_cache=False) >>> aid_list = ibs.get_valid_aids() >>> filter_kw = dict(been_adjusted=True) >>> aid_list = ibs.filter_annots_general(aid_list, filter_kw) >>> qaid_list, daid_list = ibs.get_imageset_expanded_aids() >>> #ibs.query_chips(qaid_list, daid_list) >>> testres = ibs.execute_pipeline_test(qaid_list, daid_list) >>> testres.print_perent_identification_success()
-
get_imageset_fraction_annotmatch_reviewed
(*args, **kwargs)[source]¶ - RESTful:
- Method: GET URL: /api/imageset/fraction_annotmatch_reviewed/
-
get_imageset_fraction_imgs_reviewed
(*args, **kwargs)[source]¶ - RESTful:
- Method: GET URL: /api/imageset/fraction_imgs_reviewed/
-
get_imageset_fraction_names_with_exemplar
(*args, **kwargs)[source]¶ - RESTful:
- Method: GET URL: /api/imageset/fraction_names_with_exemplar/
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> import ibeis # NOQA >>> ibs = ibeis.opendb('testdb2') >>> imgsetid_list = ibs._get_all_imageset_rowids() >>> fraction_exemplared_names_list = ibs.get_imageset_fraction_names_with_exemplar(imgsetid_list)
-
get_imageset_gids
(*args, **kwargs)[source]¶ Returns: gids_list – a list of list of gids in each imageset Return type: list - RESTful:
- Method: GET URL: /api/imageset/gids/
-
get_imageset_gps_lats
(*args, **kwargs)[source]¶ imageset_gps_lat_list <- imageset.imageset_gps_lat[imageset_rowid_list]
gets data from the “native” column “imageset_gps_lat” in the “imageset” table
Parameters: imageset_rowid_list (list) – Returns: imageset_gps_lat_list Return type: list - TemplateInfo:
- Tgetter_table_column col = imageset_gps_lat tbl = imageset
- RESTful:
- Method: GET URL: /api/imageset/gps_lats/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> imageset_rowid_list = ibs._get_all_imageset_rowids() >>> imageset_gps_lat_list = ibs.get_imageset_gps_lats(imageset_rowid_list) >>> assert len(imageset_rowid_list) == len(imageset_gps_lat_list)
-
get_imageset_gps_lons
(*args, **kwargs)[source]¶ imageset_gps_lon_list <- imageset.imageset_gps_lon[imageset_rowid_list]
gets data from the “native” column “imageset_gps_lon” in the “imageset” table
Parameters: imageset_rowid_list (list) – Returns: imageset_gps_lon_list Return type: list - TemplateInfo:
- Tgetter_table_column col = imageset_gps_lon tbl = imageset
- RESTful:
- Method: GET URL: /api/imageset/gps_lons/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> imageset_rowid_list = ibs._get_all_imageset_rowids() >>> imageset_gps_lon_list = ibs.get_imageset_gps_lons(imageset_rowid_list) >>> assert len(imageset_rowid_list) == len(imageset_gps_lon_list)
-
get_imageset_gsgrids
(ibs, imgsetid_list=None, gid_list=None)[source]¶ Returns: list_ – a list of imageset-image-relationship rowids for each encouterid Return type: list - RESTful:
- Method: GET URL: /api/imageset/gsgrids/
-
get_imageset_imgsetids_from_text
(*args, **kwargs)[source]¶ Returns: list_ – a list of imgsetids corresponding to each imageset imagesettext Return type: list #FIXME: make new naming scheme for non-primary-key-getters get_imageset_imgsetids_from_text_from_text
- RESTful:
- Method: GET URL: /api/imageset/imgsetids_from_text/
-
get_imageset_nids
(*args, **kwargs)[source]¶ Returns: list_ – a list of list of known nids in each imageset Return type: list CommandLine:
python -m ibeis.control.manual_imageset_funcs --test-get_imageset_nids
- RESTful:
- Method: GET URL: /api/imageset/nids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> ibs.delete_imagesets(ibs.get_valid_imgsetids()) >>> ibs.compute_occurrences() >>> imgsetid_list = ibs.get_valid_imgsetids() >>> nids_list = ibs.get_imageset_nids(imgsetid_list) >>> result = nids_list >>> print(result) [[1, 2, 3], [4, 5, 6, 7]]
-
get_imageset_note
(*args, **kwargs)[source]¶ Returns: list_ – imageset_note of each imgsetid in imgsetid_list Return type: list - RESTful:
- Method: GET URL: /api/imageset/note/
-
get_imageset_notes
(*args, **kwargs)[source]¶ imageset_note_list <- imageset.imageset_note[imageset_rowid_list]
gets data from the “native” column “imageset_note” in the “imageset” table
Parameters: imageset_rowid_list (list) – Returns: imageset_note_list Return type: list - TemplateInfo:
- Tgetter_table_column col = imageset_note tbl = imageset
- RESTful:
- Method: GET URL: /api/imageset/notes/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> imageset_rowid_list = ibs._get_all_imageset_rowids() >>> imageset_note_list = ibs.get_imageset_notes(imageset_rowid_list) >>> assert len(imageset_rowid_list) == len(imageset_note_list)
-
get_imageset_num_aids
(*args, **kwargs)[source]¶ Returns: nGids_list – number of images in each imageset Return type: list - RESTful:
- Method: GET URL: /api/imageset/num_aids/
-
get_imageset_num_annotmatch_reviewed
(*args, **kwargs)[source]¶ - RESTful:
- Method: GET URL: /api/imageset/num_annotmatch_reviewed/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> import ibeis # NOQA >>> ibs = ibeis.opendb('testdb1') >>> imgsetid_list = ibs._get_all_imageset_rowids() >>> num_annots_reviewed_list = ibs.get_imageset_num_annotmatch_reviewed(imgsetid_list)
-
get_imageset_num_gids
(*args, **kwargs)[source]¶ Returns: nGids_list – number of images in each imageset Return type: list - RESTful:
- Method: GET URL: /api/imageset/num_gids/
-
get_imageset_num_imgs_reviewed
(*args, **kwargs)[source]¶ - RESTful:
- Method: GET URL: /api/imageset/num_imgs_reviewed/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> # Reset and compute imagesets >>> ibs.delete_all_imagesets() >>> ibs.compute_occurrences() >>> imgsetid_list = ibs.get_valid_imgsetids() >>> num_reviwed_list = ibs.get_imageset_num_imgs_reviewed(imgsetid_list) >>> result = num_reviwed_list >>> print(result) [0, 0]
-
get_imageset_num_names_with_exemplar
(*args, **kwargs)[source]¶ - RESTful:
- Method: GET URL: /api/imageset/num_names_with_exemplar/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> import ibeis # NOQA >>> ibs = ibeis.opendb('testdb1') >>> imgsetid_list = ibs._get_all_imageset_rowids() >>> num_annots_reviewed_list = ibs.get_imageset_num_annotmatch_reviewed(imgsetid_list)
-
get_imageset_percent_annotmatch_reviewed_str
(*args, **kwargs)[source]¶ - RESTful:
- Method: GET URL: /api/imageset/percent_annotmatch_reviewed_str/
-
get_imageset_percent_imgs_reviewed_str
(*args, **kwargs)[source]¶ - RESTful:
- Method: GET URL: /api/imageset/percent_imgs_reviewed_str/
-
get_imageset_percent_names_with_exemplar_str
(*args, **kwargs)[source]¶ - RESTful:
- Method: GET URL: /api/imageset/percent_names_with_exemplar_str/
-
get_imageset_processed_flags
(*args, **kwargs)[source]¶ imageset_processed_flag_list <- imageset.imageset_processed_flag[imageset_rowid_list]
gets data from the “native” column “imageset_processed_flag” in the “imageset” table
Parameters: imageset_rowid_list (list) – Returns: imageset_processed_flag_list Return type: list - TemplateInfo:
- Tgetter_table_column col = imageset_processed_flag tbl = imageset
- RESTful:
- Method: GET URL: /api/imageset/processed_flags/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> imageset_rowid_list = ibs._get_all_imageset_rowids() >>> imageset_processed_flag_list = ibs.get_imageset_processed_flags(imageset_rowid_list) >>> assert len(imageset_rowid_list) == len(imageset_processed_flag_list)
-
get_imageset_shipped_flags
(*args, **kwargs)[source]¶ imageset_shipped_flag_list <- imageset.imageset_shipped_flag[imageset_rowid_list]
gets data from the “native” column “imageset_shipped_flag” in the “imageset” table
Parameters: imageset_rowid_list (list) – Returns: imageset_shipped_flag_list Return type: list - TemplateInfo:
- Tgetter_table_column col = imageset_shipped_flag tbl = imageset
- RESTful:
- Method: GET URL: /api/imageset/shipped_flags/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> imageset_rowid_list = ibs._get_all_imageset_rowids() >>> imageset_shipped_flag_list = ibs.get_imageset_shipped_flags(imageset_rowid_list) >>> assert len(imageset_rowid_list) == len(imageset_shipped_flag_list)
-
get_imageset_smart_waypoint_ids
(ibs, imageset_rowid_list)[source]¶ imageset_smart_waypoint_id_list <- imageset.imageset_smart_waypoint_id[imageset_rowid_list]
gets data from the “native” column “imageset_smart_waypoint_id” in the “imageset” table
Parameters: imageset_rowid_list (list) – Returns: imageset_smart_waypoint_id_list Return type: list - TemplateInfo:
- Tgetter_table_column col = imageset_smart_waypoint_id tbl = imageset
- RESTful:
- Method: GET URL: /api/imageset/smart_waypoint_ids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> imageset_rowid_list = ibs._get_all_imageset_rowids() >>> imageset_smart_waypoint_id_list = ibs.get_imageset_smart_waypoint_ids(imageset_rowid_list) >>> assert len(imageset_rowid_list) == len(imageset_smart_waypoint_id_list)
-
get_imageset_smart_xml_fnames
(ibs, imageset_rowid_list)[source]¶ imageset_smart_xml_fname_list <- imageset.imageset_smart_xml_fname[imageset_rowid_list]
gets data from the “native” column “imageset_smart_xml_fname” in the “imageset” table
Parameters: imageset_rowid_list (list) – Returns: imageset_smart_xml_fname_list Return type: list - TemplateInfo:
- Tgetter_table_column col = imageset_smart_xml_fname tbl = imageset
- RESTful:
- Method: GET URL: /api/imageset/smart_xml_fnames/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> imageset_rowid_list = ibs._get_all_imageset_rowids() >>> imageset_smart_xml_fname_list = ibs.get_imageset_smart_xml_fnames(imageset_rowid_list) >>> assert len(imageset_rowid_list) == len(imageset_smart_xml_fname_list)
-
get_imageset_start_time_posix
(*args, **kwargs)[source]¶ imageset_start_time_posix_list <- imageset.imageset_start_time_posix[imageset_rowid_list]
gets data from the “native” column “imageset_start_time_posix” in the “imageset” table
Parameters: imageset_rowid_list (list) – Returns: imageset_start_time_posix_list Return type: list - TemplateInfo:
- Tgetter_table_column col = imageset_start_time_posix tbl = imageset
- RESTful:
- Method: GET URL: /api/imageset/start_time_posix/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> imageset_rowid_list = ibs._get_all_imageset_rowids() >>> imageset_start_time_posix_list = ibs.get_imageset_start_time_posix(imageset_rowid_list) >>> assert len(imageset_rowid_list) == len(imageset_start_time_posix_list)
-
get_imageset_text
(*args, **kwargs)[source]¶ Returns: list_ – imageset_text of each imgsetid in imgsetid_list Return type: list - RESTful:
- Method: GET URL: /api/imageset/text/
-
get_imageset_uuid
(*args, **kwargs)[source]¶ Returns: list_ – imageset_uuid of each imgsetid in imgsetid_list Return type: list - RESTful:
- Method: GET URL: /api/imageset/uuid/
-
get_infostr
(ibs)[source]¶ Returns sort printable database information
Parameters: ibs (IBEISController) – ibeis controller object Returns: infostr Return type: str
-
get_job_status
(ibs, jobid)[source]¶ Web call that returns the status of a job
CommandLine:
# Run Everything together python -m ibeis.web.apis_engine --exec-get_job_status # Start job queue in its own process python -m ibeis.web.apis_engine --main --bg # Start web server in its own process ./dev.py --web pass # Run foreground process python -m ibeis.web.apis_engine --exec-get_job_status:0 --fg
Example
>>> # WEB_DOCTEST >>> from ibeis.web.apis_engine import * # NOQA >>> import ibeis >>> web_ibs = ibeis.opendb_bg_web('testdb1', wait=3) # , domain='http://52.33.105.88') >>> # Test get status of a job id that does not exist >>> response = web_ibs.send_ibeis_request('/api/engine/job/status/', jobid='badjob') >>> web_ibs.terminate2()
-
get_lblannot_rowid_from_superkey
(*args, **kwargs)[source]¶ Returns: list_ – lblannot_rowid_list from the superkey (lbltype, value) Return type: list
-
get_lblannot_rowid_from_uuid
(*args, **kwargs)[source]¶ UNSAFE
Returns: lblannot_rowid_list from the superkey (lbltype, value)
-
get_lblimage_rowid_from_superkey
(*args, **kwargs)[source]¶ Returns: list_ – lblimage_rowid_list from the superkey (lbltype, value) Return type: list
-
get_lblimage_rowid_from_uuid
(*args, **kwargs)[source]¶ Returns: list_ – lblimage_rowid_list from the superkey (lbltype, value) Return type: list
-
get_lbltype_rowid_from_text
(*args, **kwargs)[source]¶ Returns: lbltype_rowid – lbltype_rowid where the lbltype_text is given Return type: list
-
get_metadata_rowid_from_metadata_key
(*args, **kwargs)[source]¶ - RESTful:
- Method: GET URL: /api/metadata/rowid_from_metadata_key/
-
get_missing_gids
(ibs, gid_list=None)[source]¶ Finds gids with broken links to the original data.
Parameters: - ibs (IBEISController) – ibeis controller object
- gid_list (list) – (default = None)
CommandLine:
python -m ibeis.other.ibsfuncs --exec-get_missing_gids --db GZ_Master1
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> #ibs = ibeis.opendb('GZ_Master1') >>> gid_list = ibs.get_valid_gids() >>> bad_gids = ibs.get_missing_gids(gid_list) >>> print('#bad_gids = %r / %r' % (len(bad_gids), len(gid_list)))
-
get_name_age_months_est_max
(ibs, name_rowid_list)[source]¶ - RESTful:
- Method: GET URL: /api/name/age_months_est_max/
-
get_name_age_months_est_min
(ibs, name_rowid_list)[source]¶ - RESTful:
- Method: GET URL: /api/name/age_months_est_min/
-
get_name_aids
(*args, **kwargs)[source]¶ # TODO: Rename to get_anot_rowids_from_name_rowid
Returns: aids_list a list of list of aids in each name Return type: list - RESTful:
- Method: GET URL: /api/name/aids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> # Map annotations to name ids >>> aid_list = ibs.get_valid_aids() >>> nid_list = ibs.get_annot_name_rowids(aid_list) >>> # Get annotation ids for each name >>> aids_list = ibs.get_name_aids(nid_list) >>> # Run Assertion Test >>> groupid2_items = ut.group_items(aids_list, nid_list) >>> grouped_items = list(six.itervalues(groupid2_items)) >>> passed_iter = map(ut.allsame, grouped_items) >>> passed_list = list(passed_iter) >>> assert all(passed_list), 'problem in get_name_aids' >>> # Print gropued items >>> print(ut.dict_str(groupid2_items, newlines=False))
- Ignore;
from ibeis.control.manual_name_funcs import * # NOQA import ibeis #ibs = ibeis.opendb(‘testdb1’) #ibs = ibeis.opendb(‘PZ_MTEST’) ibs = ibeis.opendb(‘PZ_Master0’) #ibs = ibeis.opendb(‘GZ_ALL’)
nid_list = ibs.get_valid_nids() nid_list_ = [const.UNKNOWN_NAME_ROWID if nid <= 0 else nid for nid in nid_list]
- with ut.Timer(‘sql’):
- #aids_list1 = ibs.get_name_aids(nid_list, enable_unknown_fix=False) aids_list1 = ibs.db.get(const.ANNOTATION_TABLE, (ANNOT_ROWID,), nid_list_, id_colname=NAME_ROWID, unpack_scalars=False)
- with ut.Timer(‘hackquery + group’):
opstr = ‘’’ SELECT annot_rowid, name_rowid FROM annotations WHERE name_rowid IN
(%s) ORDER BY name_rowid ASC, annot_rowid ASC‘’’ % (‘, ‘.join(map(str, nid_list))) pair_list = ibs.db.connection.execute(opstr).fetchall() aids = np.array(ut.get_list_column(pair_list, 0)) nids = np.array(ut.get_list_column(pair_list, 1)) unique_nids, groupx = vt.group_indices(nids) grouped_aids_ = vt.apply_grouping(aids, groupx) aids_list5 = [sorted(arr.tolist()) for arr in grouped_aids_]
- for aids1, aids5 in zip(aids_list1, aids_list5):
- if (aids1) != (aids5):
- print(aids1) print(aids5) print(‘—–’)
ut.assert_lists_eq(list(map(tuple, aids_list5)), list(map(tuple, aids_list1)))
- with ut.Timer(‘numpy’):
- # alt method valid_aids = np.array(ibs.get_valid_aids()) valid_nids = np.array(ibs.get_annot_name_rowids(valid_aids, distinguish_unknowns=False)) aids_list2 = [valid_aids.take(np.flatnonzero(valid_nids == nid)).tolist() for nid in nid_list_]
- with ut.Timer(‘numpy2’):
- # alt method valid_aids = np.array(ibs.get_valid_aids()) valid_nids = np.array(ibs.get_annot_name_rowids(valid_aids, distinguish_unknowns=False)) aids_list3 = [valid_aids.take(np.flatnonzero(np.equal(valid_nids, nid))).tolist() for nid in nid_list_]
- with ut.Timer(‘numpy3’):
- # alt method valid_aids = np.array(ibs.get_valid_aids()) valid_nids = np.array(ibs.db.get_all_col_rows(const.ANNOTATION_TABLE, NAME_ROWID)) aids_list4 = [valid_aids.take(np.flatnonzero(np.equal(valid_nids, nid))).tolist() for nid in nid_list_]
assert aids_list2 == aids_list3 assert aids_list3 == aids_list4 assert aids_list1 == aids_list2
valid_aids = ibs.get_valid_aids() %timeit ibs.db.get_all_col_rows(‘annotations’, ‘rowid’) %timeit ibs.db.get_all_col_rows(‘annotations’, ‘name_rowid’) %timeit ibs.get_annot_name_rowids(valid_aids, distinguish_unknowns=False) %timeit ibs.get_valid_aids() %timeit ibs.get_annot_name_rowids(ibs.get_valid_aids(), distinguish_unknowns=False) valid_nids1 = ibs.get_annot_name_rowids(valid_aids, distinguish_unknowns=False) valid_nids2 = ibs.db.get_all_col_rows(‘annotations’, ‘name_rowid’) assert valid_nids1 == valid_nids2
ibs.db.fname ibs.db.fpath
import sqlite3
con = sqlite3.connect(ibs.db.fpath)
opstr = ‘’’ SELECT annot_rowid, name_rowid FROM annotations WHERE name_rowid IN
(SELECT name_rowid FROM name) ORDER BY name_rowid ASC, annot_rowid ASC‘’‘
annot_rowid_list = con.execute(opstr).fetchall() aid_list = ut.get_list_column(annot_rowid_list, 0) nid_list = ut.get_list_column(annot_rowid_list, 1)
# HACKY HACKY HACK
- with ut.Timer(‘hackquery + group’):
#nid_list = ibs.get_valid_nids()[10:15] nid_list = ibs.get_valid_nids() opstr = ‘’’ SELECT annot_rowid, name_rowid FROM annotations WHERE name_rowid IN
(%s) ORDER BY name_rowid ASC, annot_rowid ASC‘’’ % (‘, ‘.join(map(str, nid_list))) pair_list = ibs.db.connection.execute(opstr).fetchall() aids = np.array(ut.get_list_column(pair_list, 0)) nids = np.array(ut.get_list_column(pair_list, 1)) unique_nids, groupx = vt.group_indices(nids) grouped_aids_ = vt.apply_grouping(aids, groupx) grouped_aids = [arr.tolist() for arr in grouped_aids_]
- SELECT
- name_rowid, COUNT(annot_rowid) AS number, GROUP_CONCAT(annot_rowid) AS aid_list
FROM annotations WHERE name_rowid in (SELECT name_rowid FROM name)
GROUP BY name_rowidORDER BY name_rowid ASC
import vtool as vt vt vt.aid_list[0]
annot_rowid_list = con.execute(opstr).fetchall() opstr = ‘’‘
SELECT annot_rowid FROM annotations WHERE name_rowid=? ‘’‘cur = ibs.db.connection.cursor()
cur = con.execute(‘BEGIN IMMEDIATE TRANSACTION’) cur = ibs.db.connection res = [cur.execute(opstr, (nid,)).fetchall() for nid in nid_list_] cur.execute(‘COMMIT TRANSACTION’)
res = [ibs.db.cur.execute(opstr, (nid,)).fetchall() for nid in nid_list_]
-
get_name_alias_texts
(*args, **kwargs)[source]¶ Returns: list_ – name_alias_text_list Return type: list CommandLine:
python -m ibeis.control.manual_name_funcs --test-get_name_texts
CommandLine:
python -m ibeis.control.manual_name_funcs --test-get_name_alias_texts
- RESTful:
- Method: GET URL: /api/name/alias_texts/
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> name_rowid_list = ibs.get_valid_nids() >>> # execute function >>> name_alias_text_list = get_name_alias_texts(ibs, name_rowid_list) >>> # verify results >>> result = str(name_alias_text_list) >>> print(result) [None, None, None, None, None, None, None]
-
get_name_exemplar_aids
(*args, **kwargs)[source]¶ Returns: list_ – a list of list of cids in each name Return type: list CommandLine:
python -m ibeis.control.manual_name_funcs --test-get_name_exemplar_aids
- RESTful:
- Method: GET URL: /api/name/exemplar_aids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> nid_list = ibs.get_annot_name_rowids(aid_list) >>> exemplar_aids_list = ibs.get_name_exemplar_aids(nid_list) >>> result = exemplar_aids_list >>> print(result) [[], [2, 3], [2, 3], [], [5, 6], [5, 6], [7], [8], [], [10], [], [12], [13]]
-
get_name_gids
(*args, **kwargs)[source]¶ Returns: list_ – the image ids associated with name ids Return type: list - RESTful:
- Method: GET URL: /api/name/gids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> nid_list = ibs._get_all_known_name_rowids() >>> gids_list = ibs.get_name_gids(nid_list) >>> result = gids_list >>> print(result) [[2, 3], [5, 6], [7], [8], [10], [12], [13]]
-
get_name_gps_tracks
(ibs, nid_list=None, aid_list=None)[source]¶ CommandLine:
python -m ibeis.other.ibsfuncs --test-get_name_gps_tracks
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> # build test data >>> #ibs = ibeis.opendb('PZ_Master0') >>> ibs = ibeis.opendb('testdb1') >>> #nid_list = ibs.get_valid_nids() >>> aid_list = ibs.get_valid_aids() >>> nid_list, gps_track_list, aid_track_list = ibs.get_name_gps_tracks(aid_list=aid_list) >>> nonempty_list = list(map(lambda x: len(x) > 0, gps_track_list)) >>> ut.compress(nid_list, nonempty_list) >>> ut.compress(gps_track_list, nonempty_list) >>> ut.compress(aid_track_list, nonempty_list) >>> result = str(aid_track_list) >>> print(result) [[11], [], [4], [1], [2, 3], [5, 6], [7], [8], [10], [12], [13]]
-
get_name_hourdiffs
(*args, **kwargs)[source]¶ CommandLine:
python -m ibeis.other.ibsfuncs --test-get_name_hourdiffs
Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> ibs = testdata_ibs('NNP_Master3') >>> nid_list = ibs.filter_nids_custom(ibs._get_all_known_nids()) >>> hourdiffs_list = ibs.get_name_hourdiffs(nid_list) >>> result = hourdiffs_list >>> print(hourdiffs_list)
-
get_name_max_speed
(*args, **kwargs)[source]¶ CommandLine:
python -m ibeis.other.ibsfuncs --test-get_name_max_speed
Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> ibs = testdata_ibs('NNP_Master3') >>> nid_list = ibs.filter_nids_custom(ibs._get_all_known_nids()) >>> maxspeed_list = ibs.get_name_max_speed(nid_list) >>> result = maxspeed_list >>> print(maxspeed_list)
-
get_name_notes
(*args, **kwargs)[source]¶ Returns: list_ – notes_list - name notes Return type: list - RESTful:
- Method: GET URL: /api/name/notes/
-
get_name_num_annotations
(*args, **kwargs)[source]¶ Returns: list_ – the number of annotations for each name Return type: list CommandLine:
python -m ibeis.control.manual_name_funcs --test-get_name_num_annotations
- RESTful:
- Method: GET URL: /api/name/num_annotations/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> nid_list = ibs._get_all_known_name_rowids() >>> result = get_name_num_annotations(ibs, nid_list) >>> print(result) [2, 2, 1, 1, 1, 1, 1]
-
get_name_num_exemplar_annotations
(*args, **kwargs)[source]¶ Returns: list_ – the number of annotations, which are exemplars for each name Return type: list - RESTful:
- Method: GET URL: /api/name/num_exemplar_annotations/
-
get_name_rowids_from_text
(*args, **kwargs)[source]¶ - Args:
- ibs (IBEISController): ibeis controller object name_text_list (list): ensure (bool): adds as new names if non-existant (default = True)
- Returns:
- name_rowid_list (list): Creates one if it doesnt exist
- CommandLine:
- python -m ibeis.control.manual_name_funcs –test-get_name_rowids_from_text:0 python -m ibeis.control.manual_name_funcs –test-get_name_rowids_from_text:1
- TODO:
- should ensure be defaulted to False?
- RESTful:
- Method: GET URL: /api/name/rowids_from_text/
- Example:
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> import utool as ut >>> ibs = ibeis.opendb('testdb1') >>> name_text_list = [u'Fred', u'Sue', '____', u'zebra_grevys', 'TYPO', '____'] >>> ensure = False >>> name_rowid_list = ibs.get_name_rowids_from_text(name_text_list, ensure) >>> print(ut.list_str(list(zip(name_text_list, name_rowid_list)))) >>> ensure = True >>> name_rowid_list = ibs.get_name_rowids_from_text(name_text_list, ensure) >>> print(ut.list_str(list(zip(name_text_list, name_rowid_list)))) >>> ibs.print_name_table() >>> result = str(name_rowid_list) + '
- ‘
>>> typo_rowids = ibs.get_name_rowids_from_text(['TYPO', 'Fred', 'Sue', 'zebra_grevys']) >>> ibs.delete_names(typo_rowids) >>> result += str(ibs._get_all_known_name_rowids()) >>> print('----') >>> ibs.print_name_table() >>> print(result) [8, 9, 0, 10, 11, 0] [1, 2, 3, 4, 5, 6, 7]
-
get_name_rowids_from_text_
(*args, **kwargs)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- name_text_list (list) –
Returns: name_rowid_list
Return type: list
CommandLine:
python -m ibeis.control.manual_name_funcs --test-get_name_rowids_from_text_
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> import utool as ut # NOQA >>> ibs = ibeis.opendb('testdb1') >>> name_text_list = [u'Fred', 'easy', u'Sue', '____', u'zebra_grevys', 'TYPO', 'jeff'] >>> name_rowid_list = ibs.get_name_rowids_from_text_(name_text_list) >>> ibs.print_name_table() >>> result = str(name_rowid_list) >>> print(result) [None, 1, None, 0, None, None, 3]
-
get_name_sex
(ibs, name_rowid_list, eager=True, nInput=None)[source]¶ name_sex_list <- name.name_sex[name_rowid_list]
gets data from the “native” column “name_sex” in the “name” table
Parameters: name_rowid_list (list) – Returns: name_sex_list Return type: list - TemplateInfo:
- Tgetter_table_column col = name_sex tbl = name
- RESTful:
- Method: GET URL: /api/name/sex/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> name_rowid_list = ibs._get_all_name_rowids() >>> eager = True >>> name_sex_list = ibs.get_name_sex(name_rowid_list, eager=eager) >>> assert len(name_rowid_list) == len(name_sex_list)
-
get_name_sex_text
(ibs, name_rowid_list, eager=True, nInput=None)[source]¶ - RESTful:
- Method: GET URL: /api/name/sex_text/
-
get_name_speeds
(ibs, nid_list)[source]¶ CommandLine:
python -m ibeis.other.ibsfuncs --test-get_name_speeds
Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> ibs = testdata_ibs('NNP_Master3') >>> nid_list = get_valid_multiton_nids_custom(ibs) >>> speeds_list = get_name_speeds(ibs, nid_list) >>> result = str(speeds_list) >>> print(result)
-
get_name_temp_flag
(ibs, name_rowid_list, eager=True, nInput=None)[source]¶ name_temp_flag_list <- name.name_temp_flag[name_rowid_list]
gets data from the “native” column “name_temp_flag” in the “name” table
Parameters: name_rowid_list (list) – Returns: name_temp_flag_list Return type: list - TemplateInfo:
- Tgetter_table_column col = name_temp_flag tbl = name
CommandLine:
python -m ibeis.control.manual_name_funcs --test-get_name_temp_flag
- RESTful:
- Method: GET URL: /api/name/temp_flag/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> name_rowid_list = ibs._get_all_name_rowids() >>> eager = True >>> name_temp_flag_list = ibs.get_name_temp_flag(name_rowid_list, eager=eager) >>> assert len(name_rowid_list) == len(name_temp_flag_list)
-
get_name_texts
(*args, **kwargs)[source]¶ Returns: list_ – text names Return type: list CommandLine:
python -m ibeis.control.manual_name_funcs --test-get_name_texts
- RESTful:
- Method: GET URL: /api/name/texts/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> name_rowid_list = ibs._get_all_known_name_rowids() >>> name_text_list = get_name_texts(ibs, name_rowid_list) >>> result = str(name_text_list) >>> print(result) [u'easy', u'hard', u'jeff', u'lena', u'occl', u'polar', u'zebra']
-
get_name_uuids
(*args, **kwargs)[source]¶ Returns: list_ – uuids_list - name uuids Return type: list - RESTful:
- Method: GET URL: /api/name/uuids/
-
get_num_annotations
(ibs, **kwargs)[source]¶ Number of valid annotations
- RESTful:
- Method: GET URL: /api/annot/numations/
-
get_num_annots_per_name
(ibs, aid_list)[source]¶ Returns the number of annots per name (IN THIS LIST)
Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
CommandLine:
python -m ibeis.other.ibsfuncs --exec-get_num_annots_per_name python -m ibeis.other.ibsfuncs --exec-get_num_annots_per_name --db PZ_Master1
Example
>>> # UNSTABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid_list = ibs.get_valid_aids(is_known=True) >>> num_annots_per_name, unique_nids = get_num_annots_per_name(ibs, aid_list) >>> per_name_hist = ut.dict_hist(num_annots_per_name) >>> items = per_name_hist.items() >>> items = sorted(items)[::-1] >>> key_list = ut.get_list_column(items, 0) >>> val_list = ut.get_list_column(items, 1) >>> min_per_name = dict(zip(key_list, np.cumsum(val_list))) >>> result = ('per_name_hist = %s' % (ut.dict_str(per_name_hist),)) >>> print(result) >>> print('min_per_name = %s' % (ut.dict_str(min_per_name),)) per_name_hist = { 1: 5, 2: 2, }
-
get_num_images
(ibs, **kwargs)[source]¶ Number of valid images
- RESTful:
- Method: GET URL: /api/image/num/
-
get_num_names
(ibs, **kwargs)[source]¶ Number of valid names
CommandLine:
python -m ibeis.control.manual_name_funcs --test-get_num_names
- RESTful:
- Method: GET URL: /api/name/num/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> result = get_num_names(ibs) >>> print(result) 7
-
get_party_rowid_from_superkey
(ibs, party_tag_list, eager=True, nInput=None)[source]¶ party_rowid_list <- party[party_tag_list]
Parameters: lists (superkey) – party_tag_list Returns: party_rowid_list - TemplateInfo:
- Tgetter_native_rowid_from_superkey tbl = party
- RESTful:
- Method: GET URL: /api/autogen/party_rowid_from_superkey/
-
get_party_tag
(ibs, party_rowid_list, eager=True, nInput=None)[source]¶ party_tag_list <- party.party_tag[party_rowid_list]
gets data from the “native” column “party_tag” in the “party” table
Parameters: party_rowid_list (list) – Returns: party_tag_list Return type: list - TemplateInfo:
- Tgetter_table_column col = party_tag tbl = party
- RESTful:
- Method: GET URL: /api/autogen/party_tag/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_party_funcs import * # NOQA >>> ibs, qreq_ = testdata_ibs() >>> party_rowid_list = ibs._get_all_party_rowids() >>> eager = True >>> party_tag_list = ibs.get_party_tag(party_rowid_list, eager=eager) >>> assert len(party_rowid_list) == len(party_tag_list)
-
get_primary_database_species
(ibs, aid_list=None)[source]¶ Parameters: aid_list (list) – list of annotation ids (default = None) CommandLine:
python -m ibeis.other.ibsfuncs --test-get_primary_database_species
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid_list = None >>> primary_species = get_primary_database_species(ibs, aid_list) >>> result = primary_species >>> print('primary_species = %r' % (primary_species,)) >>> print(result) zebra_plains
-
get_prioritized_name_subset
(ibs, aid_list=None, annots_per_name=None)[source]¶ TODO: this needs to be integrated more cleanly with a nonhacky way of getting a subset of exemplars. Currently ther is duplicate code in guiback and here to use left side only when custom filter is on.
CommandLine:
python -m ibeis.other.ibsfuncs --test-get_prioritized_name_subset
Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb2') >>> aid_list = ibs.get_valid_aids() >>> annots_per_name = 2 >>> aid_subset = get_prioritized_name_subset(ibs, aid_list, annots_per_name) >>> qualtexts = ibs.get_annot_quality_texts(aid_subset) >>> yawtexts = ibs.get_annot_yaw_texts(aid_subset) >>> assert 'junk' not in qualtexts >>> assert 'right' not in yawtexts >>> result = len(aid_subset) >>> print(result) 28
- Exeample:
>>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb2') >>> aid_list = ibs.get_valid_aids() >>> aid_list = ut.compress(aid_list, ibs.is_aid_unknown(aid_list)) >>> annots_per_name = 2 >>> aid_subset = get_prioritized_name_subset(ibs, aid_list, annots_per_name) >>> qualtexts = ibs.get_annot_quality_texts(aid_list) >>> yawtexts = ibs.get_annot_yaw_texts(aid_list)
-
get_quality_filterflags
(ibs, aid_list, minqual, unknown_ok=True)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
- minqual (str) – qualtext
- unknown_ok (bool) – (default = False)
Returns: qual_flags
Return type: iter
CommandLine:
python -m ibeis.other.ibsfuncs --exec-get_quality_filterflags
Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid_list = ibs.get_valid_aids()[0:20] >>> minqual = 'junk' >>> unknown_ok = False >>> qual_flags = list(get_quality_filterflags(ibs, aid_list, minqual, unknown_ok)) >>> result = ('qual_flags = %s' % (str(qual_flags),)) >>> print(result)
-
get_recognition_query_aids
(ibs, is_known, species=None)[source]¶ DEPCIRATE
- RESTful:
- Method: GET URL: /api/query/recognition_query_aids/
-
get_species_codes
(*args, **kwargs)[source]¶ Returns: list_ – code_list - species codes Return type: list - RESTful:
- Method: GET URL: /api/species/codes/
-
get_species_enabled
(*args, **kwargs)[source]¶ Returns: list_ – “Species Enabled” flag, true if the species is enabled Return type: list - RESTful:
- Method: GET URL: /api/species/enabled/
-
get_species_nice
(*args, **kwargs)[source]¶ Returns: species_text_list nice names Return type: list CommandLine:
python -m ibeis.control.manual_species_funcs --test-get_species_nice --enableall
- RESTful:
- Method: GET URL: /api/species/nice/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_species_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> ibs._clean_species() >>> species_rowid_list = ibs._get_all_species_rowids() >>> result = get_species_nice(ibs, species_rowid_list) >>> print(result) [u'Zebra (Plains)', u"Zebra (Grevy's)", u'Polar Bear']
-
get_species_notes
(*args, **kwargs)[source]¶ Returns: list_ – notes_list - species notes Return type: list - RESTful:
- Method: GET URL: /api/species/notes/
-
get_species_rowids_from_text
(*args, **kwargs)[source]¶ - Returns:
- species_rowid_list (list): Creates one if it doesnt exist
- CommandLine:
- python -m ibeis.control.manual_species_funcs –test-get_species_rowids_from_text:0 python -m ibeis.control.manual_species_funcs –test-get_species_rowids_from_text:1
- RESTful:
- Method: GET URL: /api/species/rowids_from_text/
- Example:
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_species_funcs import * # NOQA >>> import ibeis >>> import utool as ut >>> ibs = ibeis.opendb('testdb1') >>> species_text_list = [ ... u'jaguar', u'zebra_plains', u'zebra_plains', '____', 'TYPO', ... '____', u'zebra_grevys', u'bear_polar'] >>> ensure = False >>> species_rowid_list = ibs.get_species_rowids_from_text(species_text_list, ensure) >>> print(ut.list_str(list(zip(species_text_list, species_rowid_list)))) >>> ensure = True >>> species_rowid_list = ibs.get_species_rowids_from_text(species_text_list, ensure) >>> print(ut.list_str(list(zip(species_text_list, species_rowid_list)))) >>> ibs.print_species_table() >>> species_text = ibs.get_species_texts(species_rowid_list) >>> # Ensure we leave testdb1 in a clean state >>> ibs.delete_species(ibs.get_species_rowids_from_text(['jaguar', 'TYPO'])) >>> all_species_rowids = ibs._get_all_species_rowids() >>> result = ut.list_str(species_text, nl=False) + '
- ‘
>>> result += ut.list_str(all_species_rowids, nl=False) + '
- ‘
>>> result += ut.list_str(ibs.get_species_texts(all_species_rowids), nl=False) >>> print(result) ['jaguar', 'zebra_plains', 'zebra_plains', '____', 'typo', '____', 'zebra_grevys', 'bear_polar'] [1, 2, 3] ['zebra_plains', 'zebra_grevys', 'bear_polar']
[u’jaguar’, u’zebra_plains’, u’zebra_plains’, ‘____’, ‘____’, ‘____’, u’zebra_grevys’, u’bear_polar’] [8, 9, 10] [u’zebra_plains’, u’zebra_grevys’, u’bear_polar’]
- Example1:
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_species_funcs import * # NOQA >>> import ibeis >>> import utool as ut # NOQA >>> ibs = ibeis.opendb('testdb1') >>> species_text_list = [ ... u'jaguar', u'zebra_plains', u'zebra_plains', '____', 'TYPO', ... '____', u'zebra_grevys', u'bear_polar'] >>> ensure = False >>> species_rowid_list = ibs.get_species_rowids_from_text(species_text_list, ensure)
-
get_species_texts
(*args, **kwargs)[source]¶ Returns: species_text_list text names Return type: list CommandLine:
python -m ibeis.control.manual_species_funcs --test-get_species_texts --enableall
- RESTful:
- Method: GET URL: /api/species/texts/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_species_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> species_rowid_list = ibs._get_all_species_rowids() >>> result = get_species_texts(ibs, species_rowid_list) >>> print(result) [u'zebra_plains', u'zebra_grevys', u'bear_polar']
-
get_species_uuids
(*args, **kwargs)[source]¶ Returns: list_ – uuids_list - species uuids Return type: list - RESTful:
- Method: GET URL: /api/species/uuids/
-
get_unflat_annots_hourdists_list
(ibs, aids_list)[source]¶ Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> ibs = testdata_ibs('NNP_Master3') >>> nid_list = get_valid_multiton_nids_custom(ibs) >>> aids_list_ = ibs.get_name_aids(nid_list) >>> aids_list = [ibs.filter_aids_custom(aids) for aids in aids_list_]
-
get_unflat_annots_timedelta_list
(ibs, aids_list)[source]¶ Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> ibs = testdata_ibs('NNP_Master3') >>> nid_list = get_valid_multiton_nids_custom(ibs) >>> aids_list_ = ibs.get_name_aids(nid_list) >>> aids_list = [ibs.filter_aids_custom(aids) for aids in aids_list_]
-
get_ungrouped_gids
(ibs)[source]¶ CommandLine:
python -m ibeis.other.ibsfuncs --test-get_ungrouped_gids
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis # NOQA >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> ibs.delete_all_imagesets() >>> ibs.compute_occurrences() >>> ibs.update_special_imagesets() >>> # Now we want to remove some images from a non-special imageset >>> nonspecial_imgsetids = [i for i in ibs.get_valid_imgsetids() if i not in ibs.get_special_imgsetids()] >>> print("Nonspecial EIDs %r" % nonspecial_imgsetids) >>> images_to_remove = ibs.get_imageset_gids(nonspecial_imgsetids[0:1])[0][0:1] >>> print("Removing %r" % images_to_remove) >>> ibs.unrelate_images_and_imagesets(images_to_remove,nonspecial_imgsetids[0:1] * len(images_to_remove)) >>> ibs.update_special_imagesets() >>> ungr_imgsetid = ibs.get_imageset_imgsetids_from_text(const.UNGROUPED_IMAGES_IMAGESETTEXT) >>> print("Ungrouped gids %r" % ibs.get_ungrouped_gids()) >>> print("Ungrouped imgsetid %d contains %r" % (ungr_imgsetid, ibs.get_imageset_gids([ungr_imgsetid]))) >>> ungr_gids = ibs.get_imageset_gids([ungr_imgsetid])[0] >>> assert(sorted(images_to_remove) == sorted(ungr_gids))
-
get_valid_aids
(ibs, imgsetid=None, include_only_gid_list=None, yaw=u'no-filter', is_exemplar=None, species=None, is_known=None, hasgt=None, minqual=None, has_timestamp=None, min_timedelta=None)[source]¶ High level function for getting all annotation ids according a set of filters.
- Note: The yaw value cannot be None as a default because None is used as a
- filtering value
Parameters: - ibs (IBEISController) – ibeis controller object
- imgsetid (int) – imageset id (default = None)
- include_only_gid_list (list) – if specified filters annots not in these gids (default = None)
- yaw (str) – (default = ‘no-filter’)
- is_exemplar (bool) – if specified filters annots to either be or not be exemplars (default = None)
- species (str) – (default = None)
- is_known (bool) – (default = None)
- min_timedelta (int) – minimum timedelta between annots of known individuals
- hasgt (bool) – (default = None)
Returns: aid_list - a list of valid ANNOTATION unique ids
Return type: list
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_valid_aids
- RESTful:
- Method: GET URL: /api/annot/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> from ibeis import constants as const >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> imgsetid = 1 >>> ibs.delete_all_imagesets() >>> ibs.compute_occurrences() >>> include_only_gid_list = None >>> yaw = 'no-filter' >>> is_exemplar = None >>> species = const.TEST_SPECIES.ZEB_PLAIN >>> is_known = False >>> # execute function >>> aid_list = get_valid_aids(ibs, imgsetid, include_only_gid_list, yaw, is_exemplar, species, is_known) >>> ut.assert_eq(ibs.get_annot_names(aid_list), [const.UNKNOWN] * 2, 'bad name') >>> ut.assert_eq(ibs.get_annot_species(aid_list), [species] * 2, 'bad species') >>> ut.assert_eq(ibs.get_annot_exemplar_flags(aid_list), [False] * 2, 'bad exemplar') >>> # verify results >>> result = str(aid_list) >>> print(result) [1, 4]
- Example1:
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> # execute function >>> aid_list1 = get_valid_aids(ibs, is_exemplar=True) >>> aid_list2 = get_valid_aids(ibs, is_exemplar=False) >>> intersect_aids = set(aid_list1).intersection(aid_list2) >>> ut.assert_eq(len(aid_list1), 9) >>> ut.assert_eq(len(aid_list2), 4) >>> ut.assert_eq(len(intersect_aids), 0)
-
get_valid_contrib_rowids
(ibs)[source]¶ Returns: list_ – list of all contributor ids Return type: list Returns: contrib_rowids_list Return type: list CommandLine:
python -m ibeis.control.manual_meta_funcs --test-get_valid_contrib_rowids
- RESTful:
- Method: GET URL: /api/contributor/valid_rowids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_meta_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> contrib_rowids_list = get_valid_contrib_rowids(ibs) >>> result = str(contrib_rowids_list) >>> print(result)
-
get_valid_gids
(ibs, imgsetid=None, require_unixtime=False, require_gps=None, reviewed=None)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- imgsetid (None) –
- require_unixtime (bool) –
- reviewed (None) –
Returns: gid_list
Return type: list
CommandLine:
python -m ibeis.control.manual_image_funcs --test-get_valid_gids
- RESTful:
- Method: GET URL: /api/image/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> imgsetid = None >>> require_unixtime = False >>> reviewed = None >>> # execute function >>> gid_list = get_valid_gids(ibs, imgsetid, require_unixtime, reviewed) >>> # verify results >>> result = str(gid_list) >>> print(result) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
-
get_valid_image_rowids
(ibs, imgsetid=None, require_unixtime=False, reviewed=None)[source]¶ alias
- RESTful:
- Method: GET URL: /api/image/valid_rowids/
-
get_valid_imgsetids
(ibs, min_num_gids=0, processed=None, shipped=None)[source]¶ Returns: list_ – list of all imageset ids Return type: list - RESTful:
- Method: GET URL: /api/imageset/
-
get_valid_nids
(ibs, imgsetid=None, filter_empty=False, min_pername=None)[source]¶ Returns: list_ – all valid names with at least one animal (does not include unknown names) Return type: list - RESTful:
- Method: GET URL: /api/name/
-
get_verified_aid_pairs
(ibs)[source]¶ Example
>>> # DISABLE_DOCTEST >>> from ibeis_cnn.train import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('NNP_Master3') >>> verified_aid1_list, verified_aid2_list = get_verified_aid_pairs(ibs)
-
get_viewpoint_filterflags
(ibs, aid_list, valid_yaws, unknown_ok=True)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
- valid_yaws –
- unknown_ok (bool) – (default = True)
Returns: aid_list - list of annotation ids
Return type: int
CommandLine:
python -m ibeis.other.ibsfuncs --exec-get_viewpoint_filterflags python -m ibeis.other.ibsfuncs --exec-get_viewpoint_filterflags --db NNP_Master3
Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid_list = ibs.get_valid_aids()[0:20] >>> valid_yaws = None >>> unknown_ok = False >>> yaw_flags = list(get_viewpoint_filterflags(ibs, aid_list, valid_yaws, unknown_ok)) >>> result = ('yaw_flags = %s' % (str(yaw_flags),)) >>> print(result)
-
get_vocab_words
(ibs, taids=None, qreq_=None)[source]¶ Hackyish way of putting vocab generation into the controller. Ideally there would be a preproc_vocab in ibeis.algo.preproc and sql would store this under some config
Example
>>> from ibeis.control.manual_ibeiscontrol_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()
-
group_annots_by_known_names
(ibs, aid_list, checks=True)[source]¶ FIXME; rectify this #>>> import ibeis # NOQA
- CommandLine:
- python -m ibeis.other.ibsfuncs –test-group_annots_by_known_names
- Example:
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(db='testdb1') >>> aid_list = ibs.get_valid_aids() >>> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] >>> known_aids_list, unknown_aids = group_annots_by_known_names(ibs, aid_list) >>> result = str(known_aids_list) + '
- ‘
>>> result += str(unknown_aids) >>> print(result) [[2, 3], [5, 6], [7], [8], [10], [12], [13]] [11, 9, 4, 1]
-
group_annots_by_multi_prop
(ibs, aids, getter_list)[source]¶ Performs heirachical grouping of annotations based on properties
Parameters: - ibs (IBEISController) – ibeis controller object
- aids (list) – list of annotation rowids
- getter_list (list) –
Returns: multiprop2_aids
Return type: dict
CommandLine:
python -m ibeis.other.ibsfuncs --exec-group_annots_by_multi_prop --db PZ_Master1 --props=yaw_texts,name_rowids --keys1 frontleft python -m ibeis.other.ibsfuncs --exec-group_annots_by_multi_prop
Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aids = ibs.get_valid_aids(is_known=True) >>> #getter_list = [ibs.get_annot_name_rowids, ibs.get_annot_yaw_texts] >>> props = ut.get_argval('--props', type_=list, default=['yaw_texts', 'name_rowids']) >>> getter_list = [getattr(ibs, 'get_annot_' + prop) for prop in props] >>> print('getter_list = %r' % (getter_list,)) >>> #getter_list = [ibs.get_annot_yaw_texts, ibs.get_annot_name_rowids] >>> multiprop2_aids = group_annots_by_multi_prop(ibs, aids, getter_list) >>> get_dict_values = lambda x: list(x.values()) >>> # a bit convoluted >>> keys1 = ut.get_argval('--keys1', type_=list, default=list(multiprop2_aids.keys())) >>> multiprop2_num_aids = ut.hmap_vals(len, multiprop2_aids) >>> prop2_num_aids = ut.hmap_vals(get_dict_values, multiprop2_num_aids, max_depth=len(props) - 2) >>> #prop2_num_aids_stats = ut.hmap_vals(ut.get_stats, prop2_num_aids) >>> prop2_num_aids_hist = ut.hmap_vals(ut.dict_hist, prop2_num_aids) >>> prop2_num_aids_cumhist = ut.map_dict_vals(ut.dict_hist_cumsum, prop2_num_aids_hist) >>> print('prop2_num_aids_hist[%s] = %s' % (keys1, ut.dict_str(ut.dict_subset(prop2_num_aids_hist, keys1)))) >>> print('prop2_num_aids_cumhist[%s] = %s' % (keys1, ut.dict_str(ut.dict_subset(prop2_num_aids_cumhist, keys1))))
-
group_annots_by_name
(ibs, aid_list, distinguish_unknowns=True)[source]¶ This function is probably the fastest of its siblings
- Args:
- ibs (IBEISController): ibeis controller object aid_list (list): distinguish_unknowns (bool):
- Returns:
- tuple: grouped_aids_, unique_nids
- CommandLine:
- python -m ibeis.other.ibsfuncs –test-group_annots_by_name
- Example:
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> distinguish_unknowns = True >>> # execute function >>> grouped_aids_, unique_nids = group_annots_by_name(ibs, aid_list, distinguish_unknowns) >>> result = str([aids.tolist() for aids in grouped_aids_]) >>> result += '
- ‘ + str(unique_nids.tolist())
>>> # verify results >>> print(result) [[11], [9], [4], [1], [2, 3], [5, 6], [7], [8], [10], [12], [13]] [-11, -9, -4, -1, 1, 2, 3, 4, 5, 6, 7]
-
has_species_detector
(ibs, species_text)[source]¶ TODO: extend to use non-constant species
- RESTful:
- Method: GET URL: /api/detect/species/enabled/
-
image_base64_api
(gid=None, thumbnail=False, fresh=False, **kwargs)[source]¶ Returns the base64 encoded image of image <gid>
- RESTful:
- Method: GET URL: /api/image/<gid>/
-
initialize_job_manager
(ibs)[source]¶ Run from the webserver
Example
>>> # DISABLE_DOCTEST >>> from ibeis.web.apis_engine import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1')
Example
>>> # WEB_DOCTEST >>> from ibeis.web.apis_engine import * # NOQA >>> import ibeis >>> web_instance = ibeis.opendb_bg_web(db='testdb1', wait=10) >>> baseurl = 'http://127.0.1.1:5000' >>> _payload = {'image_attrs_list': [], 'annot_attrs_list': []} >>> payload = ut.map_dict_vals(ut.to_json, _payload) >>> #resp = requests.post(baseurl + '/api/test/helloworld/?f=b', data=payload) >>> resp = requests.post(baseurl + '/api/image/json/', data=payload) >>> print(resp) >>> web_instance.terminate() >>> json_dict = resp.json() >>> text = json_dict['response'] >>> print(text)
-
is_aid_unknown
(ibs, aid_list)[source]¶ Returns if an annotation has been given a name (even if that name is temporary)
-
localize_images
(ibs, gid_list_=None)[source]¶ Moves the images into the ibeis image cache. Images are renamed to img_uuid.ext
Parameters: - ibs (IBEISController) – ibeis controller object
- gid_list (list) –
CommandLine:
python -m ibeis.control.manual_image_funcs --test-localize_images
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> gpath_list = [ut.unixpath(ut.grab_test_imgpath('carl.jpg'))] >>> gid_list_ = ibs.add_images(gpath_list, auto_localize=False) >>> gpath_list2 = ibs.get_image_paths(gid_list_) >>> ut.assert_eq(gpath_list, gpath_list2, 'should not move when autolocalize is False') >>> # execute function >>> result = localize_images(ibs, gid_list_) >>> gpath_list3 = ibs.get_image_paths(gid_list_) >>> assert gpath_list3 != gpath_list2, 'should now be different gpath_list3=%r' % (gpath_list3,) >>> gpath3 = gpath_list3[0] >>> rel_gpath3 = ut.relpath_unix(gpath3, ibs.get_workdir()) >>> result = rel_gpath3 >>> print(result) >>> # Clean things up >>> ibs.delete_images(gid_list_) testdb1/_ibsdb/images/f498fa6f-6b24-b4fa-7932-2612144fedd5.jpg
-
lookup_annot_vecs_subset
(ibs, unflat_aids, unflat_fxs, annots=None, config2_=None)[source]¶ unflat_aids = naids_list unflat_fxs = nfxs_list annots = data_annots config2_ = data_config2_
unflat_aids = cm.filtnorm_aids[0] unflat_fxs = cm.filtnorm_fxs[0]
-
make_next_imageset_text
(ibs)[source]¶ Creates what the next imageset name would be but does not add it to the database
Parameters: ibs (IBEISController) – ibeis controller object CommandLine:
python -m ibeis.other.ibsfuncs --test-make_next_imageset_text
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> new_imagesettext = make_next_imageset_text(ibs) >>> result = new_imagesettext >>> print(result) New ImageSet 0
-
make_next_name
(ibs, num=None, str_format=2, species_text=None, location_text=None)[source]¶ Creates a number of names which are not in the database, but does not add them
Parameters: - ibs (IBEISController) – ibeis controller object
- num (None) –
- str_format (int) – either 1 or 2
Returns: next_name
Return type: str
CommandLine:
python -m ibeis.other.ibsfuncs --test-make_next_name
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> # build test data >>> ibs1 = ibeis.opendb('testdb1') >>> ibs2 = ibeis.opendb('PZ_MTEST') >>> ibs3 = ibeis.opendb('NAUT_test') >>> #ibs5 = ibeis.opendb('GIR_Tanya') >>> ibs1._clean_species() >>> ibs2._clean_species() >>> ibs3._clean_species() >>> num = None >>> str_format = 2 >>> # execute function >>> next_name1 = make_next_name(ibs1, num, str_format) >>> next_name2 = make_next_name(ibs2, num, str_format) >>> next_name3 = make_next_name(ibs3, num, str_format) >>> next_name4 = make_next_name(ibs1, num, str_format, const.TEST_SPECIES.ZEB_GREVY) >>> name_list = [next_name1, next_name2, next_name3, next_name4] >>> next_name_list1 = make_next_name(ibs2, 5, str_format) >>> temp_nids = ibs2.add_names(['IBEIS_PZ_0045', 'IBEIS_PZ_0048']) >>> next_name_list2 = make_next_name(ibs2, 5, str_format) >>> ibs2.delete_names(temp_nids) >>> next_name_list3 = make_next_name(ibs2, 5, str_format) >>> # verify results >>> # FIXME: nautiluses are not working right >>> result = ut.list_str((name_list, next_name_list1, next_name_list2, next_name_list3)) >>> print(result) ( ['IBEIS_UNKNOWN_0008', 'IBEIS_PZ_0042', 'IBEIS_UNKNOWN_0004', 'IBEIS_GZ_0008'], ['IBEIS_PZ_0042', 'IBEIS_PZ_0043', 'IBEIS_PZ_0044', 'IBEIS_PZ_0045', 'IBEIS_PZ_0046'], ['IBEIS_PZ_0044', 'IBEIS_PZ_0046', 'IBEIS_PZ_0047', 'IBEIS_PZ_0049', 'IBEIS_PZ_0050'], ['IBEIS_PZ_0042', 'IBEIS_PZ_0043', 'IBEIS_PZ_0044', 'IBEIS_PZ_0045', 'IBEIS_PZ_0046'], )
-
make_next_nids
(ibs, *args, **kwargs)[source]¶ makes name and adds it to the database returning the newly added name rowid(s)
CAUTION; changes database state
- SeeAlso:
- make_next_name
-
merge_names
(ibs, merge_name, other_names)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- merge_name (str) –
- other_names (list) –
CommandLine:
python -m ibeis.other.ibsfuncs --test-merge_names
Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis # NOQA >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> merge_name = 'zebra' >>> other_names = ['occl', 'jeff'] >>> # execute function >>> result = merge_names(ibs, merge_name, other_names) >>> # verify results >>> print(result) >>> ibs.print_names_table()
-
new_query_params
(ibs, cfgdict=None, **kwargs)[source]¶ convinience method while configs are still in a state of disarray. Converts ibs.cfg.query_cfg into a QueryParams object
Parameters: - ibs (IBEISController) – ibeis controller object
- cfgdict (dict) – (default = None)
Returns: qparams - query hyper-parameters
Return type: CommandLine:
python -m ibeis.control.manual_ibeiscontrol_funcs --exec-new_query_params
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_ibeiscontrol_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> cfgdict = None >>> qparams = new_query_params(ibs, cfgdict) >>> result = ('qparams = %s' % (str(qparams),)) >>> print(result)
-
new_query_request
(ibs, qaid_list, daid_list, cfgdict=None, verbose=True, **kwargs)[source]¶ alias for ibeis.algo.hots.query_request.new_ibeis_query_request
Parameters: - qaid_list (list) –
- daid_list (list) –
- cfgdict (None) –
- verbose (bool) –
Returns: qreq_ - hyper-parameters
Return type: CommandLine:
python -m ibeis.control.manual_ibeiscontrol_funcs --test-new_query_request
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_ibeiscontrol_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> daid_list = ibs.get_valid_aids() >>> qaid_list = daid_list[0:2] >>> cfgdict = {} >>> verbose = True >>> qreq_ = new_query_request(ibs, qaid_list, daid_list, cfgdict, verbose) >>> qreq_.set_external_qaid_mask(qaid_list[1:2]) >>> print(qreq_.get_external_qaids()) >>> result = str(qreq_.get_query_hashid()) >>> print(result) _QSUUIDS((1)nozvwbdokngephfk)
_QSUUIDS((1)nztoqb6&7apjltd1)
-
partition_annots_into_corresponding_groups
(ibs, aid_list1, aid_list2)[source]¶ Used for grouping one-vs-one training pairs and corerspondence filtering
Parameters: - ibs (ibeis.control.IBEISControl.IBEISController) – ibeis controller object
- aid_list1 (int) – list of annotation ids
- aid_list2 (int) – list of annotation ids
Returns: 4 lists of lists. In the first two each list is a list of aids grouped by names and the names correspond with each other. In the last two are the annots that did not correspond with anything in the other list.
Return type: tuple
CommandLine:
python -m ibeis.other.ibsfuncs --exec-partition_annots_into_corresponding_groups
Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='PZ_MTEST') >>> grouped_aids = list(map(list, ibs.group_annots_by_name(ibs.get_valid_aids())[0])) >>> grouped_aids = [aids for aids in grouped_aids if len(aids) > 3] >>> # Get some overlapping groups >>> import copy >>> aids_group1 = copy.deepcopy((ut.get_list_column_slice(grouped_aids[0:5], slice(0, 2)))) >>> aids_group2 = copy.deepcopy((ut.get_list_column_slice(grouped_aids[2:7], slice(2, None)))) >>> # Ensure there is a singleton in each >>> ut.delete_items_by_index(aids_group1[0], [0]) >>> ut.delete_items_by_index(aids_group2[-1], [0]) >>> aid_list1 = ut.flatten(aids_group1) >>> aid_list2 = ut.flatten(aids_group2) >>> #aid_list1 = [1, 2, 8, 9, 60] >>> #aid_list2 = [3, 7, 20] >>> groups = partition_annots_into_corresponding_groups(ibs, aid_list1, aid_list2) >>> result = ut.list_str(groups, label_list=['gt_grouped_aids1', 'gt_grouped_aids2', 'gf_grouped_aids1', 'gf_gropued_aids2']) >>> print(result) gt_grouped_aids1 = [[10, 11], [17, 18], [22, 23]] gt_grouped_aids2 = [[12, 13, 14, 15], [19, 20, 21], [24, 25, 26]] gf_grouped_aids1 = [[2], [5, 6]] gf_gropued_aids2 = [[29, 30, 31, 32], [49]]
-
prepare_annotgroup_review
(ibs, aid_list)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
Returns: (src_ag_rowid, dst_ag_rowid) - source and dest annot groups
Return type: tuple
CommandLine:
python -m ibeis.other.ibsfuncs --test-prepare_annotgroup_review
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> result = prepare_annotgroup_review(ibs, aid_list) >>> print(result)
-
print_annotation_table
(ibs, verbosity=1, exclude_columns=[], include_columns=[])[source]¶ Dumps annotation table to stdout
Parameters: - ibs (IBEISController) –
- verbosity (int) –
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis # NOQA >>> ibs = ibeis.opendb('testdb1') >>> verbosity = 1 >>> print_annotation_table(ibs, verbosity)
-
print_annotmatch_table
(ibs)[source]¶ Dumps annotation match table to stdout
Parameters: ibs (IBEISController) – ibeis controller object CommandLine:
python -m ibeis.other.ibsfuncs --exec-print_annotmatch_table python -m ibeis.other.ibsfuncs --exec-print_annotmatch_table --db PZ_Master1
Example
>>> # SCRIPT >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> result = print_annotmatch_table(ibs) >>> print(result)
-
print_contributor_table
(ibs, verbosity=1, exclude_columns=[])[source]¶ Dumps annotation table to stdout
Parameters: - ibs (IBEISController) –
- verbosity (int) –
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis # NOQA >>> ibs = ibeis.opendb('testdb1') >>> verbosity = 1 >>> print_contributor_table(ibs, verbosity)
-
print_imageset_table
(ibs, **kwargs)[source]¶ Dumps imageset table to stdout
- Kwargs:
- exclude_columns (list):
-
query_chips
(ibs, qaid_list=None, daid_list=None, cfgdict=None, use_cache=None, use_bigcache=None, qreq_=None, return_request=False, verbose=False, save_qcache=None, prog_hook=None, return_cm_dict=False, return_cm_simple_dict=False)[source]¶ Submits a query request to the hotspotter recognition pipeline. Returns a list of QueryResult objects.
Note
In the future the QueryResult objects will be replaced by ChipMatch objects
Parameters: - qaid_list (list) – a list of annotation ids to be submitted as queries
- daid_list (list) – a list of annotation ids used as the database that will be searched
- cfgdict (dict) – dictionary of configuration options used to create a new QueryRequest if not already specified
- use_cache (bool) – turns on/off chip match cache (default: True)
- use_bigcache (bool) – turns one/off chunked chip match cache (default: True)
- qreq (QueryRequest) – optional, a QueryRequest object that overrides all previous settings
- return_request (bool) – returns the request which will be created if one is not already specified
- verbose (bool) – default=False, turns on verbose printing
Returns: a list of ChipMatch objects containing the matching annotations, scores, and feature matches
Return type: list
- Returns(2):
- tuple: (cm_list, qreq_) - a list of query results and optionally the
- QueryRequest object used
- RESTful:
- Method: PUT URL: /api/query/chips/
CommandLine:
python -m ibeis.web.apis_query --test-query_chips # Test speed of single query python -m ibeis --tf IBEISController.query_chips --db PZ_Master1 -a default:qindex=0:1,dindex=0:500 --nocache-hs python -m ibeis --tf IBEISController.query_chips --db PZ_Master1 -a default:qindex=0:1,dindex=0:3000 --nocache-hs python -m ibeis.web.apis_query --test-query_chips:1 --show python -m ibeis.web.apis_query --test-query_chips:2 --show
Example
>>> # SLOW_DOCTEST >>> from ibeis.control.IBEISControl import * # NOQA >>> import ibeis >>> qreq_ = ibeis.testdata_qreq_() >>> ibs = qreq_.ibs >>> cm_list = qreq_.execute() >>> cm = cm_list[0] >>> ut.quit_if_noshow() >>> cm.ishow_analysis(qreq_) >>> ut.show_if_requested()
Example
>>> # SLOW_DOCTEST >>> #from ibeis.all_imports import * # NOQA >>> import ibeis >>> from ibeis.control.IBEISControl import * # NOQA >>> qaid_list = [1] >>> daid_list = [1, 2, 3, 4, 5] >>> ibs = ibeis.test_main(db='testdb1') >>> qreq_ = ibs.new_query_request(qaid_list, daid_list) >>> cm = ibs.query_chips(qaid_list, daid_list, use_cache=False, qreq_=qreq_)[0] >>> ut.quit_if_noshow() >>> cm.ishow_analysis(qreq_) >>> ut.show_if_requested()
- Example1:
>>> # SLOW_DOCTEST >>> #from ibeis.all_imports import * # NOQA >>> import ibeis >>> from ibeis.control.IBEISControl import * # NOQA >>> qaid_list = [1] >>> daid_list = [1, 2, 3, 4, 5] >>> ibs = ibeis.test_main(db='testdb1') >>> cfgdict = {'pipeline_root':'BC_DTW'} >>> qreq_ = ibs.new_query_request(qaid_list, daid_list, cfgdict=cfgdict, verbose=True) >>> cm = ibs.query_chips(qaid_list, daid_list, use_cache=False, qreq_=qreq_)[0] >>> ut.quit_if_noshow() >>> cm.ishow_analysis(qreq_) >>> ut.show_if_requested()
-
query_chips_dict
(ibs, *args, **kwargs)[source]¶ Runs query_chips, but returns a json compatible dictionary
- RESTful:
- Method: GET URL: /api/query/chips/dict/
-
query_chips_simple_dict
(ibs, *args, **kwargs)[source]¶ Runs query_chips, but returns a json compatible dictionary
Parameters: as query_chips (same) – - RESTful:
- Method: GET URL: /api/query/chips/simple_dict/
- SeeAlso:
- query_chips
CommandLine:
python -m ibeis.web.apis_query --test-query_chips_simple_dict:0 python -m ibeis.web.apis_query --test-query_chips_simple_dict:1 python -m ibeis.web.apis_query --test-query_chips_simple_dict:0 --humpbacks
Example
>>> # WEB_DOCTEST >>> from ibeis.control.IBEISControl import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> #qaid = ibs.get_valid_aids()[0:3] >>> qaids = ibs.get_valid_aids() >>> daids = ibs.get_valid_aids() >>> dict_list = ibs.query_chips_simple_dict(qaids, daids) >>> qgids = ibs.get_annot_image_rowids(qaids) >>> qnids = ibs.get_annot_name_rowids(qaids) >>> for dict_, qgid, qnid in zip(dict_list, qgids, qnids): >>> dict_['qgid'] = qgid >>> dict_['qnid'] = qnid >>> dict_['dgid_list'] = ibs.get_annot_image_rowids(dict_['daid_list']) >>> dict_['dnid_list'] = ibs.get_annot_name_rowids(dict_['daid_list']) >>> dict_['dgname_list'] = ibs.get_image_gnames(dict_['dgid_list']) >>> dict_['qgname'] = ibs.get_image_gnames(dict_['qgid']) >>> result = ut.list_str(dict_list, nl=2, precision=2, hack_liststr=True) >>> result = result.replace('u'', '"').replace(''', '"') >>> print(result)
Example
>>> # WEB_DOCTEST >>> from ibeis.control.IBEISControl import * # NOQA >>> import time >>> import ibeis >>> import requests >>> # Start up the web instance >>> web_instance = ibeis.opendb_in_background(db='testdb1', web=True, browser=False) >>> time.sleep(.5) >>> baseurl = 'http://127.0.1.1:5000' >>> data = dict(qaid_list=[1]) >>> resp = requests.get(baseurl + '/api/query/chips/simple_dict/', data=data) >>> print(resp) >>> web_instance.terminate() >>> json_dict = resp.json() >>> cmdict_list = json_dict['response'] >>> assert 'score_list' in cmdict_list[0]
-
redownload_detection_models
(ibs)[source]¶ Parameters: ibs (IBEISController) – CommandLine:
python -c "from ibeis.algo.detect import grabmodels; grabmodels.redownload_models()" python -c "import utool, ibeis.algo; utool.view_directory(ibeis.algo.detect.grabmodels._expand_modeldir())"
Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.detectfuncs import * # NOQA >>> import ibeis # NOQA >>> ibs = ibeis.opendb('testdb1') >>> result = redownload_detection_models(ibs) >>> print(result)
-
remove_aids_of_viewpoint
(ibs, aid_list, invalid_yaws)[source]¶ Removes aids that do not have a valid yaw
TODO; rename to valid_viewpoint because this func uses category labels
-
remove_groundtrue_aids
(ibs, aid_list, ref_aid_list)[source]¶ removes any aids that are known to match
-
sample_annots_general
(ibs, aid_list=None, filter_kw={}, verbose=False, **kwargs)[source]¶ filter + sampling
-
sanitize_species_texts
(ibs, species_text_list)[source]¶ changes unknown species to the unknown value
Parameters: - ibs (IBEISController) – ibeis controller object
- species_text_list (list) –
Returns: Return type: list
CommandLine:
python -m ibeis.control.manual_species_funcs --test-sanitize_species_texts
- RESTful:
- Method: POST URL: /api/species/sanitize
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_species_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> species_text_list = ['foo', 'bar', 'zebra_plains'] >>> # execute function >>> species_text_list_ = sanitize_species_texts(ibs, species_text_list) >>> # verify results >>> result = ut.list_str(species_text_list_, nl=False) >>> print(result) ['foo', 'bar', 'zebra_plains']
-
search_annot_notes
(ibs, pattern, aid_list=None)[source]¶ Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('PZ_Master0') >>> pattern = ['gash', 'injury', 'scar', 'wound'] >>> valid_aid_list = ibs.search_annot_notes(pattern) >>> print(valid_aid_list) >>> print(ibs.get_annot_notes(valid_aid_list))
-
set_alr_lblannot_rowids
(*args, **kwargs)[source]¶ Associates whatever annotation is at row(alrid) with a new lblannot_rowid. (effectively changes the label value of the rowid)
-
set_annot_age_months_est_max
(ibs, aid_list, annot_age_months_est_max_list, duplicate_behavior=u'error')[source]¶ annot_age_months_est_max_list -> annot.annot_age_months_est_max[aid_list]
Parameters: - aid_list –
- annot_age_months_est_max_list –
- TemplateInfo:
- Tsetter_native_column tbl = annot col = annot_age_months_est_max
- RESTful:
- Method: PUT URL: /api/annot/age_months_est_max/
-
set_annot_age_months_est_min
(ibs, aid_list, annot_age_months_est_min_list, duplicate_behavior=u'error')[source]¶ annot_age_months_est_min_list -> annot.annot_age_months_est_min[aid_list]
Parameters: - aid_list –
- annot_age_months_est_min_list –
- TemplateInfo:
- Tsetter_native_column tbl = annot col = annot_age_months_est_min
- RESTful:
- Method: PUT URL: /api/annot/age_months_est_min/
-
set_annot_bboxes
(*args, **kwargs)[source]¶ Sets bboxes of a list of annotations by aid,
Parameters: - aid_list (list of rowids) – list of annotation rowids
- bbox_list (list of (x, y, w, h) – new bounding boxes for each aid
Note
set_annot_bboxes is a proxy for set_annot_verts
- RESTful:
- Method: PUT URL: /api/annot/bboxes/
-
set_annot_detect_confidence
(*args, **kwargs)[source]¶ Sets annotation notes
- RESTful:
- Method: PUT URL: /api/annot/detect_confidence/
-
set_annot_exemplar_flags
(*args, **kwargs)[source]¶ Sets if an annotation is an exemplar
- RESTful:
- Method: PUT URL: /api/annot/exemplar_flags/
-
set_annot_is_hard
(ibs, aid_list, flag_list)[source]¶ Hack to mark hard cases in the notes column
Example
>>> pz_mothers_hard_aids = [27, 43, 44, 49, 50, 51, 54, 66, 89, 97] >>> aid_list = pz_mothers_hard_aids >>> flag_list = [True] * len(aid_list)
-
set_annot_lblannot_from_rowid
(*args, **kwargs)[source]¶ Sets items/lblannot_rowids of a list of annotations.
-
set_annot_lblannot_from_value
(*args, **kwargs)[source]¶ Associates the annot and lblannot of a specific type and value Adds the lblannot if it doesnt exist. Wrapper around convenience function for set_annot_from_lblannot_rowid
-
set_annot_name_rowids
(*args, **kwargs)[source]¶ name_rowid_list -> annot.name_rowid[aid_list]
Sets names/nids of a list of annotations.
Parameters: - aid_list (list) –
- name_rowid_list (list) –
- RESTful:
- Method: PUT URL: /api/annot/name_rowids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[0:2] >>> # check clean state >>> ut.assert_eq(ibs.get_annot_names(aid_list), ['____', 'easy']) >>> ut.assert_eq(ibs.get_annot_exemplar_flags(aid_list), [0, 1]) >>> # run function >>> name_list = ['easy', '____'] >>> name_rowid_list = ibs.get_name_rowids_from_text(name_list) >>> ibs.set_annot_name_rowids(aid_list, name_rowid_list) >>> # check results >>> ut.assert_eq(ibs.get_annot_names(aid_list), ['easy', '____']) >>> ut.assert_eq(ibs.get_annot_exemplar_flags(aid_list), [0, 0]) >>> # restore database state >>> ibs.set_annot_names(aid_list, ['____', 'easy']) >>> ibs.set_annot_exemplar_flags(aid_list, [0, 1]) >>> ut.assert_eq(ibs.get_annot_names(aid_list), ['____', 'easy']) >>> ut.assert_eq(ibs.get_annot_exemplar_flags(aid_list), [0, 1])
-
set_annot_names
(*args, **kwargs)[source]¶ Sets the attrlbl_value of type(INDIVIDUAL_KEY) Sets names/nids of a list of annotations.
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-set_annot_names --enableall
- RESTful:
- Method: PUT URL: /api/annot/names/
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> name_list1 = get_annot_names(ibs, aid_list) >>> name_list2 = [name + '_TESTAUG' for name in name_list1] >>> set_annot_names(ibs, aid_list, name_list2) >>> name_list3 = get_annot_names(ibs, aid_list) >>> set_annot_names(ibs, aid_list, name_list1) >>> name_list4 = get_annot_names(ibs, aid_list) >>> assert name_list2 == name_list3 >>> assert name_list4 == name_list1 >>> assert name_list4 != name_list2 >>> print(result)
-
set_annot_notes
(*args, **kwargs)[source]¶ Sets annotation notes
- RESTful:
- Method: PUT URL: /api/annot/notes/
-
set_annot_pair_as_negative_match
(ibs, aid1, aid2, dryrun=False, on_nontrivial_split=None)[source]¶ TODO: ELEVATE THIS FUNCTION
Parameters: - ibs (IBEISController) – ibeis controller object
- aid1 (int) – annotation id
- aid2 (int) – annotation id
- dryrun (bool) –
CommandLine:
python -m ibeis.annotmatch_funcs --test-set_annot_pair_as_negative_match
Example
>>> # ENABLE_DOCTEST >>> from ibeis.annotmatch_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> aid1, aid2 = ibs.get_valid_aids()[0:2] >>> dryrun = True >>> # execute function >>> result = set_annot_pair_as_negative_match(ibs, aid1, aid2, dryrun) >>> # verify results >>> print(result)
-
set_annot_pair_as_positive_match
(ibs, aid1, aid2, dryrun=False, on_nontrivial_merge=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) – ibeis controller object
- aid1 (int) – query annotation id
- aid2 (int) – matching annotation id
CommandLine:
python -m ibeis.annotmatch_funcs --test-set_annot_pair_as_positive_match
Example
>>> # ENABLE_DOCTEST >>> from ibeis.annotmatch_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid1, aid2 = ibs.get_valid_aids()[0:2] >>> dryrun = True >>> status = set_annot_pair_as_positive_match(ibs, aid1, aid2, dryrun) >>> # verify results >>> print(status)
-
set_annot_pair_as_reviewed
(ibs, aid1, aid2)[source]¶ denote that this match was reviewed and keep whatever status it is given
-
set_annot_parent_rowid
(*args, **kwargs)[source]¶ Sets the annotation’s parent aid. TODO DEPRICATE IN FAVOR OF SEPARATE PARTS TABLE
- RESTful:
- Method: PUT URL: /api/annot/parent_rowid/
-
set_annot_prop
(ibs, prop, aid_list, flags)[source]¶ sets nonstandard properties using the notes column
-
set_annot_qualities
(*args, **kwargs)[source]¶ annot_quality_list -> annot.annot_quality[aid_list]
A quality is an integer representing the following types:
Parameters: - aid_list –
- annot_quality_list –
- SeeAlso:
- ibeis.const.QUALITY_INT_TO_TEXT
- RESTful:
- Method: PUT URL: /api/annot/qualities/
-
set_annot_quality_texts
(ibs, aid_list, quality_text_list)[source]¶ Auto-docstr for ‘set_annot_quality_texts’
- RESTful:
- Method: PUT URL: /api/annot/quality_texts/
-
set_annot_sex
(ibs, aid_list, name_sex_list, eager=True, nInput=None)[source]¶ Auto-docstr for ‘set_annot_sex’
- RESTful:
- Method: PUT URL: /api/annot/sex/
-
set_annot_sex_texts
(ibs, aid_list, name_sex_text_list, eager=True, nInput=None)[source]¶ Auto-docstr for ‘set_annot_sex_texts’
- RESTful:
- Method: PUT URL: /api/annot/sex_texts/
-
set_annot_species
(*args, **kwargs)[source]¶ Sets species/speciesids of a list of annotations. Convenience function for set_annot_lblannot_from_value
- RESTful:
- Method: PUT URL: /api/annot/species/
-
set_annot_species_rowids
(*args, **kwargs)[source]¶ species_rowid_list -> annot.species_rowid[aid_list]
Sets species/speciesids of a list of annotations.
Parameters: - aid_list –
- species_rowid_list –
- RESTful:
- Method: PUT URL: /api/annot/species_rowids/
-
set_annot_tag_text
(*args, **kwargs)[source]¶ annot_tags_list -> annot.annot_tags[aid_list]
Parameters: - aid_list –
- annot_tags_list –
-
set_annot_thetas
(*args, **kwargs)[source]¶ Sets thetas of a list of chips by aid
- RESTful:
- Method: PUT URL: /api/annot/thetas/
-
set_annot_verts
(*args, **kwargs)[source]¶ Sets the vertices [(x, y), ...] of a list of chips by aid
- RESTful:
- Method: PUT URL: /api/annot/verts/
-
set_annot_yaw_texts
(ibs, aid_list, yaw_text_list)[source]¶ Auto-docstr for ‘set_annot_yaw_texts’
- RESTful:
- Method: PUT URL: /api/annot/yaw_texts/
-
set_annot_yaws
(*args, **kwargs)[source]¶ Sets the yaw of a list of chips by aid
A yaw is the yaw of the annotation in radians Viewpoint yaw is inverted. Will be fixed soon.
Note
- The following views have these angles of yaw:
- left side - 0.00 tau radians front side - 0.25 tau radians right side - 0.50 tau radians back side - 0.75 tau radians (tau = 2 * pi)
- SeeAlso:
- ibies.const.VIEWTEXT_TO_YAW_RADIANS
References
http://upload.wikimedia.org/wikipedia/commons/7/7e/Rollpitchyawplain.png
- RESTful:
- Method: PUT URL: /api/annot/yaws/
-
set_annotgroup_note
(*args, **kwargs)[source]¶ annotgroup_note_list -> annotgroup.annotgroup_note[annotgroup_rowid_list]
Parameters: - annotgroup_rowid_list –
- annotgroup_note_list –
- TemplateInfo:
- Tsetter_native_column tbl = annotgroup col = annotgroup_note
-
set_annotgroup_uuid
(*args, **kwargs)[source]¶ annotgroup_uuid_list -> annotgroup.annotgroup_uuid[annotgroup_rowid_list]
Parameters: - annotgroup_rowid_list –
- annotgroup_uuid_list –
- TemplateInfo:
- Tsetter_native_column tbl = annotgroup col = annotgroup_uuid
-
set_annotmatch_confidence
(*args, **kwargs)[source]¶ annotmatch_confidence_list -> annotmatch.annotmatch_confidence[annotmatch_rowid_list]
Parameters: - annotmatch_rowid_list –
- annotmatch_confidence_list –
- TemplateInfo:
- Tsetter_native_column tbl = annotmatch col = annotmatch_confidence
-
set_annotmatch_config_hashid
(*args, **kwargs)[source]¶ config_hashid_list -> annotmatch.config_hashid[annotmatch_rowid_list]
Parameters: - annotmatch_rowid_list –
- config_hashid_list –
- TemplateInfo:
- Tsetter_native_column tbl = annotmatch col = config_hashid
-
set_annotmatch_pairwise_prob
(*args, **kwargs)[source]¶ annotmatch_pairwise_prob_list -> annotmatch.annotmatch_pairwise_prob[annotmatch_rowid_list]
Parameters: - annotmatch_rowid_list –
- annotmatch_pairwise_prob_list –
- TemplateInfo:
- Tsetter_native_column tbl = annotmatch col = annotmatch_pairwise_prob
-
set_annotmatch_posixtime_modified
(*args, **kwargs)[source]¶ annotmatch_posixtime_modified_list -> annotmatch.annotmatch_posixtime_modified[annotmatch_rowid_list]
Parameters: - annotmatch_rowid_list –
- annotmatch_posixtime_modified_list –
- TemplateInfo:
- Tsetter_native_column tbl = annotmatch col = annotmatch_posixtime_modified
-
set_annotmatch_prop
(ibs, prop, annotmatch_rowids, flags)[source]¶ hacky setter for dynamic properties of annotmatches using notes table
-
set_annotmatch_reviewed
(*args, **kwargs)[source]¶ annotmatch_reviewed_list -> annotmatch.annotmatch_reviewed[annotmatch_rowid_list]
Parameters: - annotmatch_rowid_list –
- annotmatch_reviewed_list –
- TemplateInfo:
- Tsetter_native_column tbl = annotmatch col = annotmatch_reviewed
-
set_annotmatch_reviewer
(*args, **kwargs)[source]¶ annotmatch_reviewer_list -> annotmatch.annotmatch_reviewer[annotmatch_rowid_list]
Parameters: - annotmatch_rowid_list –
- annotmatch_reviewer_list –
- TemplateInfo:
- Tsetter_native_column tbl = annotmatch col = annotmatch_reviewer
-
set_annotmatch_tag_text
(*args, **kwargs)[source]¶ annotmatch_tag_text_list -> annotmatch.annotmatch_tag_text[annotmatch_rowid_list]
Parameters: - annotmatch_rowid_list –
- annotmatch_tag_text_list –
- TemplateInfo:
- Tsetter_native_column tbl = annotmatch col = annotmatch_tag_text
-
set_annotmatch_truth
(*args, **kwargs)[source]¶ annotmatch_truth_list -> annotmatch.annotmatch_truth[annotmatch_rowid_list]
Parameters: - annotmatch_rowid_list –
- annotmatch_truth_list –
- TemplateInfo:
- Tsetter_native_column tbl = annotmatch col = annotmatch_truth
-
set_config_contributor_rowid
(ibs, config_rowid_list, contrib_rowid_list)[source]¶ Sets the config’s contributor rowid
- RESTful:
- Method: PUT URL: /api/config/contributor_rowid/
-
set_config_contributor_unassigned
(ibs, contrib_rowid)[source]¶ - RESTful:
- Method: PUT URL: /api/config/contributor_unassigned/
-
set_database_version
(ibs, db, version)[source]¶ Sets the specified database’s version from the controller
-
set_exemplars_from_quality_and_viewpoint
(ibs, aid_list=None, exemplars_per_view=None, imgsetid=None, dry_run=False, verbose=False)[source]¶ Automatic exemplar selection algorithm based on viewpoint and quality
References
# implement maximum diversity approximation instead http://www.csbio.unc.edu/mcmillan/pubs/ICDM07_Pan.pdf
CommandLine:
python -m ibeis.other.ibsfuncs --test-set_exemplars_from_quality_and_viewpoint python -m ibeis.other.ibsfuncs --test-set_exemplars_from_quality_and_viewpoint:1
Example
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> # build test data >>> #ibs = ibeis.opendb('PZ_MUGU_19') >>> ibs = ibeis.opendb('PZ_MTEST') >>> dry_run = True >>> verbose = False >>> old_sum = sum(ibs.get_annot_exemplar_flags(ibs.get_valid_aids())) >>> new_aid_list, new_flag_list = ibs.set_exemplars_from_quality_and_viewpoint(dry_run=dry_run) >>> new_sum = sum(new_flag_list) >>> print('old_sum = %r' % (old_sum,)) >>> print('new_sum = %r' % (new_sum,)) >>> zero_aid_list, zero_flag_list = ibs.set_exemplars_from_quality_and_viewpoint(exemplars_per_view=0, dry_run=dry_run) >>> assert sum(zero_flag_list) == 0 >>> result = new_sum
- Example1:
>>> # ENABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> dry_run = True >>> verbose = False >>> old_sum = sum(ibs.get_annot_exemplar_flags(ibs.get_valid_aids())) >>> new_aid_list, new_flag_list = ibs.set_exemplars_from_quality_and_viewpoint(dry_run=dry_run) >>> assert len(new_aid_list) == len(new_flag_list) >>> # 2 of the 11 annots are unknown and should not be exemplars >>> ut.assert_eq(len(new_aid_list), 9)
- Example2:
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb2') >>> dry_run = True >>> verbose = False >>> imgsetid = None >>> new_aid_list, new_flag_list = ibs.set_exemplars_from_quality_and_viewpoint(dry_run=dry_run) >>> old_flag_list = ibs.get_annot_exemplar_flags(new_aid_list) >>> new_exemplar_aids = ut.compress(new_aid_list, new_flag_list) >>> new_exemplar_qualtexts = ibs.get_annot_quality_texts(new_exemplar_aids) >>> assert 'junk' not in new_exemplar_qualtexts, 'should not have junk exemplars' >>> assert 'poor' not in new_exemplar_qualtexts, 'should not have poor exemplars' >>> #assert len(new_aid_list) == len(new_flag_list) >>> # 2 of the 11 annots are unknown and should not be exemplars >>> #ut.assert_eq(len(new_aid_list), 9)
-
set_image_contributor_rowid
(*args, **kwargs)[source]¶ Sets the image contributor rowid
- RESTful:
- Method: PUT URL: /api/image/contributor_rowid/
-
set_image_enabled
(*args, **kwargs)[source]¶ Sets the image all instances found bit
- RESTful:
- Method: PUT URL: /api/image/enabled/
-
set_image_gps
(*args, **kwargs)[source]¶ - see get_image_gps for how the gps_list should look.
- lat and lon should be given in degrees
- RESTful:
- Method: PUT URL: /api/image/gps/
-
set_image_imagesettext
(*args, **kwargs)[source]¶ Sets the encoutertext of each image
- RESTful:
- Method: PUT URL: /api/image/imagesettext/
-
set_image_imgsetids
(*args, **kwargs)[source]¶ Sets the encoutertext of each image
- RESTful:
- Method: PUT URL: /api/image/imgsetids/
-
set_image_location_codes
(ibs, image_rowid_list, image_location_code_list, duplicate_behavior='error')[source]¶ image_location_code_list -> image.image_location_code[image_rowid_list]
Parameters: - image_rowid_list –
- image_location_code_list –
- TemplateInfo:
- Tsetter_native_column tbl = image col = image_location_code
- RESTful:
- Method: PUT URL: /api/image/location_codes/
-
set_image_notes
(*args, **kwargs)[source]¶ Sets the image all instances found bit
- RESTful:
- Method: PUT URL: /api/image/notes/
-
set_image_party_rowids
(*args, **kwargs)[source]¶ party_rowid_list -> image.party_rowid[image_rowid_list]
Parameters: - image_rowid_list –
- party_rowid_list –
- TemplateInfo:
- Tsetter_native_column tbl = image col = party_rowid
- RESTful:
- Method: PUT URL: /api/image/party_rowids/
-
set_image_reviewed
(*args, **kwargs)[source]¶ Sets the image all instances found bit
- RESTful:
- Method: PUT URL: /api/image/reviewed/
-
set_image_time_posix
(ibs, image_rowid_list, image_time_posix_list, duplicate_behavior='error')[source]¶ image_time_posix_list -> image.image_time_posix[image_rowid_list]
- SeeAlso:
- set_image_unixtime
Parameters: - image_rowid_list –
- image_time_posix_list –
- TemplateInfo:
- Tsetter_native_column tbl = image col = image_time_posix
- RESTful:
- Method: PUT URL: /api/image/time_posix/
-
set_image_timedelta_posix
(ibs, image_rowid_list, image_timedelta_posix_list, duplicate_behavior='error')[source]¶ image_timedelta_posix_list -> image.image_timedelta_posix[image_rowid_list]
Parameters: - image_rowid_list –
- image_timedelta_posix_list –
- TemplateInfo:
- Tsetter_native_column tbl = image col = image_timedelta_posix
- RESTful:
- Method: PUT URL: /api/image/timedelta_posix/
-
set_image_unixtime
(*args, **kwargs)[source]¶ - Sets the image unixtime (does not modify exif yet)
- alias for set_image_time_posix
- RESTful:
- Method: PUT URL: /api/image/unixtime/
-
set_image_uris
(*args, **kwargs)[source]¶ Sets the image URIs to a new local path. This is used when localizing or unlocalizing images. An absolute path can either be on this machine or on the cloud A relative path is relative to the ibeis image cache on this machine.
- RESTful:
- Method: PUT URL: /api/image/uris/
-
set_image_uris_original
(*args, **kwargs)[source]¶ Sets the (original) image URIs to a new local path.
Parameters: overwrite (bool) – If overwrite, replace the information in the database. This ensures that original uris cannot be accidentally overwritten. Defaults to False. - RESTful:
- Method: PUT URL: /api/image/uris_original/
-
set_imageset_end_time_posix
(*args, **kwargs)[source]¶ imageset_end_time_posix_list -> imageset.imageset_end_time_posix[imageset_rowid_list]
Parameters: - imageset_rowid_list –
- imageset_end_time_posix_list –
- TemplateInfo:
- Tsetter_native_column tbl = imageset col = imageset_end_time_posix
- RESTful:
- Method: PUT URL: /api/imageset/end_time_posix/
-
set_imageset_gps_lats
(*args, **kwargs)[source]¶ imageset_gps_lat_list -> imageset.imageset_gps_lat[imageset_rowid_list]
Parameters: - imageset_rowid_list –
- imageset_gps_lat_list –
- TemplateInfo:
- Tsetter_native_column tbl = imageset col = imageset_gps_lat
- RESTful:
- Method: PUT URL: /api/imageset/gps_lats/
-
set_imageset_gps_lons
(*args, **kwargs)[source]¶ imageset_gps_lon_list -> imageset.imageset_gps_lon[imageset_rowid_list]
Parameters: - imageset_rowid_list –
- imageset_gps_lon_list –
- TemplateInfo:
- Tsetter_native_column tbl = imageset col = imageset_gps_lon
- RESTful:
- Method: PUT URL: /api/imageset/gps_lons/
-
set_imageset_notes
(*args, **kwargs)[source]¶ imageset_note_list -> imageset.imageset_note[imageset_rowid_list]
Parameters: - imageset_rowid_list –
- imageset_note_list –
- TemplateInfo:
- Tsetter_native_column tbl = imageset col = imageset_note
- RESTful:
- Method: PUT URL: /api/imageset/notes/
-
set_imageset_processed_flags
(*args, **kwargs)[source]¶ imageset_processed_flag_list -> imageset.imageset_processed_flag[imageset_rowid_list]
Parameters: - imageset_rowid_list –
- imageset_processed_flag_list –
- TemplateInfo:
- Tsetter_native_column tbl = imageset col = imageset_processed_flag
- RESTful:
- Method: PUT URL: /api/imageset/processed_flags/
-
set_imageset_shipped_flags
(*args, **kwargs)[source]¶ imageset_shipped_flag_list -> imageset.imageset_shipped_flag[imageset_rowid_list]
Parameters: - imageset_rowid_list –
- imageset_shipped_flag_list –
- TemplateInfo:
- Tsetter_native_column tbl = imageset col = imageset_shipped_flag
- RESTful:
- Method: PUT URL: /api/imageset/shipped_flags/
-
set_imageset_smart_waypoint_ids
(ibs, imageset_rowid_list, imageset_smart_waypoint_id_list)[source]¶ imageset_smart_waypoint_id_list -> imageset.imageset_smart_waypoint_id[imageset_rowid_list]
Parameters: - imageset_rowid_list –
- imageset_smart_waypoint_id_list –
- TemplateInfo:
- Tsetter_native_column tbl = imageset col = imageset_smart_waypoint_id
- RESTful:
- Method: PUT URL: /api/imageset/smart_waypoint_ids/
-
set_imageset_smart_xml_fnames
(ibs, imageset_rowid_list, imageset_smart_xml_fname_list)[source]¶ imageset_smart_xml_fname_list -> imageset.imageset_smart_xml_fname[imageset_rowid_list]
Parameters: - imageset_rowid_list –
- imageset_smart_xml_fname_list –
- TemplateInfo:
- Tsetter_native_column tbl = imageset col = imageset_smart_xml_fname
- RESTful:
- Method: PUT URL: /api/imageset/smart_xml_fnames/
-
set_imageset_start_time_posix
(*args, **kwargs)[source]¶ imageset_start_time_posix_list -> imageset.imageset_start_time_posix[imageset_rowid_list]
Parameters: - imageset_rowid_list –
- imageset_start_time_posix_list –
- TemplateInfo:
- Tsetter_native_column tbl = imageset col = imageset_start_time_posix
- RESTful:
- Method: PUT URL: /api/imageset/start_time_posix/
-
set_imageset_text
(*args, **kwargs)[source]¶ Sets names of imagesets (groups of animals)
- RESTful:
- Method: PUT URL: /api/imageset/text/
-
set_lblannot_notes
(ibs, lblannot_rowid_list, value_list)[source]¶ Updates the value for lblannots. Note this change applies to all annotations related to this lblannot_rowid
-
set_lblannot_values
(ibs, lblannot_rowid_list, value_list)[source]¶ Updates the value for lblannots. Note this change applies to all annotations related to this lblannot_rowid
-
set_metadata_value
(*args, **kwargs)[source]¶ Sets metadata key, value pairs
- RESTful:
- Method: PUT URL: /api/metadata/value/
-
set_name_alias_texts
(*args, **kwargs)[source]¶ Returns: list_ – name_alias_text_list Return type: list CommandLine:
python -m ibeis.control.manual_name_funcs --test-get_name_texts
- RESTful:
- Method: PUT URL: /api/name/alias_texts/
-
set_name_notes
(*args, **kwargs)[source]¶ Sets a note for each name (multiple annotations)
- RESTful:
- Method: PUT URL: /api/name/notes/
-
set_name_sex
(ibs, name_rowid_list, name_sex_list, duplicate_behavior='error')[source]¶ name_sex_list -> name.name_sex[name_rowid_list]
Parameters: - name_rowid_list –
- name_sex_list –
- TemplateInfo:
- Tsetter_native_column tbl = name col = name_sex
- RESTful:
- Method: PUT URL: /api/name/sex/
-
set_name_sex_text
(ibs, name_rowid_list, name_sex_text_list)[source]¶ - RESTful:
- Method: PUT URL: /api/name/sex_text/
-
set_name_temp_flag
(ibs, name_rowid_list, name_temp_flag_list, duplicate_behavior='error')[source]¶ name_temp_flag_list -> name.name_temp_flag[name_rowid_list]
Parameters: - name_rowid_list –
- name_temp_flag_list –
- TemplateInfo:
- Tsetter_native_column tbl = name col = name_temp_flag
- RESTful:
- Method: PUT URL: /api/name/temp_flag/
-
set_name_texts
(*args, **kwargs)[source]¶ Changes the name text. Does not affect the animals of this name. Effectively just changes the TEXT UUID
CommandLine:
python -m ibeis.control.manual_name_funcs --test-set_name_texts
- RESTful:
- Method: PUT URL: /api/name/texts/
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> nid_list = ibs.get_valid_nids()[0:2] >>> name_list = ibs.get_name_texts(nid_list) >>> # result = set_name_texts(ibs, nid_list, name_list) >>> print(result)
-
set_species_enabled
(*args, **kwargs)[source]¶ Sets the species all instances enabled bit
- RESTful:
- Method: PUT URL: /api/species/enabled/
-
start_detect_image
(ibs, image_uuid_list, callback_url=None)[source]¶ - REST:
- Method: GET URL: /api/engine/detect/cnn/yolo/
Parameters: - image_uuid_list (list) – list of image uuids to detect on.
- callback_url (url) – url that will be called when detection succeeds or fails
-
start_identify_annots
(ibs, qannot_uuid_list, dannot_uuid_list=None, pipecfg={}, callback_url=None)[source]¶ - REST:
- Method: GET URL: /api/engine/start_identify_annots/
Parameters: - qannot_uuid_list (list) – specifies the query annotations to identify.
- dannot_uuid_list (list) – specifies the annotations that the algorithm is allowed to use for identification. If not specified all annotations are used. (default=None)
- pipecfg (dict) – dictionary of pipeline configuration arguments (default=None)
CommandLine:
# Run as main process python -m ibeis.web.apis_engine --exec-start_identify_annots:0 # Run using server process python -m ibeis.web.apis_engine --exec-start_identify_annots:1 # Split into multiple processes python -m ibeis.web.apis_engine --main --bg python -m ibeis.web.apis_engine --exec-start_identify_annots:1 --fg python -m ibeis.web.apis_engine --exec-start_identify_annots:1 --domain http://52.33.105.88 python -m ibeis.web.apis_engine --exec-start_identify_annots:1 --duuids=[] python -m ibeis.web.apis_engine --exec-start_identify_annots:1 --domain http://52.33.105.88 --duuids=03a17411-c226-c960-d180-9fafef88c880
Example
>>> # DISABLE_DOCTEST >>> from ibeis.web.apis_engine import * # NOQA >>> from ibeis.web import apis_engine >>> import ibeis >>> ibs, qaids, daids = ibeis.testdata_expanded_aids( >>> defaultdb='PZ_MTEST', a=['default:qsize=2,dsize=10']) >>> qannot_uuid_list = ibs.get_annot_uuids(qaids) >>> dannot_uuid_list = ibs.get_annot_uuids(daids) >>> pipecfg = {} >>> ibs.initialize_job_manager() >>> jobid = ibs.start_identify_annots(qannot_uuid_list, dannot_uuid_list, pipecfg) >>> result = ibs.wait_for_job_result(jobid, timeout=None, freq=2) >>> print(result) >>> import utool as ut >>> print(ut.to_json(result)) >>> ibs.close_job_manager()
Example
>>> # WEB_DOCTEST >>> from ibeis.web.apis_engine import * # NOQA >>> import ibeis >>> web_ibs = ibeis.opendb_bg_web('testdb1', wait=3) # , domain='http://52.33.105.88') >>> aids = web_ibs.send_ibeis_request('/api/annot/', 'get')[0:10] >>> uuid_list = web_ibs.send_ibeis_request('/api/annot/uuids/', aid_list=aids) >>> quuid_list = ut.get_argval('--quuids', type_=list, default=uuid_list) >>> duuid_list = ut.get_argval('--duuids', type_=list, default=uuid_list) >>> data = dict( >>> qannot_uuid_list=quuid_list, dannot_uuid_list=duuid_list, >>> pipecfg={}, >>> callback_url='http://127.0.1.1:5832' >>> ) >>> # Start callback server >>> bgserver = ensure_simple_server() >>> # -- >>> jobid = web_ibs.send_ibeis_request('/api/engine/start_identify_annots/', **data) >>> waittime = 1 >>> while True: >>> print('jobid = %s' % (jobid,)) >>> response1 = web_ibs.send_ibeis_request('/api/engine/job/status/', jobid=jobid) >>> if response1['jobstatus'] == 'completed': >>> break >>> time.sleep(waittime) >>> waittime = 10 >>> print('response1 = %s' % (response1,)) >>> response2 = web_ibs.send_ibeis_request('/api/engine/job/result/', jobid=jobid) >>> print('response2 = %s' % (response2,)) >>> cmdict = ut.from_json(response2['json_result'])[0] >>> print('Finished test') >>> web_ibs.terminate2() >>> bgserver.terminate2()
-
unrelate_images_and_imagesets
(*args, **kwargs)[source]¶ Seems to unrelate specific image imageset pairs
Parameters: - ibs (IBEISController) – ibeis controller object
- gid_list (list) –
- imgsetid_list (list) –
Returns: gids_list
Return type: list
CommandLine:
python -m ibeis.control.manual_gsgrelate_funcs --test-unrelate_images_and_imagesets python -c "import utool; print(utool.auto_docstr('ibeis.control.manual_gsgrelate_funcs', 'delete_gsgr_image_relations'))"
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_gsgrelate_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> # Reset and compute imagesets >>> ibs.delete_all_imagesets() >>> ibs.compute_occurrences() >>> imgsetid_list = ibs.get_valid_imgsetids() >>> gids_list = ibs.get_imageset_gids(imgsetid_list) >>> assert len(imgsetid_list) == 2 >>> assert len(gids_list) == 2 >>> assert len(gids_list[0]) == 7 >>> assert len(gids_list[1]) == 6 >>> # Add imageset 2 gids to imageset 1 so an image belongs to multiple imagesets >>> imgset2_gids = gids_list[1][0:1] >>> imgset1_imgsetids = imgsetid_list[0:1] >>> ibs.add_image_relationship(imgset2_gids, imgset1_imgsetids) >>> # Now delete the image from the imageset 2 >>> imgset2_imgsetids = imgsetid_list[1:2] >>> # execute function >>> ibs.unrelate_images_and_imagesets(imgset2_gids, imgset2_imgsetids) >>> # verify results >>> ibs.print_egpairs_table() >>> imgsetid_list_ = ibs.get_valid_imgsetids() >>> gids_list_ = ibs.get_imageset_gids(imgsetid_list_) >>> result = str(gids_list_) >>> print(result) >>> # imgset2_gids should now only be in imageset1 >>> assert imgset2_gids[0] in gids_list_[0] >>> assert imgset2_gids[0] not in gids_list_[1]
-
update_annot_semantic_uuids
(ibs, aid_list, _visual_infotup=None)[source]¶ Ensures that annots have the proper semantic uuids
- RESTful:
- Method: PUT URL: /api/annot/semantic_uuids/
-
update_annot_visual_uuids
(ibs, aid_list)[source]¶ Ensures that annots have the proper visual uuids
Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (list) – list of annotation rowids
- RESTful:
- Method: PUT URL: /api/annot/visual_uuids/
CommandLine:
python -m ibeis.control.manual_annot_funcs --exec-update_annot_visual_uuids --db PZ_Master1 python -m ibeis --tf update_annot_visual_uuids --db PZ_Master1 python -m ibeis --tf update_annot_visual_uuids --db PZ_Master0 python -m ibeis --tf update_annot_visual_uuids --db PZ_MTEST
Example
>>> # SCRIPT >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid_list = ibs._get_all_aids() >>> update_annot_visual_uuids(ibs, aid_list)
-
update_imageset_info
(ibs, imageset_rowid_list)[source]¶ sets start and end time for imagesets
FIXME: should not need to bulk update, should be handled as it goes
- RESTful:
- Method: PUT URL: /api/imageset/info/
Example
>>> # DOCTEST_DISABLE >>> imageset_rowid_list = ibs.get_valid_imgsetids()
-
update_query_cfg
(ibs, **kwargs)[source]¶ Updates query config only. Configs needs a restructure very badly DEPRICATE
- RESTful:
- Method: PUT URL: /api/query/cfg/
-
update_reviewed_unreviewed_image_special_imageset
(*args, **kwargs)[source]¶ Creates imageset of images that have not been reviewed and that have been reviewed
-
update_ungrouped_special_imageset
(ibs)[source]¶ Parameters: ibs (IBEISController) – ibeis controller object CommandLine:
python -m ibeis.other.ibsfuncs --test-update_ungrouped_special_imageset
Example
>>> # DISABLE_DOCTEST >>> from ibeis.other.ibsfuncs import * # NOQA >>> import ibeis # NOQA >>> # build test data >>> ibs = ibeis.opendb('testdb9') >>> # execute function >>> result = update_ungrouped_special_imageset(ibs) >>> # verify results >>> print(result)
-
use_images_as_annotations
(ibs, gid_list, name_list=None, nid_list=None, notes_list=None, adjust_percent=0.0)[source]¶ Adds an annotation the size of the entire image to each image. adjust_percent - shrinks the ANNOTATION by percentage on each side
-
validate_annot_species_viewpoint_cnn
(ibs, aid_list, verbose=False)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
- verbose (bool) – verbosity flag(default = False)
Returns: (bad_species_list, bad_viewpoint_list)
Return type: tuple
CommandLine:
python -m ibeis_cnn._plugin --exec-validate_annot_species_viewpoint_cnn --db PZ_FlankHack python -m ibeis_cnn._plugin --exec-validate_annot_species_viewpoint_cnn --db GZ_Master1
Example
>>> # DISABLE_DOCTEST >>> from ibeis_cnn._plugin import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid_list = ibs.get_valid_aids() >>> verbose = False >>> (bad_species_list, bad_viewpoint_list) = validate_annot_species_viewpoint_cnn(ibs, aid_list, verbose) >>> print('bad_species_list = %s' % (bad_species_list,)) >>> print('bad_species_list = %s' % (bad_viewpoint_list,)) >>> print(result)
- Ignore:
- bad_viewpoint_list_ = [item for item in bad_viewpoint_list if item[2] is not None and item[0] > 1200] grouped_dict = ut.group_items(bad_viewpoint_list, ut.get_list_column(bad_viewpoint_list_, 3)) grouped_list = grouped_dict.values() regrouped_items = ut.flatten(ut.sortedby(grouped_list, map(len, grouped_list))) candidate_aid_list = ut.get_list_column(regrouped_items, 0) print(‘candidate_aid_list = %r’ % (candidate_aid_list,))
-
web_check_uuids
(ibs, image_uuid_list=[], qannot_uuid_list=[], dannot_uuid_list=[])[source]¶ Parameters: - ibs (ibeis.IBEISController) – image analysis api
- image_uuid_list (list) – (default = [])
- qannot_uuid_list (list) – (default = [])
- dannot_uuid_list (list) – (default = [])
CommandLine:
python -m ibeis.web.apis_engine --exec-web_check_uuids --show
Example
>>> # DISABLE_DOCTEST >>> from ibeis.web.apis_engine import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> image_uuid_list = [] >>> qannot_uuid_list = ibs.get_annot_uuids([1, 1, 2, 3, 2, 4]) >>> dannot_uuid_list = ibs.get_annot_uuids([1, 2, 3]) >>> try: >>> web_check_uuids(ibs, image_uuid_list, qannot_uuid_list, >>> dannot_uuid_list) >>> except controller_inject.DuplicateUUIDException: >>> pass >>> else: >>> raise AssertionError('Should have gotten DuplicateUUIDException') >>> try: >>> web_check_uuids(ibs, [1, 2, 3], qannot_uuid_list, >>> dannot_uuid_list) >>> except controller_inject.WebMissingUUIDException as ex: >>> pass >>> else: >>> raise AssertionError('Should have gotten WebMissingUUIDException') >>> print('Successfully reported errors')
-
wildbook_signal_annot_name_changes
(ibs, aid_list=None, tomcat_dpath=None, wb_target=None, dryrun=False)[source]¶ Parameters: - aid_list (int) – list of annotation ids(default = None)
- tomcat_dpath (None) – (default = None)
- wb_target (None) – (default = None)
- dryrun (bool) – (default = False)
CommandLine:
python -m ibeis.control.manual_wildbook_funcs --test-wildbook_signal_annot_name_changes:0 --dryrun python -m ibeis.control.manual_wildbook_funcs --test-wildbook_signal_annot_name_changes:1 --dryrun python -m ibeis.control.manual_wildbook_funcs --test-wildbook_signal_annot_name_changes:1 python -m ibeis.control.manual_wildbook_funcs --test-wildbook_signal_annot_name_changes:2 python -m ibeis --tf wildbook_signal_annot_name_changes:0 --dryrun python -m ibeis --tf wildbook_signal_annot_name_changes:1 --dryrun python -m ibeis --tf wildbook_signal_annot_name_changes:1 python -m ibeis --tf wildbook_signal_annot_name_changes:2
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_wildbook_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='PZ_MTEST') >>> #gid_list = ibs.get_valid_gids()[0:10] >>> gid_list = ibs.get_valid_gids()[3:5] >>> aid_list = ut.flatten(ibs.get_image_aids(gid_list)) >>> # Test case where some names change, some do not. There are no new names. >>> old_nid_list = ibs.get_annot_name_rowids(aid_list) >>> new_nid_list = ut.list_roll(old_nid_list, 1) >>> ibs.set_annot_name_rowids(aid_list, new_nid_list) >>> dryrun = ut.get_argflag('--dryrun') >>> wb_target, tomcat_dpath = testdata_wildbook_server() >>> result = ibs.wildbook_signal_annot_name_changes(aid_list, tomcat_dpath, wb_target, dryrun) >>> ibs.set_annot_name_rowids(aid_list, old_nid_list)
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_wildbook_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='PZ_MTEST') >>> #gid_list = ibs.get_valid_gids()[0:10] >>> gid_list = ibs.get_valid_gids()[3:5] >>> aid_list = ut.flatten(ibs.get_image_aids(gid_list)) >>> # Test case where all names change to one known name >>> #old_nid_list = ibs.get_annot_name_rowids(aid_list) >>> #new_nid_list = [old_nid_list[0]] * len(old_nid_list) >>> old_nid_list = [1, 2] >>> new_nid_list = [1, 1] >>> print('old_nid_list = %r' % (old_nid_list,)) >>> print('new_nid_list = %r' % (new_nid_list,)) >>> ibs.set_annot_name_rowids(aid_list, new_nid_list) >>> dryrun = ut.get_argflag('--dryrun') >>> wb_target, tomcat_dpath = testdata_wildbook_server() >>> result = ibs.wildbook_signal_annot_name_changes(aid_list, tomcat_dpath, wb_target, dryrun) >>> # Undo changes here (not undone in wildbook) >>> #ibs.set_annot_name_rowids(aid_list, old_nid_list)
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_wildbook_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='PZ_MTEST') >>> gid_list = ibs.get_valid_gids()[3:5] >>> aid_list = ut.flatten(ibs.get_image_aids(gid_list)) >>> old_nid_list = [1, 2] >>> ibs.set_annot_name_rowids(aid_list, old_nid_list) >>> # Signal what currently exists (should put them back to normal) >>> dryrun = ut.get_argflag('--dryrun') >>> wb_target, tomcat_dpath = testdata_wildbook_server() >>> result = ibs.wildbook_signal_annot_name_changes(aid_list, tomcat_dpath, wb_target, dryrun)
-
wildbook_signal_imgsetid_list
(ibs, imgsetid_list=None, set_shipped_flag=True, open_url_on_complete=True, tomcat_dpath=None, wb_target=None, dryrun=False)[source]¶ Exports specified imagesets to wildbook. This is a synchronous call.
Parameters: - imgsetid_list (list) – (default = None)
- set_shipped_flag (bool) – (default = True)
- open_url_on_complete (bool) – (default = True)
- RESTful:
- Method: PUT URL: /api/wildbook/signal_imgsetid_list/
CommandLine:
python -m ibeis.control.manual_wildbook_funcs --test-wildbook_signal_imgsetid_list python -m ibeis.control.manual_wildbook_funcs --test-wildbook_signal_imgsetid_list --dryrun python -m ibeis.control.manual_wildbook_funcs --test-wildbook_signal_imgsetid_list --break
- SeeAlso:
- ~/local/build_scripts/init_wildbook.sh
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_wildbook_funcs import * # NOQA >>> dryrun = ut.get_argflag('--dryrun') >>> wb_target, tomcat_dpath = testdata_wildbook_server() >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='PZ_MTEST') >>> #gid_list = ibs.get_valid_gids()[0:10] >>> gid_list = ibs.get_valid_gids()[3:5] >>> new_imgsetid = ibs.create_new_imageset_from_images(gid_list) # NOQA >>> print('new imageset uuid = %r' % (ibs.get_imageset_uuid(new_imgsetid),)) >>> print('new imageset text = %r' % (ibs.get_imageset_text(new_imgsetid),)) >>> imgsetid_list = [new_imgsetid] >>> ibs.set_imageset_processed_flags([new_imgsetid], [1]) >>> gid_list = ibs.get_imageset_gids(new_imgsetid) >>> ibs.set_image_reviewed(gid_list, [1] * len(gid_list)) >>> set_shipped_flag = True >>> open_url_on_complete = True >>> result = ibs.wildbook_signal_imgsetid_list(imgsetid_list, set_shipped_flag, open_url_on_complete, tomcat_dpath, wb_target, dryrun) >>> # cleanup >>> #ibs.delete_imagesets(new_imgsetid) >>> print(result)
-
ibeis.control._autogen_party_funcs module¶
Autogenerated IBEISController functions
- TemplateInfo:
- autogen_time = 15:14:53 2015/03/11 autogen_key = party
- ToRegenerate:
- python -m ibeis.templates.template_generator –key party –Tcfg with_api_cache=False with_web_api=False with_deleters=False –diff python -m ibeis.templates.template_generator –key party –Tcfg with_api_cache=False with_web_api=False with_deleters=False –write
-
ibeis.control._autogen_party_funcs.
add_party
(ibs, party_tag_list)[source]¶ Returns: returns party_rowid_list of added (or already existing partys) - TemplateInfo:
- Tadder_native tbl = party
- RESTful:
- Method: POST URL: /api/autogen/
-
ibeis.control._autogen_party_funcs.
get_party_rowid_from_superkey
(ibs, party_tag_list, eager=True, nInput=None)[source]¶ party_rowid_list <- party[party_tag_list]
Parameters: lists (superkey) – party_tag_list Returns: party_rowid_list - TemplateInfo:
- Tgetter_native_rowid_from_superkey tbl = party
- RESTful:
- Method: GET URL: /api/autogen/party_rowid_from_superkey/
-
ibeis.control._autogen_party_funcs.
get_party_tag
(ibs, party_rowid_list, eager=True, nInput=None)[source]¶ party_tag_list <- party.party_tag[party_rowid_list]
gets data from the “native” column “party_tag” in the “party” table
Parameters: party_rowid_list (list) – Returns: party_tag_list Return type: list - TemplateInfo:
- Tgetter_table_column col = party_tag tbl = party
- RESTful:
- Method: GET URL: /api/autogen/party_tag/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._autogen_party_funcs import * # NOQA >>> ibs, qreq_ = testdata_ibs() >>> party_rowid_list = ibs._get_all_party_rowids() >>> eager = True >>> party_tag_list = ibs.get_party_tag(party_rowid_list, eager=eager) >>> assert len(party_rowid_list) == len(party_tag_list)
ibeis.control._sql_helpers module¶
-
ibeis.control._sql_helpers.
autogenerate_nth_schema_version
(schema_spec, n=-1)[source]¶ dumps, prints, or diffs autogen schema based on command line
Parameters: n (int) – CommandLine:
python -m ibeis.control._sql_helpers --test-autogenerate_nth_schema_version
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control._sql_helpers import * # NOQA >>> from ibeis.control import DB_SCHEMA >>> # build test data >>> schema_spec = DB_SCHEMA >>> n = 1 >>> # execute function >>> tablename = autogenerate_nth_schema_version(schema_spec, n) >>> # verify results >>> result = str(tablename) >>> print(result)
-
ibeis.control._sql_helpers.
compare_string_versions
(a, b)[source]¶ Example
>>> # ENABLE_DOCTEST >>> from ibeis.control._sql_helpers import * # NOQA >>> a = '1.1.1' >>> b = '1.0.0' >>> result1 = compare_string_versions(a, b) >>> result2 = compare_string_versions(b, a) >>> result3 = compare_string_versions(a, a) >>> result = ', '.join(map(str, [result1, result2, result3])) >>> print(result) 1, -1, 0
-
ibeis.control._sql_helpers.
database_backup
(db_dir, db_fname, backup_dir, max_keep=2048, manual=True)[source]¶
-
ibeis.control._sql_helpers.
ensure_correct_version
(ibs, db, version_expected, schema_spec, dobackup=True, verbose=True)[source]¶ FIXME: AN SQL HELPER FUNCTION SHOULD BE AGNOSTIC TO CONTROLER OBJECTS
ensure_correct_version
Parameters: - ibs (IBEISController) –
- db (SQLController) –
- version_expected (str) – version you want to be at
- schema_spec (module) – schema module
- dobackup (bool) –
Example
>>> from ibeis.control._sql_helpers import * # NOQA >>> ibs = '?' >>> db = ibs.db >>> version_expected = ibs.db_version_expected >>> schema_spec = DB_SCHEMA >>> dobackup = True >>> result = ensure_correct_version(ibs, db, version_expected, schema_spec, dobackup) >>> print(result)
Parameters: schema_spec (module) – module of schema specifications
-
ibeis.control._sql_helpers.
ensure_daily_database_backup
(db_dir, db_fname, backup_dir, max_keep=2048)[source]¶
-
ibeis.control._sql_helpers.
fix_metadata_consistency
(db)[source]¶ duct tape function
db.print_table_csv(‘metadata’)
-
ibeis.control._sql_helpers.
get_backupdir
(db_dir, db_fname)[source]¶ CommandLine:
python -m _sql_helpers get_backupdir --show
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control._sql_helpers import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> db_dir = ibs.get_ibsdir() >>> db_fname = ibs.sqldb_fname >>> backup_dir = ibs.backupdir >>> result = get_backupdir(db_dir, db_fname)
-
ibeis.control._sql_helpers.
get_nth_test_schema_version
(schema_spec, n=-1)[source]¶ Gets a fresh and empty test version of a schema
Parameters: - schema_spec (module) – schema module to get nth version of
- n (int) – version index (-1 is the latest)
-
ibeis.control._sql_helpers.
revert_to_backup
(ibs)[source]¶ Parameters: db_dir – CommandLine:
python -m ibeis.control._sql_helpers --exec-revert_to_backup
Example
>>> # SCRIPT >>> from ibeis.control._sql_helpers import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='GZ_Master1') >>> result = revert_to_backup(ibs) >>> print(result)
ibeis.control.accessor_decors module¶
-
ibeis.control.accessor_decors.
cache_getter
(tblname, colname=None, cfgkeys=None, force=False, debug=False)[source]¶ Creates a getter cacher the class must have a table_cache property varargs are currently unallowed
Parameters: - tblname (str) –
- colname (str) –
Returns: closure_getter_cacher
Return type: function
CommandLine:
python -m ibeis.control.accessor_decors --test-cache_getter
- Example0:
>>> # ENABLE_DOCTEST >>> from ibeis.control.accessor_decors import * # NOQA >>> import ibeis >>> from ibeis import constants as const >>> ibs = ibeis.opendb('testdb1') >>> #ibs = ibeis.opendb('PZ_MTEST') >>> valid_nids = ibs.get_valid_nids() >>> tblname = const.NAME_TABLE >>> colname = 'annot_rowid' >>> rowid_list = valid_nids >>> rowid_list1 = rowid_list[::2] >>> rowid_list2 = rowid_list[::3] >>> rowid_list3 = rowid_list[1::2] >>> kwargs = {} >>> getter_func = ibs.get_name_aids.im_func >>> wrp_getter_cacher = cache_getter(tblname, colname, force=True, debug=False)(getter_func) >>> ### Test Getter (caches) >>> val_list1 = getter_func(ibs, rowid_list1) >>> val_list2 = wrp_getter_cacher(ibs, rowid_list1) >>> print(ut.dict_str(ibs.table_cache)) >>> val_list3 = wrp_getter_cacher(ibs, rowid_list1) >>> val_list4 = wrp_getter_cacher(ibs, rowid_list2) >>> print(ut.dict_str(ibs.table_cache)) >>> val_list5 = wrp_getter_cacher(ibs, rowid_list3) >>> val_list = wrp_getter_cacher(ibs, rowid_list) >>> ut.assert_eq(val_list1, val_list2, 'run1') >>> ut.assert_eq(val_list1, val_list2, 'run2') >>> print(ut.dict_str(ibs.table_cache)) >>> ### Test Setter (invalidates) >>> setter_func = ibs.set_name_texts >>> wrp_cache_invalidator = cache_invalidator(tblname, force=True)(lambda *a: None) >>> wrp_cache_invalidator(ibs, rowid_list1) >>> print(ut.dict_str(ibs.table_cache))
- Example1:
>>> # ENABLE_DOCTEST >>> from ibeis.control.accessor_decors import * # NOQA >>> import ibeis >>> from ibeis import constants as const >>> from ibeis.control.manual_feat_funcs import FEAT_KPTS >>> ibs = ibeis.opendb('testdb1') >>> tblname = const.FEATURE_TABLE, >>> colname = FEAT_KPTS >>> aid_list = ibs.get_valid_aids()[0:1] >>> # Check that config2 actually gets you different vectors in the cache >>> qreq_ = ibs.new_query_request(aid_list, aid_list, cfgdict={'affine_invariance': False}) >>> config2_ = qreq_.get_external_query_config2() >>> kpts_list1 = ibs.get_annot_kpts(aid_list, config2_=None) >>> kpts_list2 = ibs.get_annot_kpts(aid_list, config2_=config2_) >>> kp1 = kpts_list1[0][0:1] >>> kp2 = kpts_list2[0][0:1] >>> assert kp1.T[3] != 0 >>> assert kp2.T[3] == 0 >>> assert kp2.T[2] == kp2.T[4]
-
ibeis.control.accessor_decors.
cache_invalidator
(tblname, colnames=None, rowidx=None, force=False)[source]¶ cacher decorator
Parameters: - tablename (str) – the table that the owns the underlying cache
- colnames (list) – the list of cached column that this function will invalidate
- rowidx (int) – the position (not including self) of the invalidated table’s native rowid in the writer function’s argument signature. If this does not exist you should use None. (default=None)
-
ibeis.control.accessor_decors.
default_decorator
(input_)[source]¶ This should be the first decorator applied to all Controller functions
-
ibeis.control.accessor_decors.
dev_cache_getter
(tblname, colname, *args, **kwargs)[source]¶ cache getter for when the database is gaurenteed not to change
-
ibeis.control.accessor_decors.
getter
(func)[source]¶ Getter decorator for functions which takes as the first input a unique id list and returns a heterogeous list of values
-
ibeis.control.accessor_decors.
getter_1to1
(func)¶ Getter decorator for functions which takes as the first input a unique id list and returns a heterogeous list of values
-
ibeis.control.accessor_decors.
getter_1toM
(func)¶ Getter decorator for functions which takes as the first input a unique id list and returns a homogenous list of values
-
ibeis.control.accessor_decors.
getter_numpy
(func)[source]¶ Getter decorator for functions which takes as the first input a unique id list and returns a heterogeous list of values
-
ibeis.control.accessor_decors.
getter_numpy_vector_output
(func)[source]¶ Getter decorator for functions which takes as the first input a unique id list and returns a heterogeous list of values
-
ibeis.control.accessor_decors.
getter_vector_output
(func)[source]¶ Getter decorator for functions which takes as the first input a unique id list and returns a homogenous list of values
-
ibeis.control.accessor_decors.
ider
(func)[source]¶ This function takes returns ids subject to conditions
-
ibeis.control.accessor_decors.
init_tablecache
()[source]¶ Returns: tablecache Return type: defaultdict CommandLine:
python -m ibeis.control.accessor_decors --test-init_tablecache
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.accessor_decors import * # NOQA >>> result = init_tablecache() >>> print(result)
ibeis.control.autowrap_api_decorators module¶
ibeis.control.controller_inject module¶
- TODO:
- Move flask registering into another file. Should also make the actual flask registration lazy. It should only be executed if a web instance is being started.
python -c “import ibeis”
-
exception
ibeis.control.controller_inject.
DuplicateUUIDException
(qdup_pos_map={}, ddup_pos_map={})[source]¶
-
exception
ibeis.control.controller_inject.
WebException
(message, rawreturn=None, code=400)[source]¶ Bases:
utool.util_dev.NiceRepr
,exceptions.Exception
-
exception
ibeis.control.controller_inject.
WebMissingUUIDException
(missing_image_uuid_list=[], missing_annot_uuid_list=[])[source]¶
-
ibeis.control.controller_inject.
api_remote_ibeis
(remote_ibeis_url, remote_api_func, remote_ibeis_port=5001, **kwargs)[source]¶
-
ibeis.control.controller_inject.
authentication_challenge
()[source]¶ Sends a 401 response that enables basic auth
-
ibeis.control.controller_inject.
authentication_either
(func)[source]¶ authenticated by either hash or user
-
ibeis.control.controller_inject.
authentication_hash_validate
()[source]¶ This function is called to check if a username / password combination is valid.
-
ibeis.control.controller_inject.
authentication_user_validate
()[source]¶ This function is called to check if a username / password combination is valid.
-
ibeis.control.controller_inject.
crossdomain
(origin=None, methods=None, headers=None, max_age=21600, attach_to_all=True, automatic_options=True)[source]¶
-
ibeis.control.controller_inject.
dev_autogen_explicit_imports
()[source]¶ CommandLine:
python -m ibeis --tf dev_autogen_explicit_imports
Example
>>> # SCRIPT >>> from ibeis.control.controller_inject import * # NOQA >>> dev_autogen_explicit_imports()
-
ibeis.control.controller_inject.
dev_autogen_explicit_injects
()[source]¶ CommandLine:
python -m ibeis --tf dev_autogen_explicit_injects
Example
>>> # SCRIPT >>> from ibeis.control.controller_inject import * # NOQA >>> dev_autogen_explicit_injects()
-
ibeis.control.controller_inject.
get_ibeis_flask_api
(__name__, DEBUG_PYTHON_STACK_TRACE_JSON_RESPONSE=True)[source]¶ For function calls that resolve to api calls and return json.
-
ibeis.control.controller_inject.
get_ibeis_flask_route
(__name__)[source]¶ For function calls that resolve to webpages and return html
-
ibeis.control.controller_inject.
make_ibs_register_decorator
(modname)[source]¶ builds variables and functions that controller injectable modules need
-
ibeis.control.controller_inject.
translate_ibeis_webcall
(func, *args, **kwargs)[source]¶ Called from flask request context
Parameters: func (function) – live python function Returns: (output, True, 200, None, jQuery_callback) Return type: tuple CommandLine:
python -m ibeis.control.controller_inject --exec-translate_ibeis_webcall python -m ibeis.control.controller_inject --exec-translate_ibeis_webcall --domain http://52.33.105.88
Example
>>> # WEB_DOCTEST >>> from ibeis.control.controller_inject import * # NOQA >>> import ibeis >>> import time >>> import ibeis.web >>> web_ibs = ibeis.opendb_bg_web('testdb1', wait=1, start_job_queue=False) >>> aids = web_ibs.send_ibeis_request('/api/annot/', 'get') >>> uuid_list = web_ibs.send_ibeis_request('/api/annot/uuids/', aid_list=aids) >>> failrsp = web_ibs.send_ibeis_request('/api/annot/uuids/') >>> failrsp2 = web_ibs.send_ibeis_request('/api/query/chips/simple_dict//', 'get', qaid_list=[0], daid_list=[0]) >>> log_text = web_ibs.send_ibeis_request('/api/query/chips/simple_dict/', 'get', qaid_list=[0], daid_list=[0]) >>> time.sleep(.1) >>> print('\n---\nuuid_list = %r' % (uuid_list,)) >>> print('\n---\nfailrsp =\n%s' % (failrsp,)) >>> print('\n---\nfailrsp2 =\n%s' % (failrsp2,)) >>> print('Finished test') >>> web_ibs.terminate2()
ibeis.control.manual_annot_funcs module¶
- Autogen:
- python -c “import utool as ut; ut.write_modscript_alias(‘Tgen.sh’, ‘ibeis.templates.template_generator’)” # NOQA sh Tgen.sh –key annot –invert –Tcfg with_getters=True with_setters=True –modfname manual_annot_funcs –funcname-filter=age_m # NOQA sh Tgen.sh –key annot –invert –Tcfg with_getters=True with_setters=True –modfname manual_annot_funcs –funcname-filter=is_ # NOQA sh Tgen.sh –key annot –invert –Tcfg with_getters=True with_setters=True –modfname manual_annot_funcs –funcname-filter=is_ –diff # NOQA
-
class
ibeis.control.manual_annot_funcs.
SemanticInfoTup
(image_uuid, verts, theta, yaw, name, species)¶ Bases:
tuple
-
__getnewargs__
()¶ Return self as a plain tuple. Used by copy and pickle.
-
__getstate__
()¶ Exclude the OrderedDict from pickling
-
__repr__
()¶ Return a nicely formatted representation string
-
image_uuid
¶ Alias for field number 0
-
name
¶ Alias for field number 4
-
species
¶ Alias for field number 5
-
theta
¶ Alias for field number 2
-
verts
¶ Alias for field number 1
-
yaw
¶ Alias for field number 3
-
-
ibeis.control.manual_annot_funcs.
add_annots
(ibs, gid_list, bbox_list=None, theta_list=None, species_list=None, nid_list=None, name_list=None, detect_confidence_list=None, notes_list=None, vert_list=None, annot_uuid_list=None, yaw_list=None, annot_visual_uuid_list=None, annot_semantic_uuid_list=None, species_rowid_list=None, quiet_delete_thumbs=False, prevent_visual_duplicates=True, skip_cleaning=False, **kwargs)[source]¶ Adds an annotation to images
Parameters: - gid_list (list) – image rowids to add annotation to
- bbox_list (list) – of [x, y, w, h] bounding boxes for each image (supply verts instead)
- theta_list (list) – orientations of annotations
- species_list (list) –
- nid_list (list) –
- name_list (list) –
- detect_confidence_list (list) –
- notes_list (list) –
- vert_list (list) – alternative to bounding box
- annot_uuid_list (list) –
- yaw_list (list) –
- annot_visual_uuid_list (list) –
- annot_semantic_uuid_list (list) –
- quiet_delete_thumbs (bool) –
Returns: aid_list
Return type: list
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-add_annots python -m ibeis.control.manual_annot_funcs --test-add_annots --verbose --print-caller
- RESTful:
- Method: POST URL: /api/annot/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.IBEISControl import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> prevalid = ibs.get_valid_aids() >>> num_add = 2 >>> gid_list = ibs.get_valid_gids()[0:num_add] >>> bbox_list = [(int(w * .1), int(h * .6), int(w * .5), int(h * .3)) ... for (w, h) in ibs.get_image_sizes(gid_list)] >>> # Add a test annotation >>> print('Testing add_annots') >>> aid_list = ibs.add_annots(gid_list, bbox_list=bbox_list) >>> bbox_list2 = ibs.get_annot_bboxes(aid_list) >>> vert_list2 = ibs.get_annot_verts(aid_list) >>> theta_list2 = ibs.get_annot_thetas(aid_list) >>> name_list2 = ibs.get_annot_names(aid_list) >>> print('Ensure=False. Should get back None chip fpaths') >>> chip_fpaths2 = ibs.get_annot_chip_fpath(aid_list, ensure=False) >>> assert [fpath is None for fpath in chip_fpaths2], 'should not have fpaths' >>> print('Ensure=True. Should get back None chip fpaths') >>> chip_fpaths = ibs.get_annot_chip_fpath(aid_list, ensure=True) >>> assert all([ut.checkpath(fpath, verbose=True) for fpath in chip_fpaths]), 'paths should exist' >>> ut.assert_eq(len(aid_list), num_add) >>> ut.assert_eq(len(vert_list2[0]), 4) >>> assert bbox_list2 == bbox_list, 'bboxes are unequal' >>> # Be sure to remove test annotation >>> # if this test fails a resetdbs might be nessary >>> result = '' >>> visual_uuid_list = ibs.get_annot_visual_uuids(aid_list) >>> semantic_uuid_list = ibs.get_annot_semantic_uuids(aid_list) >>> result += str(visual_uuid_list) + '\n' >>> result += str(semantic_uuid_list) + '\n' >>> print('Cleaning up. Removing added annotations') >>> ibs.delete_annots(aid_list) >>> assert not any([ut.checkpath(fpath, verbose=True) for fpath in chip_fpaths]), 'chip paths' >>> postvalid = ibs.get_valid_aids() >>> assert prevalid == postvalid, 'prevalid != postvalid' >>> result += str(postvalid) >>> print(result) [UUID('30f7639b-5161-a561-2c4f-41aed64e5b65'), UUID('5ccbb26d-104f-e655-cf2b-cf92e0ad2fd2')] [UUID('3e3e9c98-e47c-f153-7101-f3d4fdadfb90'), UUID('dbf3b1a2-2188-75b4-07d4-0ef7e4787d23')] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
# semantic uuids change when hashing is different
[UUID(‘30f7639b-5161-a561-2c4f-41aed64e5b65’), UUID(‘5ccbb26d-104f-e655-cf2b-cf92e0ad2fd2’)] [UUID(‘68160c90-4b82-dc96-dafa-b12948739577’), UUID(‘03e74d19-1bf7-bc43-a291-8ee06a44da2e’)] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
- Example2:
>>> # Test with prevent_visual_duplicates on >>> # ENABLE_DOCTEST >>> from ibeis.control.IBEISControl import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> prevalid = ibs.get_valid_aids() >>> num_add = 1 >>> gid_list = ibs.get_valid_gids()[0:1] * num_add >>> bbox_list = [(int(w * .1), int(h * .6), int(w * .5), int(h * .3)) ... for (w, h) in ibs.get_image_sizes(gid_list)] >>> bbox_list2 = [(int(w * .2), int(h * .6), int(w * .5), int(h * .3)) ... for (w, h) in ibs.get_image_sizes(gid_list)] >>> # Add a test annotation >>> print('Testing add_annots') >>> aid_list1 = ibs.add_annots(gid_list, bbox_list=bbox_list, prevent_visual_duplicates=True) >>> aid_list2 = ibs.add_annots(gid_list, bbox_list=bbox_list, prevent_visual_duplicates=True) >>> aid_list3 = ibs.add_annots(gid_list, bbox_list=bbox_list2, prevent_visual_duplicates=True) >>> assert aid_list1 == aid_list2, 'aid_list1 == aid_list2' >>> assert aid_list1 != aid_list3, 'aid_list1 != aid_list3' >>> aid_list_new = aid_list1 + aid_list3 >>> result = aid_list_new >>> print('Cleaning up. Removing added annotations') >>> ibs.delete_annots(aid_list_new) >>> print(result) [14, 15]
-
ibeis.control.manual_annot_funcs.
annotation_src_api
(aid=None)[source]¶ Returns the base64 encoded image of annotation <aid>
- RESTful:
- Method: GET URL: /api/annot/<aid>/
-
ibeis.control.manual_annot_funcs.
delete_annot_nids
(ibs, aid_list)[source]¶ Remove name assocation from the list of input aids. Does this by setting each annotations nid to the UNKNOWN name rowid
- RESTful:
- Method: DELETE URL: /api/annot/nids/
-
ibeis.control.manual_annot_funcs.
delete_annot_speciesids
(ibs, aid_list)[source]¶ Deletes nids of a list of annotations
- RESTful:
- Method: DELETE URL: /api/annot/speciesids/
-
ibeis.control.manual_annot_funcs.
delete_annots
(ibs, aid_list)[source]¶ deletes annotations from the database
- RESTful:
- Method: DELETE URL: /api/annot/
Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-delete_annots python -m ibeis.control.manual_annot_funcs --test-delete_annots --debug-api-cache python -m ibeis.control.manual_annot_funcs --test-delete_annots
- SeeAlso:
- back.delete_annot
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> from os.path import exists >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> ibs.delete_empty_nids() >>> # Add some annotations to delete >>> num_add = 2 >>> gid_list = ibs.get_valid_gids()[0:num_add] >>> nid = ibs.make_next_nids(1)[0] >>> nid_list = [nid] * num_add >>> bbox_list = [(int(w * .1), int(h * .6), int(w * .5), int(h * .3)) ... for (w, h) in ibs.get_image_sizes(gid_list)] >>> new_aid_list = ibs.add_annots(gid_list, bbox_list=bbox_list, >>> nid_list=nid_list) >>> ibs.get_annot_nids(new_aid_list) >>> ut.assert_lists_eq(ibs.get_annot_nids(new_aid_list), nid_list) >>> assert ibs.get_name_aids(nid) == new_aid_list, 'annots should all have same name' >>> assert new_aid_list == ibs.get_name_aids(nid), 'inverse name mapping should work' >>> #thumpaths = ibs.get_image_thumbpath(gid_list, ensure_paths=True, **{'thumbsize': 221}) >>> #assert any(ut.lmap(exists, thumpaths)), 'thumbs should be there' >>> before_aids = ibs.get_image_aids(gid_list) >>> print('BEFORE gids: ' + str(before_aids)) >>> result = ibs.delete_annots(new_aid_list) >>> assert ibs.get_name_aids(nid) == [], 'annots should be removed' >>> after_aids = ibs.get_image_aids(gid_list) >>> #thumpaths = ibs.get_image_thumbpath(gid_list, ensure_paths=False, **{'thumbsize': 221}) >>> #assert not any(ut.lmap(exists, thumpaths)), 'thumbs should be gone' >>> assert after_aids != before_aids, 'the invalidators must have bugs' >>> print('AFTER gids: ' + str(after_aids)) >>> valid_aids = ibs.get_valid_aids() >>> assert [aid not in valid_aids for aid in new_aid_list], 'should no longer be valid aids' >>> print(result) >>> ibs.delete_empty_nids()
-
ibeis.control.manual_annot_funcs.
filter_annotation_set
(ibs, aid_list, include_only_gid_list=None, yaw=u'no-filter', is_exemplar=None, species=None, is_known=None, hasgt=None, minqual=None, has_timestamp=None, min_timedelta=None)[source]¶
-
ibeis.control.manual_annot_funcs.
get_annot_age_months_est
(ibs, aid_list, eager=True, nInput=None)[source]¶ annot_age_months_est_list <- annot.annot_age_months_est[aid_list]
gets data from the annotation’s native age in months
Parameters: aid_list (list) – Returns: annot_age_months_est_list Return type: list - RESTful:
- Method: GET URL: /api/annot/age_months_est/
-
ibeis.control.manual_annot_funcs.
get_annot_age_months_est_max
(ibs, aid_list, eager=True, nInput=None)[source]¶ annot_age_months_est_max_list <- annot.annot_age_months_est_max[aid_list]
gets data from the “native” column “annot_age_months_est_max” in the “annot” table
Parameters: aid_list (list) – Returns: annot_age_months_est_max_list Return type: list - RESTful:
- Method: GET URL: /api/annot/age_months_est_max/
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> aid_list = ibs._get_all_aids() >>> eager = True >>> annot_age_months_est_max_list = ibs.get_annot_age_months_est_max(aid_list, eager=eager) >>> assert len(aid_list) == len(annot_age_months_est_max_list)
-
ibeis.control.manual_annot_funcs.
get_annot_age_months_est_max_texts
(ibs, aid_list, eager=True, nInput=None)[source]¶ annot_age_months_est_max_texts_list <- annot.annot_age_months_est_max_texts[aid_list]
gets string versions of the annotation’s native max age in months
Parameters: aid_list (list) – Returns: annot_age_months_est_max_list Return type: list - RESTful:
- Method: GET URL: /api/annot/age_months_est_max_texts/
-
ibeis.control.manual_annot_funcs.
get_annot_age_months_est_min
(ibs, aid_list, eager=True, nInput=None)[source]¶ annot_age_months_est_min_list <- annot.annot_age_months_est_min[aid_list]
gets data from the “native” column “annot_age_months_est_min” in the “annot” table
Parameters: aid_list (list) – Returns: annot_age_months_est_min_list Return type: list - RESTful:
- Method: GET URL: /api/annot/age_months_est_min/
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> aid_list = ibs._get_all_aids() >>> eager = True >>> annot_age_months_est_min_list = ibs.get_annot_age_months_est_min(aid_list, eager=eager) >>> assert len(aid_list) == len(annot_age_months_est_min_list)
-
ibeis.control.manual_annot_funcs.
get_annot_age_months_est_min_texts
(ibs, aid_list, eager=True, nInput=None)[source]¶ annot_age_months_est_min_texts_list <- annot.annot_age_months_est_min_texts[aid_list]
gets string versions of the annotation’s native min age in months
Parameters: aid_list (list) – Returns: annot_age_months_est_min_list Return type: list - RESTful:
- Method: GET URL: /api/annot/age_months_est_min_texts/
-
ibeis.control.manual_annot_funcs.
get_annot_age_months_est_texts
(ibs, aid_list, eager=True, nInput=None)[source]¶ annot_age_months_est_texts_list <- annot.annot_age_months_est_texts[aid_list]
gets string versions of the annotation’s native combined age in months
Parameters: aid_list (list) – Returns: annot_age_months_est_text_list Return type: list - RESTful:
- Method: GET URL: /api/annot/age_months_est_texts/
-
ibeis.control.manual_annot_funcs.
get_annot_aid
(ibs, aid_list, eager=True, nInput=None)[source]¶ self verifier .. rubric:: Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.IBEISControl import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() + [None, -1, 10434320432] >>> aid_list_ = ibs.get_annot_aid(aid_list) >>> assert [r is None for r in aid_list_[-3:]] >>> assert [r is not None for r in aid_list_[0:-3]]
-
ibeis.control.manual_annot_funcs.
get_annot_aids_from_semantic_uuid
(ibs, semantic_uuid_list)[source]¶ Parameters: semantic_uuid_list (list) – Returns: annot rowids Return type: list - RESTful:
- Method: GET URL: /api/annot/aids_from_semantic_uuid/
-
ibeis.control.manual_annot_funcs.
get_annot_aids_from_uuid
(ibs, uuid_list)[source]¶ Returns: list_ – annot rowids Return type: list - RESTful:
- Method: GET URL: /api/annot/aids_from_uuid/
-
ibeis.control.manual_annot_funcs.
get_annot_aids_from_visual_uuid
(ibs, visual_uuid_list)[source]¶ Parameters: visual_uuid_list (list) – Returns: annot rowids Return type: list - RESTful:
- Method: GET URL: /api/annot/aids_from_visual_uuid/
-
ibeis.control.manual_annot_funcs.
get_annot_bboxes
(ibs, aid_list)[source]¶ Returns: bbox_list – annotation bounding boxes in image space Return type: list - RESTful:
- Method: GET URL: /api/annot/bboxes/
-
ibeis.control.manual_annot_funcs.
get_annot_class_labels
(ibs, aid_list)[source]¶ DEPRICATE?
Returns: identifying animal name and view Return type: list of tuples - RESTful:
- Method: GET URL: /api/annot/class_labels/
-
ibeis.control.manual_annot_funcs.
get_annot_contact_aids
(ibs, aid_list, daid_list=None, check_isect=False)[source]¶ Returns the other aids that appear in the same image that this annotation is from.
Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (list) –
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_contact_aids;1
- RESTful:
- Method: GET URL: /api/annot/contact_aids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> # execute function >>> contact_aids = ibs.get_annot_contact_aids(aid_list) >>> # verify results >>> contact_gids = ibs.unflat_map(ibs.get_annot_gids, contact_aids) >>> gid_list = ibs.get_annot_gids(aid_list) >>> for gids, gid, aids, aid in zip(contact_gids, gid_list, contact_aids, aid_list): ... assert ut.allsame(gids), 'annots should be from same image' ... assert len(gids) == 0 or gids[0] == gid, 'and same image as parent annot' ... assert aid not in aids, 'should not include self'
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb2') >>> aid_list = ibs.get_valid_aids() >>> # execute function >>> contact_aids = ibs.get_annot_contact_aids(aid_list) >>> # verify results >>> contact_gids = ibs.unflat_map(ibs.get_annot_gids, contact_aids) >>> gid_list = ibs.get_annot_gids(aid_list) >>> print('contact_aids = %r' % (contact_aids,)) >>> for gids, gid, aids, aid in zip(contact_gids, gid_list, contact_aids, aid_list): ... assert ut.allsame(gids), 'annots should be from same image' ... assert len(gids) == 0 or gids[0] == gid, 'and same image as parent annot' ... assert aid not in aids, 'should not include self'
-
ibeis.control.manual_annot_funcs.
get_annot_detect_confidence
(ibs, aid_list)[source]¶ Returns: list_ – a list confidences that the annotations is a valid detection Return type: list - RESTful:
- Method: GET URL: /api/annot/detect_confidence/
-
ibeis.control.manual_annot_funcs.
get_annot_exemplar_flags
(ibs, aid_list)[source]¶ returns if an annotation is an exemplar
Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
Returns: annot_exemplar_flag_list - True if annotation is an exemplar
Return type: list
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_exemplar_flags
- RESTful:
- Method: GET URL: /api/annot/exemplar_flags/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> # execute function >>> gid_list = get_annot_exemplar_flags(ibs, aid_list) >>> # verify results >>> result = str(gid_list) >>> print(result)
-
ibeis.control.manual_annot_funcs.
get_annot_gar_rowids
(ibs, aid_list)[source]¶ Auto-docstr for ‘get_annot_gar_rowids’
- RESTful:
- Method: GET URL: /api/annot/gar_rowids/
-
ibeis.control.manual_annot_funcs.
get_annot_gids
(ibs, aid_list)[source]¶ Get parent image rowids of annotations
Parameters: aid_list (list) – Returns: gid_list – image rowids Return type: list - RESTful:
- Method: GET URL: /api/annot/gids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> result = get_annot_gids(ibs, aid_list) >>> print(result)
-
ibeis.control.manual_annot_funcs.
get_annot_groundfalse
(ibs, aid_list, is_exemplar=None, valid_aids=None, filter_unknowns=True, daid_list=None)[source]¶ gets all annotations with different names
Returns: groundfalse_list – a list of aids which are known to be different for each Return type: list #Example: # >>> # ENABLE_DOCTEST # >>> import ibeis # >>> ibs = ibeis.opendb(‘PZ_MTEST’) # >>> aid_list = ibs.get_valid_aids() # >>> is_exemplar, noself, daid_list = None, True, None # >>> groundfalse_list = ibs.get_annot_groundfalse(aid_list) # >>> result = str(groundtruth_list) # >>> print(result)
- RESTful:
- Method: GET URL: /api/annot/groundfalse/
-
ibeis.control.manual_annot_funcs.
get_annot_groundtruth
(ibs, aid_list, is_exemplar=None, noself=True, daid_list=None)[source]¶ gets all annotations with the same names
Parameters: - aid_list (list) – list of annotation rowids to get groundtruth of
- is_exemplar (None) –
- noself (bool) –
- daid_list (list) –
Returns: groundtruth_list – a list of aids with the same name foreach aid in aid_list. a set of aids belonging to the same name is called a groundtruth. A list of these is called a groundtruth_list.
Return type: list
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_groundtruth:0 python -m ibeis.control.manual_annot_funcs --test-get_annot_groundtruth:1 python -m ibeis.control.manual_annot_funcs --test-get_annot_groundtruth:2 python -m --tf get_annot_groundtruth:0 --db=PZ_Master0 --aids=97 --exec-mode
- RESTful:
- Method: GET URL: /api/annot/groundtruth/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid_list = ut.get_argval('--aids', list, ibs.get_valid_aids()) >>> is_exemplar, noself, daid_list = None, True, None >>> groundtruth_list = ibs.get_annot_groundtruth(aid_list, is_exemplar, noself, daid_list) >>> result = 'groundtruth_list = ' + str(groundtruth_list) >>> print(result) groundtruth_list = [[], [3], [2], [], [6], [5], [], [], [], [], [], [], []]
- Example1:
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> is_exemplar, noself, daid_list = True, True, None >>> groundtruth_list = ibs.get_annot_groundtruth(aid_list, is_exemplar, noself, daid_list) >>> result = str(groundtruth_list) >>> print(result) [[], [3], [2], [], [6], [5], [], [], [], [], [], [], []]
- Example2:
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> is_exemplar, noself, daid_list = False, False, aid_list >>> groundtruth_list = ibs.get_annot_groundtruth(aid_list, is_exemplar, noself, daid_list) >>> result = str(groundtruth_list) >>> print(result) [[1], [], [], [4], [], [], [], [], [9], [], [11], [], []]
-
ibeis.control.manual_annot_funcs.
get_annot_has_groundtruth
(ibs, aid_list, is_exemplar=None, noself=True, daid_list=None)[source]¶ Parameters: - aid_list (list) –
- is_exemplar (None) –
- noself (bool) –
- daid_list (list) –
Returns: has_gt_list
Return type: list
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_has_groundtruth
- RESTful:
- Method: GET URL: /api/annot/has_groundtruth/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> is_exemplar = None >>> noself = True >>> daid_list = None >>> has_gt_list = get_annot_has_groundtruth(ibs, aid_list, is_exemplar, noself, daid_list) >>> result = str(has_gt_list) >>> print(result)
-
ibeis.control.manual_annot_funcs.
get_annot_hashid_semantic_uuid
(ibs, aid_list, prefix=u'', pathsafe=False)[source]¶ builds an aggregate semantic hash id for a list of aids
Parameters: - ibs (ibeis.IBEISController) – ibeis controller object
- aid_list (list) – list of annotation rowids
- prefix (str) – (default = ‘’)
- _new (bool) – Eventually we will change the hashing scheme and all old data will be invalidated. (default=False)
Returns: semantic_uuid_hashid
Return type: str
- RESTful:
- Method: GET URL: /api/annot/hashid_semantic_uuid/
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_hashid_semantic_uuid
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid_list = ibs.get_valid_aids()[0:2] >>> prefix = '' >>> semantic_uuid_hashid = get_annot_hashid_semantic_uuid(ibs, aid_list, prefix) >>> result = ut.list_str(ibs.get_annot_semantic_uuids(aid_list)) + '\n' >>> result += ('semantic_uuid_hashid = %s' % (str(semantic_uuid_hashid),)) >>> print(result) [ UUID('bf774bf3-582d-dbce-6ca6-329adeb086a6'), UUID('60f10a02-1bd1-c2b4-75bb-a34c0a4b6867'), ] semantic_uuid_hashid = _SUUIDS((2)biovwevqycuemoik)
-
ibeis.control.manual_annot_funcs.
get_annot_hashid_uuid
(ibs, aid_list, prefix=u'')[source]¶ builds an aggregate random hash id for a list of aids
- RESTful:
- Method: GET URL: /api/annot/hashid_uuid/
-
ibeis.control.manual_annot_funcs.
get_annot_hashid_visual_uuid
(ibs, aid_list, prefix=u'', pathsafe=False)[source]¶ builds an aggregate visual hash id for a list of aids
Parameters: _new (bool) – Eventually we will change the hashing scheme and all old data will be invalidated. (default=False) - RESTful:
- Method: GET URL: /api/annot/hashid_visual_uuid/
-
ibeis.control.manual_annot_funcs.
get_annot_image_contributor_tag
(ibs, aid_list)[source]¶ Auto-docstr for ‘get_annot_image_contributor_tag’
- RESTful:
- Method: GET URL: /api/annot/image_contributor_tag/
-
ibeis.control.manual_annot_funcs.
get_annot_image_datetime
(ibs, aid_list)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
Returns: datetime_list
Return type: list
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_image_datetime
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> # execute function >>> datetime_list = get_annot_image_datetime(ibs, aid_list) >>> # verify results >>> result = str(datetime_list) >>> print(result)
-
ibeis.control.manual_annot_funcs.
get_annot_image_gps
(ibs, aid_list)[source]¶ Parameters: aid_list (list) – Returns: unixtime_list Return type: list - RESTful:
- Method: GET URL: /api/annot/image_gps/
-
ibeis.control.manual_annot_funcs.
get_annot_image_names
(ibs, aid_list)[source]¶ Parameters: aid_list (list) – Returns: gname_list the image names of each annotation Return type: list of strs - RESTful:
- Method: GET URL: /api/annot/image_names/
-
ibeis.control.manual_annot_funcs.
get_annot_image_paths
(ibs, aid_list)[source]¶ Parameters: aid_list (list) – Returns: gpath_list the image paths of each annotation Return type: list of strs - RESTful:
- Method: GET URL: /api/annot/image_paths/
-
ibeis.control.manual_annot_funcs.
get_annot_image_set_texts
(ibs, aid_list)[source]¶ Auto-docstr for ‘get_annot_image_contributor_tag’
- RESTful:
- Method: GET URL: /api/annot/image_contributor_tag/
-
ibeis.control.manual_annot_funcs.
get_annot_image_unixtimes
(ibs, aid_list)[source]¶ Parameters: aid_list (list) – Returns: unixtime_list Return type: list - RESTful:
- Method: GET URL: /api/annot/image_unixtimes/
-
ibeis.control.manual_annot_funcs.
get_annot_image_unixtimes_asfloat
(ibs, aid_list)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (list) – list of annotation rowids
Returns: unixtime_list
Return type: list
CommandLine:
python -m ibeis.control.manual_annot_funcs --exec-get_annot_image_unixtimes_asfloat --show --db PZ_MTEST
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid_list = ibs.get_valid_aids() >>> unixtime_list = get_annot_image_unixtimes_asfloat(ibs, aid_list) >>> result = ('unixtime_list = %s' % (str(unixtime_list),)) >>> print(result) >>> ut.quit_if_noshow() >>> import plottool as pt >>> ut.show_if_requested()
-
ibeis.control.manual_annot_funcs.
get_annot_image_uuids
(ibs, aid_list)[source]¶ Parameters: aid_list (list) – Returns: image_uuid_list Return type: list CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_image_uuids --enableall
- RESTful:
- Method: GET URL: /api/annot/image_uuids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[0:1] >>> result = get_annot_image_uuids(ibs, aid_list) >>> print(result) [UUID('66ec193a-1619-b3b6-216d-1784b4833b61')]
-
ibeis.control.manual_annot_funcs.
get_annot_images
(ibs, aid_list)[source]¶ Parameters: aid_list (list) – Returns: the images of each annotation Return type: list of ndarrays CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_images
- RESTful:
- Method: GET URL: /api/annot/images/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[0:1] >>> image_list = ibs.get_annot_images(aid_list) >>> result = str(map(np.shape, image_list)) >>> print(result) [(715, 1047, 3)]
-
ibeis.control.manual_annot_funcs.
get_annot_imgsetids
(ibs, aid_list)[source]¶ Get parent image rowids of annotations
Parameters: aid_list (list) – Returns: imgsetid_list – imageset rowids Return type: list - RESTful:
- Method: GET URL: /api/annot/imgsetids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> result = get_annot_gids(ibs, aid_list) >>> print(result)
-
ibeis.control.manual_annot_funcs.
get_annot_isjunk
(ibs, aid_list)[source]¶ Auto-docstr for ‘get_annot_isjunk’
- RESTful:
- Method: GET URL: /api/annot/isjunk/
-
ibeis.control.manual_annot_funcs.
get_annot_missing_uuid
(ibs, uuid_list)[source]¶ Returns: list_ – a list of missing annot uuids Return type: list - RESTful:
- Method: GET URL: /api/annot/missing_uuid/
-
ibeis.control.manual_annot_funcs.
get_annot_name_rowids
(ibs, aid_list, distinguish_unknowns=True)[source]¶ Returns: list_ – the name id of each annotation. Return type: list - RESTful:
- Method: GET URL: /api/annot/name_rowids/
CommandLine:
python -m ibeis.control.manual_annot_funcs --exec-get_annot_name_rowids
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> from ibeis import constants as const >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> distinguish_unknowns = True >>> nid_arr1 = np.array(ibs.get_annot_name_rowids(aid_list, distinguish_unknowns=distinguish_unknowns)) >>> nid_arr2 = np.array(ibs.get_annot_name_rowids(aid_list, distinguish_unknowns=False)) >>> nid_arr2 = np.array(ibs.get_annot_name_rowids(None, distinguish_unknowns=True)) >>> assert const.UNKNOWN_LBLANNOT_ROWID == 0 >>> assert np.all(nid_arr1[np.where(const.UNKNOWN_LBLANNOT_ROWID == nid_arr2)[0]] < 0)
-
ibeis.control.manual_annot_funcs.
get_annot_name_texts
(ibs, aid_list)[source]¶ Parameters: aid_list (list) – Returns: name_list. e.g: [‘fred’, ‘sue’, ...] for each annotation identifying the individual Return type: list or strs - RESTful:
- Method: GET URL: /api/annot/name_texts/
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_name_texts
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[::2] >>> result = ut.list_str(get_annot_name_texts(ibs, aid_list), nl=False) >>> print(result) ['____', 'easy', 'hard', 'jeff', '____', '____', 'zebra']
-
ibeis.control.manual_annot_funcs.
get_annot_names
(ibs, aid_list)[source]¶ alias
- RESTful:
- Method: GET URL: /api/annot/names/
-
ibeis.control.manual_annot_funcs.
get_annot_nids
(ibs, aid_list, distinguish_unknowns=True)[source]¶ alias
- RESTful:
- Method: GET URL: /api/annot/nids/
-
ibeis.control.manual_annot_funcs.
get_annot_notes
(ibs, aid_list)[source]¶ Returns: annotation_notes_list – a list of annotation notes Return type: list - RESTful:
- Method: GET URL: /api/annot/notes/
-
ibeis.control.manual_annot_funcs.
get_annot_num_contact_aids
(ibs, aid_list)[source]¶ Auto-docstr for ‘get_annot_num_contact_aids’
- RESTful:
- Method: GET URL: /api/annot/num_contact_aids/
-
ibeis.control.manual_annot_funcs.
get_annot_num_groundtruth
(ibs, aid_list, is_exemplar=None, noself=True, daid_list=None)[source]¶ Returns: list_ – number of other chips with the same name Return type: list - RESTful:
- Method: GET URL: /api/annot/num_groundtruth/
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_num_groundtruth python -m ibeis.control.manual_annot_funcs --test-get_annot_num_groundtruth:0 python -m ibeis.control.manual_annot_funcs --test-get_annot_num_groundtruth:1
- Example1:
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> noself = True >>> result = get_annot_num_groundtruth(ibs, aid_list, noself=noself) >>> print(result) [0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0]
- Example2:
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> noself = False >>> result = get_annot_num_groundtruth(ibs, aid_list, noself=noself) >>> print(result) [1, 2, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1]
-
ibeis.control.manual_annot_funcs.
get_annot_num_verts
(ibs, aid_list)[source]¶ Returns: nVerts_list – the number of vertices that form the polygon of each chip Return type: list - RESTful:
- Method: GET URL: /api/annot/num_verts/
-
ibeis.control.manual_annot_funcs.
get_annot_otherimage_aids
(ibs, aid_list, daid_list=None)[source]¶ Auto-docstr for ‘get_annot_otherimage_aids’
- RESTful:
- Method: GET URL: /api/annot/otherimage_aids/
-
ibeis.control.manual_annot_funcs.
get_annot_parent_aid
(ibs, aid_list)[source]¶ Returns: list_ – a list of parent (in terms of parts) annotation rowids. Return type: list - RESTful:
- Method: GET URL: /api/annot/parent_aid/
-
ibeis.control.manual_annot_funcs.
get_annot_probchip_fpath
(ibs, aid_list, config2_=None)[source]¶ Returns paths to probability images.
Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (list) – list of annotation rowids
- config2 (dict) – (default = None)
- RESTful:
- Method: GET URL: /api/annot/probchip_fpath/
Returns: probchip_fpath_list Return type: list CommandLine:
python -m ibeis.control.manual_annot_funcs --exec-get_annot_probchip_fpath --show
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='PZ_MTEST') >>> aid_list = ibs.get_valid_aids()[0:10] >>> config2_ = ibs.new_query_params({'fw_detector': 'cnn'}) >>> probchip_fpath_list = get_annot_probchip_fpath(ibs, aid_list, config2_) >>> result = ('probchip_fpath_list = %s' % (str(probchip_fpath_list),)) >>> print(result) >>> ut.quit_if_noshow() >>> import plottool as pt >>> iteract_obj = pt.interact_multi_image.MultiImageInteraction(probchip_fpath_list, nPerPage=4) >>> iteract_obj.start() >>> ut.show_if_requested()
-
ibeis.control.manual_annot_funcs.
get_annot_qualities
(ibs, aid_list, eager=True)[source]¶ annot_quality_list <- annot.annot_quality[aid_list]
gets data from the “native” column “annot_quality” in the “annot” table
Parameters: aid_list (list) – Returns: annot_quality_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annot_quality tbl = annot
- SeeAlso:
- ibeis.const.QUALITY_INT_TO_TEXT
- RESTful:
- Method: GET URL: /api/annot/qualities/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> ibs, qreq_ = testdata_ibs() >>> aid_list = ibs._get_all_aids() >>> eager = True >>> annot_quality_list = ibs.get_annot_qualities(aid_list, eager=eager) >>> print('annot_quality_list = %r' % (annot_quality_list,)) >>> assert len(aid_list) == len(annot_quality_list)
-
ibeis.control.manual_annot_funcs.
get_annot_quality_texts
(ibs, aid_list)[source]¶ Auto-docstr for ‘get_annot_quality_texts’
- RESTful:
- Method: GET URL: /api/annot/quality_texts/
-
ibeis.control.manual_annot_funcs.
get_annot_rotated_verts
(ibs, aid_list)[source]¶ Returns: rotated_vert_list – verticies after rotation by theta. Return type: list - RESTful:
- Method: GET URL: /api/annot/rotated_verts/
-
ibeis.control.manual_annot_funcs.
get_annot_rowids_from_partial_vuuids
(ibs, partial_vuuid_strs)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- partial_uuid_list (list) –
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annots_from_partial_uuids
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[::2] >>> vuuids = ibs.get_annot_visual_uuids(aid_list) >>> partial_vuuid_strs = [u[0:4] for u in map(str, vuuids)] >>> aids_list = get_annot_rowids_from_partial_vuuids(ibs, partial_uuid_list) >>> print(result) [[1], [3], [5], [7], [9], [11], [13]]
-
ibeis.control.manual_annot_funcs.
get_annot_rowids_from_visual_uuid
(ibs, visual_uuid_list)¶ Parameters: visual_uuid_list (list) – Returns: annot rowids Return type: list - RESTful:
- Method: GET URL: /api/annot/aids_from_visual_uuid/
-
ibeis.control.manual_annot_funcs.
get_annot_rows
(ibs, aid_list)[source]¶ Auto-docstr for ‘get_annot_rows’
- RESTful:
- Method: GET URL: /api/annot/rows/
-
ibeis.control.manual_annot_funcs.
get_annot_semantic_uuid_info
(ibs, aid_list, _visual_infotup=None)[source]¶ Semenatic uuids are made up of visual and semantic information. Semantic information is name, species, viewpoint. Visual info is image uuid, verts, and theta
Parameters: - aid_list (list) –
- _visual_infotup (tuple) – internal use only
Returns: semantic_infotup (image_uuid_list, verts_list, theta_list, yaw_list, name_list, species_list)
Return type: tuple
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_semantic_uuid_info
- RESTful:
- Method: GET URL: /api/annot/semantic_uuid_info/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.algo.preproc.preproc_annot import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[0:2] >>> semantic_infotup = ibs.get_annot_semantic_uuid_info(aid_list) >>> result = str(list(zip(*semantic_infotup))[1]) >>> print(result) (UUID('d8903434-942f-e0f5-d6c2-0dcbe3137bf7'), ((0, 0), (1035, 0), (1035, 576), (0, 576)), 0.0, None, u'easy', u'zebra_plains')
-
ibeis.control.manual_annot_funcs.
get_annot_semantic_uuids
(ibs, aid_list)[source]¶ annot_semantic_uuid_list <- annot.annot_semantic_uuid[aid_list]
gets data from the “native” column “annot_semantic_uuid” in the “annot” table
Parameters: aid_list (list) – Returns: annot_semantic_uuid_list Return type: list CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_semantic_uuids
- RESTful:
- Method: GET URL: /api/annot/semantic_uuids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> ibs, qreq_ = testdata_ibs() >>> aid_list = ibs._get_all_aids()[0:1] >>> annot_semantic_uuid_list = ibs.get_annot_semantic_uuids(aid_list) >>> assert len(aid_list) == len(annot_semantic_uuid_list) >>> result = annot_semantic_uuid_list [UUID('bf774bf3-582d-dbce-6ca6-329adeb086a6')]
[UUID(‘215ab5f9-fe53-d7d1-59b8-d6b5ce7e6ca6’)]
-
ibeis.control.manual_annot_funcs.
get_annot_sex
(ibs, aid_list, eager=True, nInput=None)[source]¶ Auto-docstr for ‘get_annot_sex’
- RESTful:
- Method: GET URL: /api/annot/sex/
-
ibeis.control.manual_annot_funcs.
get_annot_sex_texts
(ibs, aid_list, eager=True, nInput=None)[source]¶ Auto-docstr for ‘get_annot_sex_texts’
- RESTful:
- Method: GET URL: /api/annot/sex_texts/
-
ibeis.control.manual_annot_funcs.
get_annot_species
(ibs, aid_list)[source]¶ alias
- RESTful:
- Method: GET URL: /api/annot/species/
-
ibeis.control.manual_annot_funcs.
get_annot_species_rowids
(ibs, aid_list)[source]¶ species_rowid_list <- annot.species_rowid[aid_list]
gets data from the “native” column “species_rowid” in the “annot” table
Parameters: aid_list (list) – Returns: species_rowid_list Return type: list - RESTful:
- Method: GET URL: /api/annot/species_rowids/
-
ibeis.control.manual_annot_funcs.
get_annot_species_texts
(ibs, aid_list)[source]¶ Parameters: aid_list (list) – Returns: species_list - a list of strings [‘plains_zebra’, ‘grevys_zebra’, ...] for each annotation identifying the species Return type: list CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_species_texts
- Example1:
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[1::3] >>> result = ut.list_str(get_annot_species_texts(ibs, aid_list), nl=False) >>> print(result) ['zebra_plains', 'zebra_plains', '____', 'bear_polar']
- Example2:
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('PZ_MTEST') >>> aid_list = ibs.get_valid_aids() >>> species_list = get_annot_species_texts(ibs, aid_list) >>> result = ut.list_str(list(set(species_list)), nl=False) >>> print(result) ['zebra_plains']
- RESTful:
- Method: GET URL: /api/annot/species_texts/
-
ibeis.control.manual_annot_funcs.
get_annot_tag_text
(ibs, aid_list, eager=True, nInput=None)[source]¶ annot_tags_list <- annot.annot_tags[aid_list]
gets data from the “native” column “annot_tags” in the “annot” table
Parameters: aid_list (list) – Returns: annot_tags_list Return type: list Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> aid_list = ibs._get_all_aids() >>> eager = True >>> annot_tags_list = ibs.get_annot_tag_text(aid_list, eager=eager) >>> assert len(aid_list) == len(annot_tags_list)
-
ibeis.control.manual_annot_funcs.
get_annot_thetas
(ibs, aid_list)[source]¶ Returns: theta_list – a list of floats describing the angles of each chip Return type: list CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_thetas
- RESTful:
- Method: GET URL: /api/annot/thetas/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('NAUT_test') >>> aid_list = ibs.get_valid_aids() >>> result = get_annot_thetas(ibs, aid_list) >>> print(result) [2.75742, 0.792917, 2.53605, 2.67795, 0.946773, 2.56729]
-
ibeis.control.manual_annot_funcs.
get_annot_uuids
(ibs, aid_list)[source]¶ Returns: annot_uuid_list a list of image uuids by aid Return type: list - RESTful:
- Method: GET URL: /api/annot/uuids/
-
ibeis.control.manual_annot_funcs.
get_annot_verts
(ibs, aid_list)[source]¶ Returns: vert_list – the vertices that form the polygon of each chip Return type: list - RESTful:
- Method: GET URL: /api/annot/verts/
-
ibeis.control.manual_annot_funcs.
get_annot_visual_uuid_info
(ibs, aid_list)[source]¶ Returns information used to compute annotation UUID. The image uuid, annotation verticies, are theta is hashted together to
compute the visual uuid.The visual uuid does not include name or species information.
get_annot_visual_uuid_info
Parameters: aid_list (list) – Returns: visual_infotup (image_uuid_list, verts_list, theta_list) Return type: tuple - SeeAlso:
- get_annot_visual_uuids get_annot_semantic_uuid_info
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_visual_uuid_info
- RESTful:
- Method: GET URL: /api/annot/visual_uuid_info/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.algo.preproc.preproc_annot import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[0:2] >>> visual_infotup = ibs.get_annot_visual_uuid_info(aid_list) >>> result = str(list(zip(*visual_infotup))[0]) >>> print(result) (UUID('66ec193a-1619-b3b6-216d-1784b4833b61'), ((0, 0), (1047, 0), (1047, 715), (0, 715)), 0.0)
-
ibeis.control.manual_annot_funcs.
get_annot_visual_uuids
(ibs, aid_list)[source]¶ The image uuid, annotation verticies, are theta is hashted together to compute the visual uuid. The visual uuid does not include name or species information.
annot_visual_uuid_list <- annot.annot_visual_uuid[aid_list]
gets data from the “native” column “annot_visual_uuid” in the “annot” table
Parameters: aid_list (list) – Returns: annot_visual_uuid_list Return type: list CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_visual_uuids
- RESTful:
- Method: GET URL: /api/annot/visual_uuids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> ibs, qreq_ = testdata_ibs() >>> aid_list = ibs._get_all_aids()[0:1] >>> annot_visual_uuid_list = ibs.get_annot_visual_uuids(aid_list) >>> assert len(aid_list) == len(annot_visual_uuid_list) >>> result = annot_visual_uuid_list [UUID('8687dcb6-1f1f-fdd3-8b72-8f36f9f41905')]
[UUID(‘76de0416-7c92-e1b3-4a17-25df32e9c2b4’)]
-
ibeis.control.manual_annot_funcs.
get_annot_yaw_texts
(ibs, aid_list)[source]¶ Auto-docstr for ‘get_annot_yaw_texts’
- RESTful:
- Method: GET URL: /api/annot/yaw_texts/
-
ibeis.control.manual_annot_funcs.
get_annot_yaws
(ibs, aid_list)[source]¶ A yaw is the yaw of the annotation in radians Viewpoint yaw is inverted. Will be fixed soon.
- The following views have these angles of yaw:
left side - 0.50 tau radians front side - 0.25 tau radians right side - 0.00 tau radians back side - 0.75 tau radians
tau = 2 * pi
- SeeAlso:
- ibies.const.VIEWTEXT_TO_YAW_RADIANS
Returns: yaw_list – the yaw (in radians) for the annotation Return type: list CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_annot_yaws
- RESTful:
- Method: GET URL: /api/annot/yaws/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[::3] >>> result = get_annot_yaws(ibs, aid_list) >>> print(result) [None, None, None, None, None]
-
ibeis.control.manual_annot_funcs.
get_annot_yaws_asfloat
(ibs, aid_list)[source]¶ Ensures that Nones are returned as nans
-
ibeis.control.manual_annot_funcs.
get_num_annotations
(ibs, **kwargs)[source]¶ Number of valid annotations
- RESTful:
- Method: GET URL: /api/annot/numations/
-
ibeis.control.manual_annot_funcs.
get_valid_aids
(ibs, imgsetid=None, include_only_gid_list=None, yaw=u'no-filter', is_exemplar=None, species=None, is_known=None, hasgt=None, minqual=None, has_timestamp=None, min_timedelta=None)[source]¶ High level function for getting all annotation ids according a set of filters.
- Note: The yaw value cannot be None as a default because None is used as a
- filtering value
Parameters: - ibs (IBEISController) – ibeis controller object
- imgsetid (int) – imageset id (default = None)
- include_only_gid_list (list) – if specified filters annots not in these gids (default = None)
- yaw (str) – (default = ‘no-filter’)
- is_exemplar (bool) – if specified filters annots to either be or not be exemplars (default = None)
- species (str) – (default = None)
- is_known (bool) – (default = None)
- min_timedelta (int) – minimum timedelta between annots of known individuals
- hasgt (bool) – (default = None)
Returns: aid_list - a list of valid ANNOTATION unique ids
Return type: list
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-get_valid_aids
- RESTful:
- Method: GET URL: /api/annot/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> from ibeis import constants as const >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> imgsetid = 1 >>> ibs.delete_all_imagesets() >>> ibs.compute_occurrences() >>> include_only_gid_list = None >>> yaw = 'no-filter' >>> is_exemplar = None >>> species = const.TEST_SPECIES.ZEB_PLAIN >>> is_known = False >>> # execute function >>> aid_list = get_valid_aids(ibs, imgsetid, include_only_gid_list, yaw, is_exemplar, species, is_known) >>> ut.assert_eq(ibs.get_annot_names(aid_list), [const.UNKNOWN] * 2, 'bad name') >>> ut.assert_eq(ibs.get_annot_species(aid_list), [species] * 2, 'bad species') >>> ut.assert_eq(ibs.get_annot_exemplar_flags(aid_list), [False] * 2, 'bad exemplar') >>> # verify results >>> result = str(aid_list) >>> print(result) [1, 4]
- Example1:
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> # execute function >>> aid_list1 = get_valid_aids(ibs, is_exemplar=True) >>> aid_list2 = get_valid_aids(ibs, is_exemplar=False) >>> intersect_aids = set(aid_list1).intersection(aid_list2) >>> ut.assert_eq(len(aid_list1), 9) >>> ut.assert_eq(len(aid_list2), 4) >>> ut.assert_eq(len(intersect_aids), 0)
-
ibeis.control.manual_annot_funcs.
get_valid_annot_uuids
(ibs)[source]¶ Returns: annot_uuid_list a list of image uuids for all valid aids Return type: list - RESTful:
- Method: GET URL: /api/annot/uuids/
-
ibeis.control.manual_annot_funcs.
set_annot_age_months_est_max
(ibs, aid_list, annot_age_months_est_max_list, duplicate_behavior=u'error')[source]¶ annot_age_months_est_max_list -> annot.annot_age_months_est_max[aid_list]
Parameters: - aid_list –
- annot_age_months_est_max_list –
- TemplateInfo:
- Tsetter_native_column tbl = annot col = annot_age_months_est_max
- RESTful:
- Method: PUT URL: /api/annot/age_months_est_max/
-
ibeis.control.manual_annot_funcs.
set_annot_age_months_est_min
(ibs, aid_list, annot_age_months_est_min_list, duplicate_behavior=u'error')[source]¶ annot_age_months_est_min_list -> annot.annot_age_months_est_min[aid_list]
Parameters: - aid_list –
- annot_age_months_est_min_list –
- TemplateInfo:
- Tsetter_native_column tbl = annot col = annot_age_months_est_min
- RESTful:
- Method: PUT URL: /api/annot/age_months_est_min/
-
ibeis.control.manual_annot_funcs.
set_annot_bboxes
(ibs, aid_list, bbox_list, delete_thumbs=True)[source]¶ Sets bboxes of a list of annotations by aid,
Parameters: - aid_list (list of rowids) – list of annotation rowids
- bbox_list (list of (x, y, w, h) – new bounding boxes for each aid
Note
set_annot_bboxes is a proxy for set_annot_verts
- RESTful:
- Method: PUT URL: /api/annot/bboxes/
-
ibeis.control.manual_annot_funcs.
set_annot_detect_confidence
(ibs, aid_list, confidence_list)[source]¶ Sets annotation notes
- RESTful:
- Method: PUT URL: /api/annot/detect_confidence/
-
ibeis.control.manual_annot_funcs.
set_annot_exemplar_flags
(ibs, aid_list, flag_list)[source]¶ Sets if an annotation is an exemplar
- RESTful:
- Method: PUT URL: /api/annot/exemplar_flags/
-
ibeis.control.manual_annot_funcs.
set_annot_name_rowids
(ibs, aid_list, name_rowid_list)[source]¶ name_rowid_list -> annot.name_rowid[aid_list]
Sets names/nids of a list of annotations.
Parameters: - aid_list (list) –
- name_rowid_list (list) –
- RESTful:
- Method: PUT URL: /api/annot/name_rowids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[0:2] >>> # check clean state >>> ut.assert_eq(ibs.get_annot_names(aid_list), ['____', 'easy']) >>> ut.assert_eq(ibs.get_annot_exemplar_flags(aid_list), [0, 1]) >>> # run function >>> name_list = ['easy', '____'] >>> name_rowid_list = ibs.get_name_rowids_from_text(name_list) >>> ibs.set_annot_name_rowids(aid_list, name_rowid_list) >>> # check results >>> ut.assert_eq(ibs.get_annot_names(aid_list), ['easy', '____']) >>> ut.assert_eq(ibs.get_annot_exemplar_flags(aid_list), [0, 0]) >>> # restore database state >>> ibs.set_annot_names(aid_list, ['____', 'easy']) >>> ibs.set_annot_exemplar_flags(aid_list, [0, 1]) >>> ut.assert_eq(ibs.get_annot_names(aid_list), ['____', 'easy']) >>> ut.assert_eq(ibs.get_annot_exemplar_flags(aid_list), [0, 1])
-
ibeis.control.manual_annot_funcs.
set_annot_name_texts
(ibs, aid_list, name_list)[source]¶ alias
- RESTful:
- Method: GET URL: /api/annot/names/
-
ibeis.control.manual_annot_funcs.
set_annot_names
(ibs, aid_list, name_list)[source]¶ Sets the attrlbl_value of type(INDIVIDUAL_KEY) Sets names/nids of a list of annotations.
CommandLine:
python -m ibeis.control.manual_annot_funcs --test-set_annot_names --enableall
- RESTful:
- Method: PUT URL: /api/annot/names/
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> name_list1 = get_annot_names(ibs, aid_list) >>> name_list2 = [name + '_TESTAUG' for name in name_list1] >>> set_annot_names(ibs, aid_list, name_list2) >>> name_list3 = get_annot_names(ibs, aid_list) >>> set_annot_names(ibs, aid_list, name_list1) >>> name_list4 = get_annot_names(ibs, aid_list) >>> assert name_list2 == name_list3 >>> assert name_list4 == name_list1 >>> assert name_list4 != name_list2 >>> print(result)
-
ibeis.control.manual_annot_funcs.
set_annot_notes
(ibs, aid_list, notes_list)[source]¶ Sets annotation notes
- RESTful:
- Method: PUT URL: /api/annot/notes/
-
ibeis.control.manual_annot_funcs.
set_annot_parent_rowid
(ibs, aid_list, parent_aid_list)[source]¶ Sets the annotation’s parent aid. TODO DEPRICATE IN FAVOR OF SEPARATE PARTS TABLE
- RESTful:
- Method: PUT URL: /api/annot/parent_rowid/
-
ibeis.control.manual_annot_funcs.
set_annot_qualities
(ibs, aid_list, annot_quality_list)[source]¶ annot_quality_list -> annot.annot_quality[aid_list]
A quality is an integer representing the following types:
Parameters: - aid_list –
- annot_quality_list –
- SeeAlso:
- ibeis.const.QUALITY_INT_TO_TEXT
- RESTful:
- Method: PUT URL: /api/annot/qualities/
-
ibeis.control.manual_annot_funcs.
set_annot_quality_texts
(ibs, aid_list, quality_text_list)[source]¶ Auto-docstr for ‘set_annot_quality_texts’
- RESTful:
- Method: PUT URL: /api/annot/quality_texts/
-
ibeis.control.manual_annot_funcs.
set_annot_sex
(ibs, aid_list, name_sex_list, eager=True, nInput=None)[source]¶ Auto-docstr for ‘set_annot_sex’
- RESTful:
- Method: PUT URL: /api/annot/sex/
-
ibeis.control.manual_annot_funcs.
set_annot_sex_texts
(ibs, aid_list, name_sex_text_list, eager=True, nInput=None)[source]¶ Auto-docstr for ‘set_annot_sex_texts’
- RESTful:
- Method: PUT URL: /api/annot/sex_texts/
-
ibeis.control.manual_annot_funcs.
set_annot_species
(ibs, aid_list, species_text_list)[source]¶ Sets species/speciesids of a list of annotations. Convenience function for set_annot_lblannot_from_value
- RESTful:
- Method: PUT URL: /api/annot/species/
-
ibeis.control.manual_annot_funcs.
set_annot_species_rowids
(ibs, aid_list, species_rowid_list)[source]¶ species_rowid_list -> annot.species_rowid[aid_list]
Sets species/speciesids of a list of annotations.
Parameters: - aid_list –
- species_rowid_list –
- RESTful:
- Method: PUT URL: /api/annot/species_rowids/
-
ibeis.control.manual_annot_funcs.
set_annot_tag_text
(ibs, aid_list, annot_tags_list, duplicate_behavior=u'error')[source]¶ annot_tags_list -> annot.annot_tags[aid_list]
Parameters: - aid_list –
- annot_tags_list –
-
ibeis.control.manual_annot_funcs.
set_annot_thetas
(ibs, aid_list, theta_list, delete_thumbs=True)[source]¶ Sets thetas of a list of chips by aid
- RESTful:
- Method: PUT URL: /api/annot/thetas/
-
ibeis.control.manual_annot_funcs.
set_annot_verts
(ibs, aid_list, verts_list, delete_thumbs=True)[source]¶ Sets the vertices [(x, y), ...] of a list of chips by aid
- RESTful:
- Method: PUT URL: /api/annot/verts/
-
ibeis.control.manual_annot_funcs.
set_annot_yaw_texts
(ibs, aid_list, yaw_text_list)[source]¶ Auto-docstr for ‘set_annot_yaw_texts’
- RESTful:
- Method: PUT URL: /api/annot/yaw_texts/
-
ibeis.control.manual_annot_funcs.
set_annot_yaws
(ibs, aid_list, yaw_list, input_is_degrees=False)[source]¶ Sets the yaw of a list of chips by aid
A yaw is the yaw of the annotation in radians Viewpoint yaw is inverted. Will be fixed soon.
Note
- The following views have these angles of yaw:
- left side - 0.00 tau radians front side - 0.25 tau radians right side - 0.50 tau radians back side - 0.75 tau radians (tau = 2 * pi)
- SeeAlso:
- ibies.const.VIEWTEXT_TO_YAW_RADIANS
References
http://upload.wikimedia.org/wikipedia/commons/7/7e/Rollpitchyawplain.png
- RESTful:
- Method: PUT URL: /api/annot/yaws/
-
ibeis.control.manual_annot_funcs.
update_annot_semantic_uuids
(ibs, aid_list, _visual_infotup=None)[source]¶ Ensures that annots have the proper semantic uuids
- RESTful:
- Method: PUT URL: /api/annot/semantic_uuids/
-
ibeis.control.manual_annot_funcs.
update_annot_visual_uuids
(ibs, aid_list)[source]¶ Ensures that annots have the proper visual uuids
Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (list) – list of annotation rowids
- RESTful:
- Method: PUT URL: /api/annot/visual_uuids/
CommandLine:
python -m ibeis.control.manual_annot_funcs --exec-update_annot_visual_uuids --db PZ_Master1 python -m ibeis --tf update_annot_visual_uuids --db PZ_Master1 python -m ibeis --tf update_annot_visual_uuids --db PZ_Master0 python -m ibeis --tf update_annot_visual_uuids --db PZ_MTEST
Example
>>> # SCRIPT >>> from ibeis.control.manual_annot_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> aid_list = ibs._get_all_aids() >>> update_annot_visual_uuids(ibs, aid_list)
ibeis.control.manual_annotgroup_funcs module¶
Autogenerated IBEISController functions
- TemplateInfo:
- autogen_time = 13:31:28 2015/04/28 autogen_key = annotgroup
- ToRegenerate:
- python -m ibeis.templates.template_generator –key annotgroup –Tcfg with_web_api=True with_api_cache=False with_deleters=True no_extern_deleters=True –diff python -m ibeis.templates.template_generator –key annotgroup –Tcfg with_web_api=True with_api_cache=False with_deleters=True no_extern_deleters=True –write
-
ibeis.control.manual_annotgroup_funcs.
add_annotgroup
(ibs, annotgroup_uuid_list, annotgroup_text_list, annotgroup_note_list)[source]¶ Returns: returns annotgroup_rowid_list of added (or already existing annotgroups) - TemplateInfo:
- Tadder_native tbl = annotgroup
-
ibeis.control.manual_annotgroup_funcs.
delete_annotgroup
(ibs, annotgroup_rowid_list, config2_=None)[source]¶ annotgroup.delete(annotgroup_rowid_list)
delete annotgroup rows
Parameters: annotgroup_rowid_list – Returns: num_deleted Return type: int - TemplateInfo:
- Tdeleter_native_tbl tbl = annotgroup
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_annotgroup_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> annotgroup_rowid_list = ibs._get_all_annotgroup_rowids()[:2] >>> num_deleted = ibs.delete_annotgroup(annotgroup_rowid_list) >>> print('num_deleted = %r' % (num_deleted,))
-
ibeis.control.manual_annotgroup_funcs.
get_annotgroup_gar_rowids
(ibs, annotgroup_rowid_list, eager=True, nInput=None)[source]¶ Auto-docstr for ‘get_annotgroup_gar_rowids’
- RESTful:
- Method: GET URL: /api/annotgroup/gar_rowids/
-
ibeis.control.manual_annotgroup_funcs.
get_annotgroup_note
(ibs, annotgroup_rowid_list, eager=True, nInput=None)[source]¶ annotgroup_note_list <- annotgroup.annotgroup_note[annotgroup_rowid_list]
gets data from the “native” column “annotgroup_note” in the “annotgroup” table
Parameters: annotgroup_rowid_list (list) – Returns: annotgroup_note_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotgroup_note tbl = annotgroup
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annotgroup_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> annotgroup_rowid_list = ibs._get_all_annotgroup_rowids() >>> eager = True >>> annotgroup_note_list = ibs.get_annotgroup_note(annotgroup_rowid_list, eager=eager) >>> assert len(annotgroup_rowid_list) == len(annotgroup_note_list)
-
ibeis.control.manual_annotgroup_funcs.
get_annotgroup_rowid_from_superkey
(ibs, annotgroup_text_list, eager=True, nInput=None)[source]¶ annotgroup_rowid_list <- annotgroup[annotgroup_text_list]
Parameters: lists (superkey) – annotgroup_text_list Returns: annotgroup_rowid_list - TemplateInfo:
- Tgetter_native_rowid_from_superkey tbl = annotgroup
-
ibeis.control.manual_annotgroup_funcs.
get_annotgroup_text
(ibs, annotgroup_rowid_list, eager=True, nInput=None)[source]¶ annotgroup_text_list <- annotgroup.annotgroup_text[annotgroup_rowid_list]
gets data from the “native” column “annotgroup_text” in the “annotgroup” table
Parameters: annotgroup_rowid_list (list) – Returns: annotgroup_text_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotgroup_text tbl = annotgroup
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annotgroup_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> annotgroup_rowid_list = ibs._get_all_annotgroup_rowids() >>> eager = True >>> annotgroup_text_list = ibs.get_annotgroup_text(annotgroup_rowid_list, eager=eager) >>> assert len(annotgroup_rowid_list) == len(annotgroup_text_list)
-
ibeis.control.manual_annotgroup_funcs.
get_annotgroup_uuid
(ibs, annotgroup_rowid_list, eager=True, nInput=None)[source]¶ annotgroup_uuid_list <- annotgroup.annotgroup_uuid[annotgroup_rowid_list]
gets data from the “native” column “annotgroup_uuid” in the “annotgroup” table
Parameters: annotgroup_rowid_list (list) – Returns: annotgroup_uuid_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotgroup_uuid tbl = annotgroup
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_annotgroup_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> annotgroup_rowid_list = ibs._get_all_annotgroup_rowids() >>> eager = True >>> annotgroup_uuid_list = ibs.get_annotgroup_uuid(annotgroup_rowid_list, eager=eager) >>> assert len(annotgroup_rowid_list) == len(annotgroup_uuid_list)
-
ibeis.control.manual_annotgroup_funcs.
set_annotgroup_note
(ibs, annotgroup_rowid_list, annotgroup_note_list, duplicate_behavior=u'error')[source]¶ annotgroup_note_list -> annotgroup.annotgroup_note[annotgroup_rowid_list]
Parameters: - annotgroup_rowid_list –
- annotgroup_note_list –
- TemplateInfo:
- Tsetter_native_column tbl = annotgroup col = annotgroup_note
-
ibeis.control.manual_annotgroup_funcs.
set_annotgroup_uuid
(ibs, annotgroup_rowid_list, annotgroup_uuid_list, duplicate_behavior=u'error')[source]¶ annotgroup_uuid_list -> annotgroup.annotgroup_uuid[annotgroup_rowid_list]
Parameters: - annotgroup_rowid_list –
- annotgroup_uuid_list –
- TemplateInfo:
- Tsetter_native_column tbl = annotgroup col = annotgroup_uuid
ibeis.control.manual_chip_funcs module¶
python -c “import utool as ut; ut.write_modscript_alias(‘Tgen.sh’, ‘ibeis.templates.template_generator’)” sh Tgen.sh –key chip –Tcfg with_setters=False with_getters=True with_adders=True –modfname manual_chip_funcs sh Tgen.sh –key chip
python -m utool.util_inspect –exec-check_module_usage –pat=”manual_chip_funcs.py”
-
ibeis.control.manual_chip_funcs.
delete_annot_chips
(ibs, aid_list, config2_=None)[source]¶ Clears annotation data (does not remove the annotation)
- RESTful:
- Method: DELETE URL: /api/annot_chip/
-
ibeis.control.manual_chip_funcs.
get_annot_chip_dlensqrd
(ibs, aid_list, config2_=None)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (list) –
Returns: topx2_dlen_sqrd
Return type: list
CommandLine:
python -m ibeis.control.manual_chip_funcs --test-get_annot_chip_dlensqrd
- RESTful:
- Method: GET URL: /api/annot_chip/dlensqrd/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_chip_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> config2_ = {'dim_size': 450, 'resize_dim': 'area'} >>> topx2_dlen_sqrd = ibs.get_annot_chip_dlensqrd(aid_list, config2_=config2_) >>> result = str(topx2_dlen_sqrd) >>> print(result) [435409, 476505, 422500, 422500, 422500, 437924, 405000, 405000, 447805, 420953, 405008, 406265, 512674]
-
ibeis.control.manual_chip_funcs.
get_annot_chip_fpath
(ibs, aid_list, ensure=True, config2_=None, check_external_storage=False, extra_tries=0)[source]¶ Returns the cached chip uri based off of the current configuration.
Returns: chip_fpath_list – cfpaths defined by ANNOTATIONs Return type: list - RESTful:
- Method: GET URL: /api/annot_chip/fpath/
-
ibeis.control.manual_chip_funcs.
get_annot_chip_sizes
(ibs, aid_list, ensure=True, config2_=None)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
- ensure (bool) – eager evaluation if True
Returns: chipsz_list - the (width, height) of computed annotation chips.
Return type: list
CommandLine:
python -m ibeis.control.manual_chip_funcs --test-get_annot_chip_sizes
- RESTful:
- Method: GET URL: /api/annot_chip/sizes/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_chip_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[0:3] >>> ensure = True >>> config2_ = {'dim_size': 450, 'resize_dim': 'area'} >>> # execute function >>> chipsz_list = get_annot_chip_sizes(ibs, aid_list, ensure, config2_=config2_) >>> # verify results >>> result = str(chipsz_list) >>> print(result) [(545, 372), (603, 336), (520, 390)]
-
ibeis.control.manual_chip_funcs.
get_annot_chip_thumbpath
(ibs, aid_list, thumbsize=None, config2_=None)[source]¶ just constructs the path. does not compute it. that is done by api_thumb_delegate
- RESTful:
- Method: GET URL: /api/annot_chip/thumbpath/
-
ibeis.control.manual_chip_funcs.
get_annot_chip_thumbtup
(ibs, aid_list, thumbsize=None, config2_=None)[source]¶ get chip thumb info The return type of this is interpreted and computed in ~/code/guitool/guitool/api_thumb_delegate.py
Parameters: - aid_list (list) –
- thumbsize (int) –
Returns: thumbtup_list - [(thumb_path, img_path, imgsize, bboxes, thetas)]
Return type: list
CommandLine:
python -m ibeis.control.manual_chip_funcs --test-get_annot_chip_thumbtup
- RESTful:
- Method: GET URL: /api/annot_chip/thumbtup/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_chip_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> thumbsize = 128 >>> result = get_annot_chip_thumbtup(ibs, aid_list, thumbsize) >>> print(result)
-
ibeis.control.manual_chip_funcs.
get_annot_chips
(ibs, aid_list, config2_=None, ensure=True, verbose=False, eager=True)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (int) – list of annotation ids
- ensure (bool) – eager evaluation if True
- config2 (QueryRequest) – query request object with hyper-parameters
Returns: chip_list
Return type: list
CommandLine:
python -m ibeis.control.manual_chip_funcs --test-get_annot_chips python -m ibeis.templates.template_generator --key chip --funcname-filter '\<get_annot_chips\>'
- RESTful:
- Method: GET URL: /api/annot_chip/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_chip_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[0:5] >>> config2_ = {'dim_size': 450, 'resize_dim': 'area'} >>> chip_list = get_annot_chips(ibs, aid_list, config2_) >>> chip_sum_list = list(map(np.sum, chip_list)) >>> ut.assert_almost_eq(chip_sum_list, [96053500, 65152954, 67223241, 109358624, 73995960], 2000) >>> print(chip_sum_list)
ibeis.control.manual_feat_funcs module¶
python -c “import utool as ut; ut.write_modscript_alias(‘Tgen.sh’, ‘ibeis.templates.template_generator’)” sh Tgen.sh –key feat –Tcfg with_setters=False with_getters=True with_adders=True –modfname manual_feat_funcs sh Tgen.sh –key feat –Tcfg with_deleters=True –autogen_modname manual_feat_funcs
-
ibeis.control.manual_feat_funcs.
delete_annot_feats
(ibs, aid_list, config2_=None)[source]¶ annot.feat.delete(aid_list)
Parameters: aid_list – - TemplateInfo:
- Tdeleter_rl_depenant root = annot leaf = feat
CommandLine:
python -m ibeis.control.manual_feat_funcs --test-delete_annot_feats python -m ibeis.control.manual_feat_funcs --test-delete_annot_feats --verb-control
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_feat_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> aid_list = ibs._get_all_aids()[:1] >>> fids_list = ibs.get_annot_feat_rowids(aid_list, config2_=config2_, ensure=True) >>> num_deleted1 = ibs.delete_annot_feats(aid_list, config2_=config2_) >>> ut.assert_eq(num_deleted1, len(fids_list)) >>> num_deleted2 = ibs.delete_annot_feats(aid_list, config2_=config2_) >>> ut.assert_eq(num_deleted2, 0)
-
ibeis.control.manual_feat_funcs.
get_annot_feat_rowids
(ibs, aid_list, ensure=True, eager=True, nInput=None, config2_=None, extra_tries=1)[source]¶
-
ibeis.control.manual_feat_funcs.
get_annot_kpts
(ibs, aid_list, ensure=True, eager=True, nInput=None, config2_=None)[source]¶ Parameters: - aid_list (int) – list of annotation ids
- ensure (bool) – eager evaluation if True
- eager (bool) –
- nInput (None) –
- config2 (QueryRequest) – query request object with hyper-parameters
Returns: kpts_list – annotation descriptor keypoints
Return type: list
CommandLine:
python -m ibeis.control.manual_feat_funcs --test-get_annot_kpts --show python -m ibeis.control.manual_feat_funcs --test-get_annot_kpts --show --darken .9 python -m ibeis.control.manual_feat_funcs --test-get_annot_kpts --show --darken .9 --verbose python -m ibeis.control.manual_feat_funcs --test-get_annot_kpts --show --darken .9 --verbose --no-affine-invariance python -m ibeis.control.manual_feat_funcs --test-get_annot_kpts --show --darken .9 --verbose --no-affine-invariance --scale_max=20 python -m ibeis.control.manual_feat_funcs --test-get_annot_kpts --show --feat_type=hesaff+siam128 ipython -i -- --show --feat_type=hesaff+siam128
Example
>>> # SLOW_DOCTEST >>> from ibeis.control.manual_feat_funcs import * # NOQA >>> import vtool as vt >>> import numpy as np >>> import ibeis >>> import ibeis.viz.interact >>> # build test data >>> qreq1_ = ibeis.testdata_qreq_(defaultdb='testdb1', p=['default:RI=True']) >>> qreq2_ = ibeis.testdata_qreq_(defaultdb='testdb1', p=['default:RI=False']) >>> ibs = qreq1_.ibs >>> aid_list = qreq1_.get_external_qaids() >>> with ut.Indenter('[TEST_GET_ANNOT_KPTS]'): ... print('qreq1 params: ' + qreq1_.qparams.feat_cfgstr) ... print('qreq2 params: ' + qreq2_.qparams.feat_cfgstr) ... print('id(qreq1): ' + str(id(qreq1_))) ... print('id(qreq2): ' + str(id(qreq2_))) ... #print('feat_config_rowid1 = %r' % (ibs.get_feat_config_rowid(config2_=qreq1_.get_external_query_config2()),)) ... #print('feat_config_rowid2 = %r' % (ibs.get_feat_config_rowid(config2_=qreq2_.get_external_query_config2()),)) >>> # Force recomputation of features >>> with ut.Indenter('[DELETE1]'): ... ibs.delete_annot_feats(aid_list, config2_=qreq1_.get_external_query_config2()) >>> with ut.Indenter('[DELETE2]'): ... ibs.delete_annot_feats(aid_list, config2_=qreq2_.get_external_query_config2()) >>> eager, ensure, nInput = True, True, None >>> # execute function >>> with ut.Indenter('[GET1]'): ... kpts1_list = get_annot_kpts(ibs, aid_list, ensure, eager, nInput, qreq1_.get_external_query_config2()) >>> with ut.Indenter('[GET2]'): ... kpts2_list = get_annot_kpts(ibs, aid_list, ensure, eager, nInput, qreq2_.get_external_query_config2()) >>> # verify results >>> assert not np.all(vt.get_oris(kpts1_list[0]) == 0) >>> assert np.all(vt.get_oris(kpts2_list[0]) == 0) >>> ut.quit_if_noshow() >>> #ibeis.viz.viz_chip.show_chip(ibs, aid_list[0], config2_=qreq1_, ori=True) >>> ibeis.viz.interact.interact_chip.ishow_chip(ibs, aid_list[0], config2_=qreq1_.get_external_query_config2(), ori=True, fnum=1) >>> ibeis.viz.interact.interact_chip.ishow_chip(ibs, aid_list[0], config2_=qreq2_.get_external_query_config2(), ori=True, fnum=2) >>> ut.show_if_requested()
-
ibeis.control.manual_feat_funcs.
get_annot_num_feats
(ibs, aid_list, ensure=True, eager=True, nInput=None, config2_=None)[source]¶ Parameters: aid_list (list) – Returns: nFeats_list – num descriptors per annotation Return type: list CommandLine:
python -m ibeis.control.manual_feat_funcs --test-get_annot_num_feats
Example
>>> # ENABLE_DOCTEST >>> # this test might fail on different machines due to >>> # determenism bugs in hesaff maybe? or maybe jpeg... >>> # in which case its hopeless >>> from ibeis.control.manual_feat_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()[0:3] >>> config2_ = {'dim_size': 450, 'resize_dim': 'area'} >>> nFeats_list = get_annot_num_feats(ibs, aid_list, ensure=True, config2_=config2_) >>> print('nFeats_list = %r' % (nFeats_list,)) >>> assert len(nFeats_list) == 3 >>> ut.assert_inbounds(nFeats_list[0], 1200, 1258) >>> ut.assert_inbounds(nFeats_list[1], 900, 922) >>> ut.assert_inbounds(nFeats_list[2], 1300, 1343)
ibeis.control.manual_featweight_funcs module¶
-
ibeis.control.manual_featweight_funcs.
get_annot_featweight_rowids
(ibs, aid_list, config2_=None, ensure=True, eager=True, nInput=None)[source]¶
ibeis.control.manual_garelate_funcs module¶
Autogenerated IBEISController functions
- TemplateInfo:
- autogen_time = 13:34:34 2015/04/28 autogen_key = gar
- ToRegenerate:
- python -m ibeis.templates.template_generator –key gar –Tcfg with_web_api=True with_api_cache=False with_deleters=True no_extern_deleters=True –diff python -m ibeis.templates.template_generator –key gar –Tcfg with_web_api=True with_api_cache=False with_deleters=True no_extern_deleters=True –write
-
ibeis.control.manual_garelate_funcs.
add_gar
(ibs, annotgroup_rowid_list, aid_list)[source]¶ Returns: returns gar_rowid_list of added (or already existing gars) - TemplateInfo:
- Tadder_native tbl = gar
-
ibeis.control.manual_garelate_funcs.
delete_gar
(ibs, gar_rowid_list, config2_=None)[source]¶ gar.delete(gar_rowid_list)
delete gar rows
Parameters: gar_rowid_list – Returns: num_deleted Return type: int - TemplateInfo:
- Tdeleter_native_tbl tbl = gar
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_garelate_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> gar_rowid_list = ibs._get_all_gar_rowids()[:2] >>> num_deleted = ibs.delete_gar(gar_rowid_list) >>> print('num_deleted = %r' % (num_deleted,))
-
ibeis.control.manual_garelate_funcs.
get_gar_aid
(ibs, gar_rowid_list, eager=True, nInput=None)[source]¶ aid_list <- gar.aid[gar_rowid_list]
gets data from the “native” column “aid” in the “gar” table
Parameters: gar_rowid_list (list) – Returns: aid_list Return type: list - TemplateInfo:
- Tgetter_table_column col = aid tbl = gar
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_garelate_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> gar_rowid_list = ibs._get_all_gar_rowids() >>> eager = True >>> aid_list = ibs.get_gar_aid(gar_rowid_list, eager=eager) >>> assert len(gar_rowid_list) == len(aid_list)
-
ibeis.control.manual_garelate_funcs.
get_gar_annotgroup_rowid
(ibs, gar_rowid_list, eager=True, nInput=None)[source]¶ annotgroup_rowid_list <- gar.annotgroup_rowid[gar_rowid_list]
gets data from the “native” column “annotgroup_rowid” in the “gar” table
Parameters: gar_rowid_list (list) – Returns: annotgroup_rowid_list Return type: list - TemplateInfo:
- Tgetter_table_column col = annotgroup_rowid tbl = gar
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_garelate_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> gar_rowid_list = ibs._get_all_gar_rowids() >>> eager = True >>> annotgroup_rowid_list = ibs.get_gar_annotgroup_rowid(gar_rowid_list, eager=eager) >>> assert len(gar_rowid_list) == len(annotgroup_rowid_list)
-
ibeis.control.manual_garelate_funcs.
get_gar_rowid_from_superkey
(ibs, annotgroup_rowid_list, aid_list, eager=True, nInput=None)[source]¶ gar_rowid_list <- gar[annotgroup_rowid_list, aid_list]
Parameters: lists (superkey) – annotgroup_rowid_list, aid_list Returns: gar_rowid_list - TemplateInfo:
- Tgetter_native_rowid_from_superkey tbl = gar
ibeis.control.manual_gsgrelate_funcs module¶
CommandLine:
# Autogenerate ImageSet Functions
# key should be the table name
# the write flag makes a file, but dont use that
python -m ibeis.templates.template_generator --key imageset_image_relationship --onlyfn
-
ibeis.control.manual_gsgrelate_funcs.
add_image_relationship
(ibs, gid_list, imgsetid_list)[source]¶ Adds a relationship between an image and and imageset
-
ibeis.control.manual_gsgrelate_funcs.
delete_empty_imgsetids
(ibs)[source]¶ Removes imagesets without images
Parameters: ibs (IBEISController) – ibeis controller object CommandLine:
python -m ibeis.control.manual_gsgrelate_funcs --test-delete_empty_imgsetids
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_gsgrelate_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> # execute function >>> result = ibs.delete_empty_imgsetids() >>> # verify results >>> print(result)
-
ibeis.control.manual_gsgrelate_funcs.
delete_gsgr_image_relations
(ibs, gid_list)[source]¶ Removes relationship between input images and all imagesets
-
ibeis.control.manual_gsgrelate_funcs.
delete_gsgr_imageset_relations
(ibs, imgsetid_list)[source]¶ Removes relationship between input imagesets and all images
-
ibeis.control.manual_gsgrelate_funcs.
get_gsgr_rowid_from_superkey
(ibs, gid_list, imgsetid_list)[source]¶ Returns: gsgrid_list – eg-relate-ids from info constrained to be unique (imgsetid, gid) Return type: list
-
ibeis.control.manual_gsgrelate_funcs.
get_image_gsgrids
(ibs, gid_list)[source]¶ Returns: list_ – a list of imageset-image-relationship rowids for each imageid Return type: list
-
ibeis.control.manual_gsgrelate_funcs.
unrelate_images_and_imagesets
(ibs, gid_list, imgsetid_list)[source]¶ Seems to unrelate specific image imageset pairs
Parameters: - ibs (IBEISController) – ibeis controller object
- gid_list (list) –
- imgsetid_list (list) –
Returns: gids_list
Return type: list
CommandLine:
python -m ibeis.control.manual_gsgrelate_funcs --test-unrelate_images_and_imagesets python -c "import utool; print(utool.auto_docstr('ibeis.control.manual_gsgrelate_funcs', 'delete_gsgr_image_relations'))"
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_gsgrelate_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> # Reset and compute imagesets >>> ibs.delete_all_imagesets() >>> ibs.compute_occurrences() >>> imgsetid_list = ibs.get_valid_imgsetids() >>> gids_list = ibs.get_imageset_gids(imgsetid_list) >>> assert len(imgsetid_list) == 2 >>> assert len(gids_list) == 2 >>> assert len(gids_list[0]) == 7 >>> assert len(gids_list[1]) == 6 >>> # Add imageset 2 gids to imageset 1 so an image belongs to multiple imagesets >>> imgset2_gids = gids_list[1][0:1] >>> imgset1_imgsetids = imgsetid_list[0:1] >>> ibs.add_image_relationship(imgset2_gids, imgset1_imgsetids) >>> # Now delete the image from the imageset 2 >>> imgset2_imgsetids = imgsetid_list[1:2] >>> # execute function >>> ibs.unrelate_images_and_imagesets(imgset2_gids, imgset2_imgsetids) >>> # verify results >>> ibs.print_egpairs_table() >>> imgsetid_list_ = ibs.get_valid_imgsetids() >>> gids_list_ = ibs.get_imageset_gids(imgsetid_list_) >>> result = str(gids_list_) >>> print(result) >>> # imgset2_gids should now only be in imageset1 >>> assert imgset2_gids[0] in gids_list_[0] >>> assert imgset2_gids[0] not in gids_list_[1]
ibeis.control.manual_ibeiscontrol_funcs module¶
-
ibeis.control.manual_ibeiscontrol_funcs.
get_annot_kpts_distinctiveness
(ibs, aid_list, config2_=None, **kwargs)[source]¶ very hacky, but cute way to cache keypoint distinctivness
Parameters: - ibs (IBEISController) – ibeis controller object
- aid_list (list) –
- dstncvs_normer (None) –
Returns: dstncvs_list
Return type: list
CommandLine:
python -m ibeis.control.manual_ibeiscontrol_funcs --test-get_annot_kpts_distinctiveness
Example
>>> # SLOW_DOCTEST >>> from ibeis.control.manual_ibeiscontrol_funcs import * # NOQA >>> from ibeis.algo.hots import distinctiveness_normalizer >>> import ibeis >>> import numpy as np >>> config2_ = None >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids(species=const.TEST_SPECIES.ZEB_PLAIN) >>> # execute function >>> aid_list1 = aid_list[::2] >>> aid_list2 = aid_list[1::3] >>> dstncvs_list1 = get_annot_kpts_distinctiveness(ibs, aid_list1) >>> dstncvs_list2 = get_annot_kpts_distinctiveness(ibs, aid_list2) >>> dstncvs_list = get_annot_kpts_distinctiveness(ibs, aid_list) >>> print(ut.depth_profile(dstncvs_list1)) >>> stats_dict = ut.dict_stack([ut.get_stats(dstncvs) for dstncvs in dstncvs_list]) >>> print(ut.dict_str(stats_dict)) >>> assert np.all(np.array(stats_dict['min']) >= 0), 'distinctiveness was out of bounds' >>> assert np.all(np.array(stats_dict['max']) <= 1), 'distinctiveness was out of bounds'
-
ibeis.control.manual_ibeiscontrol_funcs.
get_feat_kpts_distinctiveness
(ibs, fid_list, dstncvs_normer=None, species_rowid=None, **kwargs)[source]¶
-
ibeis.control.manual_ibeiscontrol_funcs.
get_vocab_words
(ibs, taids=None, qreq_=None)[source]¶ Hackyish way of putting vocab generation into the controller. Ideally there would be a preproc_vocab in ibeis.algo.preproc and sql would store this under some config
Example
>>> from ibeis.control.manual_ibeiscontrol_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids()
-
ibeis.control.manual_ibeiscontrol_funcs.
new_query_params
(ibs, cfgdict=None, **kwargs)[source]¶ convinience method while configs are still in a state of disarray. Converts ibs.cfg.query_cfg into a QueryParams object
Parameters: - ibs (IBEISController) – ibeis controller object
- cfgdict (dict) – (default = None)
Returns: qparams - query hyper-parameters
Return type: CommandLine:
python -m ibeis.control.manual_ibeiscontrol_funcs --exec-new_query_params
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_ibeiscontrol_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> cfgdict = None >>> qparams = new_query_params(ibs, cfgdict) >>> result = ('qparams = %s' % (str(qparams),)) >>> print(result)
-
ibeis.control.manual_ibeiscontrol_funcs.
new_query_request
(ibs, qaid_list, daid_list, cfgdict=None, verbose=True, **kwargs)[source]¶ alias for ibeis.algo.hots.query_request.new_ibeis_query_request
Parameters: - qaid_list (list) –
- daid_list (list) –
- cfgdict (None) –
- verbose (bool) –
Returns: qreq_ - hyper-parameters
Return type: CommandLine:
python -m ibeis.control.manual_ibeiscontrol_funcs --test-new_query_request
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_ibeiscontrol_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> daid_list = ibs.get_valid_aids() >>> qaid_list = daid_list[0:2] >>> cfgdict = {} >>> verbose = True >>> qreq_ = new_query_request(ibs, qaid_list, daid_list, cfgdict, verbose) >>> qreq_.set_external_qaid_mask(qaid_list[1:2]) >>> print(qreq_.get_external_qaids()) >>> result = str(qreq_.get_query_hashid()) >>> print(result) _QSUUIDS((1)nozvwbdokngephfk)
_QSUUIDS((1)nztoqb6&7apjltd1)
ibeis.control.manual_image_funcs module¶
Functions for images and encoutners that will be injected into an IBEISController instance.
CommandLine:
# Autogenerate ImageSet Functions
# key should be the table name
# the write flag makes a file, but dont use that
python -m ibeis.templates.template_generator --key image --onlyfn
python -m ibeis.templates.template_generator --key image --fnfilt timedelta_posix --modfname manual_image_funcs # NOQA
python -m ibeis.templates.template_generator --key image --fnfilt location --modfname manual_image_funcs # NOQA
python -m ibeis.templates.template_generator --key image --fnfilt set_.*time --modfname manual_image_funcs # NOQA
image_timedelta_posix
-
ibeis.control.manual_image_funcs.
add_images
(ibs, gpath_list, params_list=None, as_annots=False, auto_localize=None, sanitize=True, **kwargs)[source]¶ Adds a list of image paths to the database.
Initially we set the image_uri to exactely the given gpath. Later we change the uri, but keeping it the same here lets us process images asychronously.
Parameters: - gpath_list (list) – list of image paths to add
- params_list (list) – metadata list for corresponding images that can either be specified outright or can be parsed from the image data directly if None
- as_annots (bool) – if True, an annotation is automatically added for the entire image
- auto_localize (bool) – if None uses the default specified in ibs.cfg
- ensure (bool) – check to see if the images exist on a *NIX system. Defaults to True
Returns: gid_list – gids are image rowids
Return type: list of rowids
- RESTful:
- Method: POST URL: /api/image/path
- Example0:
>>> # ENABLE_DOCTEST >>> # Test returns None on fail to add >>> from ibeis.control.manual_image_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> gpath_list = ['doesnotexist.jpg'] >>> assert not ut.checkpath(gpath_list[0]) >>> gid_list = ibs.add_images(gpath_list) >>> assert len(gid_list) == len(gpath_list) >>> assert gid_list[0] is None
- Example1:
>>> # ENABLE_DOCTSET >>> # test double add >>> from ibeis.control.manual_image_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> new_gpath_list = [ut.grab_test_imgpath('carl.jpg')] >>> new_gids1 = ibs.add_images(new_gpath_list, auto_localize=False) >>> new_gids2 = ibs.add_images(new_gpath_list, auto_localize=False) >>> #new_gids2 = ibs.add_images(new_gpath_list, auto_localize=True) >>> assert new_gids1 == new_gids2, 'should be the same' >>> new_gpath_list2 = ibs.get_image_paths(new_gids1) >>> assert new_gpath_list == new_gpath_list2, 'should not move when autolocalize is False' >>> # Clean things up >>> ibs.delete_images(new_gids1)
-
ibeis.control.manual_image_funcs.
delete_image_thumbs
(ibs, gid_list, **config2_)[source]¶ Removes image thumbnails from disk
- RESTful:
- Method: DELETE URL: /api/image/thumbs/
Example
>>> # UNPORTED_DOCTEST >>> gpath_list = grabdata.get_test_gpaths(ndata=None)[0:4] >>> gid_list = ibs.add_images(gpath_list) >>> bbox_list = [(0, 0, 100, 100)] * len(gid_list) >>> name_list = ['a', 'b', 'a', 'd'] >>> aid_list = ibs.add_annots(gid_list, bbox_list=bbox_list, >>> name_list=name_list) >>> assert len(aid_list) != 0, "No annotations added" >>> thumbpath_list = ibs.get_image_thumbpath(gid_list) >>> gpath_list = ibs.get_image_paths(gid_list) >>> ibs.delete_image_thumbs(gid_list) >>> assert utool.is_list(thumbpath_list), "thumbpath_list is not a list" >>> assert utool.is_list(gpath_list), "gpath_list is not a list" >>> for path in thumbpath_list: >>> assert not utool.checkpath(path), "Thumbnail not deleted" >>> for path in gpath_list: >>> utool.assertpath(path)
-
ibeis.control.manual_image_funcs.
delete_images
(ibs, gid_list, trash_images=True)[source]¶ deletes images from the database that belong to gids
- RESTful:
- Method: DELETE URL: /api/image/
Example
>>> # UNPORTED_DOCTEST >>> gpath_list = grabdata.get_test_gpaths(ndata=None)[0:4] >>> gid_list = ibs.add_images(gpath_list) >>> bbox_list = [(0, 0, 100, 100)] * len(gid_list) >>> name_list = ['a', 'b', 'a', 'd'] >>> aid_list = ibs.add_annots(gid_list, bbox_list=bbox_list, name_list=name_list) >>> gid = gid_list[0] >>> assert gid is not None, "gid is None" >>> aid_list = ibs.get_image_aids(gid) >>> assert len(aid_list) == 1, "Length of aid_list=%r" % (len(aid_list),) >>> aid = aid_list[0] >>> assert aid is not None, "aid is None" >>> cid = ibs.get_annot_chip_rowids(aid, ensure=False) >>> fid = ibs.get_annot_feat_rowids(aid, ensure=False) >>> assert cid is None, "cid=%r should be None" % (cid,) >>> assert fid is None, "fid=%r should be None" % (fid,) >>> cid = ibs.get_annot_chip_rowids(aid, ensure=True) >>> fid = ibs.get_annot_feat_rowids(aid, ensure=True) >>> assert cid is not None, "cid should be computed" >>> assert fid is not None, "fid should be computed" >>> gthumbpath = ibs.get_image_thumbpath(gid) >>> athumbpath = ibs.get_annot_chip_thumbpath(aid) >>> ibs.delete_images(gid) >>> all_gids = ibs.get_valid_gids() >>> all_aids = ibs.get_valid_aids() >>> all_cids = ibs.get_valid_cids() >>> all_fids = ibs.get_valid_fids() >>> assert gid not in all_gids, "gid still exists" >>> assert aid not in all_aids, "rid %r still exists" % aid >>> assert fid not in all_fids, "fid %r still exists" % fid >>> assert cid not in all_cids, "cid %r still exists" % cid >>> assert not utool.checkpath(gthumbpath), "Thumbnail still exists" >>> assert not utool.checkpath(athumbpath), "ANNOTATION Thumbnail still exists"
-
ibeis.control.manual_image_funcs.
get_image_aids
(ibs, gid_list)[source]¶ Returns: list_ – a list of aids for each image by gid
Return type: list
Parameters: - ibs (IBEISController) – ibeis controller object
- gid_list (list) –
Returns: aids_list
Return type: list
CommandLine:
python -m ibeis.control.manual_image_funcs --test-get_image_aids
- RESTful:
- Method: GET URL: /api/image/aids/
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> gid_list = ibs.get_annot_gids(ibs.get_valid_aids()) >>> gid_list = gid_list + gid_list[::5] >>> # execute function >>> aids_list = get_image_aids(ibs, gid_list) >>> # verify results >>> result = str(aids_list) >>> print(result) [[1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [1], [6], [11]]
-
ibeis.control.manual_image_funcs.
get_image_aids_of_species
(ibs, gid_list, species=None)[source]¶ Returns: list_ – a list of aids for each image by gid filtered by species Return type: list - RESTful:
- Method: GET URL: /api/image/aids_of_species/
-
ibeis.control.manual_image_funcs.
get_image_contributor_rowid
(ibs, image_rowid_list, eager=True, nInput=None)[source]¶ contributor_rowid_list <- image.contributor_rowid[image_rowid_list]
gets data from the “native” column “contributor_rowid” in the “image” table
Parameters: image_rowid_list (list) – Returns: contributor_rowid_list - list of image contributor rowids by gid Return type: list - TemplateInfo:
- Tgetter_table_column col = contributor_rowid tbl = image
- RESTful:
- Method: GET URL: /api/image/contributor_rowid/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> image_rowid_list = ibs._get_all_image_rowids() >>> eager = True >>> contributor_rowid_list = ibs.get_image_contributor_rowid(image_rowid_list, eager=eager) >>> assert len(image_rowid_list) == len(contributor_rowid_list)
-
ibeis.control.manual_image_funcs.
get_image_contributor_tag
(ibs, image_rowid_list, eager=True, nInput=None)[source]¶ contributor_tag_list <- image.contributor_tag[image_rowid_list]
Parameters: image_rowid_list (list) – Returns: contributor_tag_list Return type: list - TemplateInfo:
- Tgetter_extern tbl = image externtbl = contributor externcol = contributor_tag
- RESTful:
- Method: GET URL: /api/image/contributor_tag/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> image_rowid_list = ibs._get_all_image_rowids() >>> eager = True >>> contributor_tag_list = ibs.get_image_contributor_tag(image_rowid_list, eager=eager) >>> assert len(image_rowid_list) == len(contributor_tag_list)
-
ibeis.control.manual_image_funcs.
get_image_detect_confidence
(ibs, gid_list)[source]¶ Returns: list_ – image detection confidence as the max of ANNOTATION confidences Return type: list - RESTful:
- Method: GET URL: /api/image/detect_confidence/
-
ibeis.control.manual_image_funcs.
get_image_detectpaths
(ibs, gid_list)[source]¶ Returns: list_ – a list of image paths resized to a constant area for detection Return type: list - RESTful:
- Method: GET URL: /api/image/detectpaths/
-
ibeis.control.manual_image_funcs.
get_image_enabled
(ibs, gid_list)[source]¶ Returns: list_ – “Image Enabled” flag, true if the image is enabled Return type: list - RESTful:
- Method: GET URL: /api/image/enabled/
-
ibeis.control.manual_image_funcs.
get_image_exts
(ibs, gid_list)[source]¶ Returns: list_ – a list of image uuids by gid Return type: list - RESTful:
- Method: GET URL: /api/image/exts/
-
ibeis.control.manual_image_funcs.
get_image_gid
(ibs, gid_list, eager=True, nInput=None)[source]¶ self verifier
CommandLine:
python -m ibeis.control.manual_image_funcs --exec-get_image_gid
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.IBEISControl import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> gid_list = ibs.get_valid_gids() + [None, -1, 10434320432] >>> gid_list_ = ibs.get_image_gid(gid_list) >>> assert [r is None for r in gid_list_[-3:]] >>> assert [r is not None for r in gid_list_[0:-3]] >>> print('gid_list_ = %r' % (gid_list_,))
-
ibeis.control.manual_image_funcs.
get_image_gids_from_uuid
(ibs, uuid_list)[source]¶ Returns: list_ – a list of original image names Return type: list - RESTful:
- Method: GET URL: /api/image/gids_from_uuid/
-
ibeis.control.manual_image_funcs.
get_image_gnames
(ibs, gid_list)[source]¶ Parameters: gid_list (list) – Returns: gname_list - a list of original image names Return type: list CommandLine:
python -m ibeis.control.manual_image_funcs --test-get_image_gnames
- RESTful:
- Method: GET URL: /api/image/gnames/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> gid_list = ibs.get_valid_gids() >>> # execute function >>> gname_list = get_image_gnames(ibs, gid_list) >>> # verify results >>> result = ut.list_str(gname_list) >>> print(result) [ 'easy1.JPG', 'easy2.JPG', 'easy3.JPG', 'hard1.JPG', 'hard2.JPG', 'hard3.JPG', 'jeff.png', 'lena.jpg', 'occl1.JPG', 'occl2.JPG', 'polar1.jpg', 'polar2.jpg', 'zebra.jpg', ]
-
ibeis.control.manual_image_funcs.
get_image_gps
(ibs, gid_list)[source]¶ Returns: gps_list – -1 if no timedata exists for a given gid Return type: list - RESTful:
- Method: GET URL: /api/image/gps/
-
ibeis.control.manual_image_funcs.
get_image_heights
(ibs, gid_list)[source]¶ Returns: list_ – a list of (width, height) tuples Return type: list - RESTful:
- Method: GET URL: /api/image/heights/
-
ibeis.control.manual_image_funcs.
get_image_imagesettext
(ibs, gid_list)[source]¶ Returns: list_ – a list of imagesettexts for each image by gid Return type: list - RESTful:
- Method: GET URL: /api/image/imagesettext/
-
ibeis.control.manual_image_funcs.
get_image_imgsetids
(ibs, gid_list)[source]¶ Returns: list_ – a list of imageset ids for each image by gid Return type: list - RESTful:
- Method: GET URL: /api/image/imgsetids/
-
ibeis.control.manual_image_funcs.
get_image_lat
(ibs, gid_list)[source]¶ - RESTful:
- Method: GET URL: /api/image/lat/
-
ibeis.control.manual_image_funcs.
get_image_location_codes
(ibs, image_rowid_list, eager=True)[source]¶ image_location_code_list <- image.image_location_code[image_rowid_list]
gets data from the “native” column “image_location_code” in the “image” table
Parameters: image_rowid_list (list) – Returns: image_location_code_list Return type: list - TemplateInfo:
- Tgetter_table_column col = image_location_code tbl = image
- RESTful:
- Method: GET URL: /api/image/location_codes/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> image_rowid_list = ibs._get_all_image_rowids() >>> eager = True >>> image_location_code_list = ibs.get_image_location_codes(image_rowid_list, eager=eager) >>> assert len(image_rowid_list) == len(image_location_code_list)
-
ibeis.control.manual_image_funcs.
get_image_lon
(ibs, gid_list)[source]¶ - RESTful:
- Method: GET URL: /api/image/lon/
-
ibeis.control.manual_image_funcs.
get_image_missing_uuid
(ibs, uuid_list)[source]¶ Returns: list_ – a list of missing image uuids Return type: list - RESTful:
- Method: GET URL: /api/image/missing_uuid/
-
ibeis.control.manual_image_funcs.
get_image_nids
(ibs, gid_list)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- gid_list (list) –
Returns: nids_list - the name ids associated with an image id
Return type: list
CommandLine:
python -m ibeis.control.manual_image_funcs --test-get_image_nids
- RESTful:
- Method: GET URL: /api/image/nids/
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> gid_list = ibs.get_valid_gids() >>> # execute function >>> nids_list = ibs.get_image_nids(gid_list) >>> # verify results >>> result = str(nids_list) >>> print(result)
-
ibeis.control.manual_image_funcs.
get_image_notes
(ibs, gid_list)[source]¶ Returns: list_ – image notes Return type: list - RESTful:
- Method: GET URL: /api/image/notes/
-
ibeis.control.manual_image_funcs.
get_image_num_annotations
(ibs, gid_list)[source]¶ Returns: list_ – the number of chips in each image Return type: list - RESTful:
- Method: GET URL: /api/image/num_annotations/
-
ibeis.control.manual_image_funcs.
get_image_orientation
(ibs, gid_list)[source]¶ - RESTful:
- Method: GET URL: /api/image/orientation/
-
ibeis.control.manual_image_funcs.
get_image_orientation_str
(ibs, gid_list)[source]¶ - RESTful:
- Method: GET URL: /api/image/orientation_str/
-
ibeis.control.manual_image_funcs.
get_image_party_rowids
(ibs, image_rowid_list, eager=True, nInput=None)[source]¶ party_rowid_list <- image.party_rowid[image_rowid_list]
gets data from the “native” column “party_rowid” in the “image” table
Parameters: image_rowid_list (list) – Returns: party_rowid_list Return type: list - TemplateInfo:
- Tgetter_table_column col = party_rowid tbl = image
- RESTful:
- Method: GET URL: /api/image/party_rowids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> image_rowid_list = ibs._get_all_image_rowids() >>> eager = True >>> party_rowid_list = ibs.get_image_party_rowids(image_rowid_list, eager=eager) >>> assert len(image_rowid_list) == len(party_rowid_list)
-
ibeis.control.manual_image_funcs.
get_image_party_tag
(ibs, image_rowid_list, eager=True, nInput=None)[source]¶ party_tag_list <- image.party_tag[image_rowid_list]
Parameters: image_rowid_list (list) – Returns: party_tag_list Return type: list - TemplateInfo:
- Tgetter_extern tbl = image externtbl = party externcol = party_tag
- RESTful:
- Method: GET URL: /api/image/party_tag/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> image_rowid_list = ibs._get_all_image_rowids() >>> eager = True >>> party_tag_list = ibs.get_image_party_tag(image_rowid_list, eager=eager) >>> assert len(image_rowid_list) == len(party_tag_list)
-
ibeis.control.manual_image_funcs.
get_image_paths
(ibs, gid_list)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- gid_list (list) – a list of image absolute paths to img_dir
Returns: gpath_list
Return type: list
CommandLine:
python -m ibeis.control.manual_image_funcs --test-get_image_paths
- RESTful:
- Method: GET URL: /api/image/paths/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> #gid_list = ibs.get_valid_gids() >>> # execute function >>> #gpath_list = get_image_paths(ibs, gid_list) >>> new_gpath = ut.unixpath(ut.grab_test_imgpath('carl.jpg')) >>> gid_list = ibs.add_images([new_gpath], auto_localize=False) >>> new_gpath_list = get_image_paths(ibs, gid_list) >>> # verify results >>> ut.assert_eq(new_gpath, new_gpath_list[0]) >>> result = str(new_gpath_list) >>> # clean up the database! >>> ibs.delete_images(gid_list) >>> # ibs.delete_images(new_gids) >>> print(result)
-
ibeis.control.manual_image_funcs.
get_image_reviewed
(ibs, gid_list)[source]¶ Returns: list_ – “All Instances Found” flag, true if all objects of interest Return type: list (animals) have an ANNOTATION in the image
- RESTful:
- Method: GET URL: /api/image/reviewed/
-
ibeis.control.manual_image_funcs.
get_image_sizes
(ibs, gid_list)[source]¶ Returns: list_ – a list of (width, height) tuples Return type: list - RESTful:
- Method: GET URL: /api/image/sizes/
-
ibeis.control.manual_image_funcs.
get_image_species_rowids
(ibs, gid_list)[source]¶ Returns: list_ – the name ids associated with an image id Return type: list - RESTful:
- Method: GET URL: /api/image/species_rowids/
-
ibeis.control.manual_image_funcs.
get_image_thumbpath
(ibs, gid_list, ensure_paths=False, **config)[source]¶ Returns: list_ – the thumbnail path of each gid Return type: list - RESTful:
- Method: GET URL: /api/image/thumbpath/
-
ibeis.control.manual_image_funcs.
get_image_thumbtup
(ibs, gid_list, **kwargs)[source]¶ Returns: thumbtup_list - [(thumb_path, img_path, imgsize, bboxes, thetas)] Return type: list - RESTful:
- Method: GET URL: /api/image/thumbtup/
-
ibeis.control.manual_image_funcs.
get_image_timedelta_posix
(ibs, image_rowid_list, eager=True)[source]¶ image_timedelta_posix_list <- image.image_timedelta_posix[image_rowid_list]
# TODO: INTEGRATE THIS FUNCTION. CURRENTLY OFFSETS ARE ENCODIED DIRECTLY IN UNIXTIME
gets data from the “native” column “image_timedelta_posix” in the “image” table
Parameters: image_rowid_list (list) – Returns: image_timedelta_posix_list Return type: list - TemplateInfo:
- Tgetter_table_column col = image_timedelta_posix tbl = image
- RESTful:
- Method: GET URL: /api/image/timedelta_posix/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> image_rowid_list = ibs._get_all_image_rowids() >>> eager = True >>> image_timedelta_posix_list = ibs.get_image_timedelta_posix(image_rowid_list, eager=eager) >>> assert len(image_rowid_list) == len(image_timedelta_posix_list)
-
ibeis.control.manual_image_funcs.
get_image_unixtime
(ibs, gid_list)[source]¶ Returns: list_ – a list of times that the images were taken by gid. Return type: list Returns: list_ – -1 if no timedata exists for a given gid Return type: list - RESTful:
- Method: GET URL: /api/image/unixtime/
-
ibeis.control.manual_image_funcs.
get_image_uris
(ibs, gid_list)[source]¶ Returns: list_ – a list of image uris relative to the image dir by gid Return type: list - RESTful:
- Method: GET URL: /api/image/uris/
-
ibeis.control.manual_image_funcs.
get_image_uris_original
(ibs, gid_list)[source]¶ Returns: list_ – a list of (original) image uris relative to the image dir by gid Return type: list - RESTful:
- Method: GET URL: /api/image/uris_original/
-
ibeis.control.manual_image_funcs.
get_image_uuids
(ibs, gid_list)[source]¶ Returns: list_ – a list of image uuids by gid
Return type: list
Parameters: - ibs (IBEISController) – ibeis controller object
- gid_list (list) –
Returns: image_uuid_list
Return type: list
CommandLine:
python -m ibeis.control.manual_image_funcs --test-get_image_uuids
- RESTful:
- Method: GET URL: /api/image/uuids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> gid_list = ibs.get_valid_gids() >>> # execute function >>> image_uuid_list = ibs.get_image_uuids(gid_list) >>> # verify results >>> result = ut.list_str(image_uuid_list) >>> print(result) [ UUID('66ec193a-1619-b3b6-216d-1784b4833b61'), UUID('d8903434-942f-e0f5-d6c2-0dcbe3137bf7'), UUID('b73b72f4-4acb-c445-e72c-05ce02719d3d'), UUID('0cd05978-3d83-b2ee-2ac9-798dd571c3b3'), UUID('0a9bc03d-a75e-8d14-0153-e2949502aba7'), UUID('2deeff06-5546-c752-15dc-2bd0fdb1198a'), UUID('a9b70278-a936-c1dd-8a3b-bc1e9a998bf0'), UUID('42fdad98-369a-2cbc-67b1-983d6d6a3a60'), UUID('c459d381-fd74-1d99-6215-e42e3f432ea9'), UUID('33fd9813-3a2b-774b-3fcc-4360d1ae151b'), UUID('97e8ea74-873f-2092-b372-f928a7be30fa'), UUID('588bc218-83a5-d400-21aa-d499832632b0'), UUID('163a890c-36f2-981e-3529-c552b6d668a3'), ]
-
ibeis.control.manual_image_funcs.
get_image_widths
(ibs, gid_list)[source]¶ Returns: list_ – a list of (width, height) tuples Return type: list - RESTful:
- Method: GET URL: /api/image/widths/
-
ibeis.control.manual_image_funcs.
get_images
(ibs, gid_list, force_orient=False, **kwargs)[source]¶ Returns: list_ – a list of images in numpy matrix form by gid
Return type: list
Parameters: - ibs (IBEISController) – ibeis controller object
- gid_list (list) –
Returns: image_list
Return type: list
CommandLine:
python -m ibeis.control.manual_image_funcs --test-get_images
- RESTful:
- Returns the base64 encoded image of image <gid> # Documented and routed in ibeis.web app.py Method: GET URL: /api/image/<gid>
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> gid_list = ibs.get_valid_gids()[0:1] >>> # execute function >>> image_list = get_images(ibs, gid_list) >>> # verify results >>> result = str(image_list[0].shape) >>> print(result) (715, 1047, 3)
-
ibeis.control.manual_image_funcs.
get_num_images
(ibs, **kwargs)[source]¶ Number of valid images
- RESTful:
- Method: GET URL: /api/image/num/
-
ibeis.control.manual_image_funcs.
get_valid_gids
(ibs, imgsetid=None, require_unixtime=False, require_gps=None, reviewed=None)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- imgsetid (None) –
- require_unixtime (bool) –
- reviewed (None) –
Returns: gid_list
Return type: list
CommandLine:
python -m ibeis.control.manual_image_funcs --test-get_valid_gids
- RESTful:
- Method: GET URL: /api/image/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> imgsetid = None >>> require_unixtime = False >>> reviewed = None >>> # execute function >>> gid_list = get_valid_gids(ibs, imgsetid, require_unixtime, reviewed) >>> # verify results >>> result = str(gid_list) >>> print(result) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
-
ibeis.control.manual_image_funcs.
get_valid_image_rowids
(ibs, imgsetid=None, require_unixtime=False, reviewed=None)[source]¶ alias
- RESTful:
- Method: GET URL: /api/image/valid_rowids/
-
ibeis.control.manual_image_funcs.
get_valid_image_uuids
(ibs)[source]¶ Returns: list_ – a list of image uuids for all valid gids Return type: list Parameters: ibs (IBEISController) – ibeis controller object Returns: image_uuid_list Return type: list CommandLine:
python -m ibeis.control.manual_image_funcs --test-get_image_uuids
- RESTful:
- Method: GET URL: /api/image/uuids/valid/
-
ibeis.control.manual_image_funcs.
image_base64_api
(gid=None, thumbnail=False, fresh=False, **kwargs)[source]¶ Returns the base64 encoded image of image <gid>
- RESTful:
- Method: GET URL: /api/image/<gid>/
-
ibeis.control.manual_image_funcs.
localize_images
(ibs, gid_list_=None)[source]¶ Moves the images into the ibeis image cache. Images are renamed to img_uuid.ext
Parameters: - ibs (IBEISController) – ibeis controller object
- gid_list (list) –
CommandLine:
python -m ibeis.control.manual_image_funcs --test-localize_images
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_image_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> gpath_list = [ut.unixpath(ut.grab_test_imgpath('carl.jpg'))] >>> gid_list_ = ibs.add_images(gpath_list, auto_localize=False) >>> gpath_list2 = ibs.get_image_paths(gid_list_) >>> ut.assert_eq(gpath_list, gpath_list2, 'should not move when autolocalize is False') >>> # execute function >>> result = localize_images(ibs, gid_list_) >>> gpath_list3 = ibs.get_image_paths(gid_list_) >>> assert gpath_list3 != gpath_list2, 'should now be different gpath_list3=%r' % (gpath_list3,) >>> gpath3 = gpath_list3[0] >>> rel_gpath3 = ut.relpath_unix(gpath3, ibs.get_workdir()) >>> result = rel_gpath3 >>> print(result) >>> # Clean things up >>> ibs.delete_images(gid_list_) testdb1/_ibsdb/images/f498fa6f-6b24-b4fa-7932-2612144fedd5.jpg
-
ibeis.control.manual_image_funcs.
set_image_contributor_rowid
(ibs, gid_list, contributor_rowid_list, **kwargs)[source]¶ Sets the image contributor rowid
- RESTful:
- Method: PUT URL: /api/image/contributor_rowid/
-
ibeis.control.manual_image_funcs.
set_image_enabled
(ibs, gid_list, enabled_list)[source]¶ Sets the image all instances found bit
- RESTful:
- Method: PUT URL: /api/image/enabled/
-
ibeis.control.manual_image_funcs.
set_image_gps
(ibs, gid_list, gps_list=None, lat_list=None, lon_list=None)[source]¶ - see get_image_gps for how the gps_list should look.
- lat and lon should be given in degrees
- RESTful:
- Method: PUT URL: /api/image/gps/
-
ibeis.control.manual_image_funcs.
set_image_imagesettext
(ibs, gid_list, imagesettext_list)[source]¶ Sets the encoutertext of each image
- RESTful:
- Method: PUT URL: /api/image/imagesettext/
-
ibeis.control.manual_image_funcs.
set_image_imgsetids
(ibs, gid_list, imgsetid_list)[source]¶ Sets the encoutertext of each image
- RESTful:
- Method: PUT URL: /api/image/imgsetids/
-
ibeis.control.manual_image_funcs.
set_image_location_codes
(ibs, image_rowid_list, image_location_code_list, duplicate_behavior='error')[source]¶ image_location_code_list -> image.image_location_code[image_rowid_list]
Parameters: - image_rowid_list –
- image_location_code_list –
- TemplateInfo:
- Tsetter_native_column tbl = image col = image_location_code
- RESTful:
- Method: PUT URL: /api/image/location_codes/
-
ibeis.control.manual_image_funcs.
set_image_notes
(ibs, gid_list, notes_list)[source]¶ Sets the image all instances found bit
- RESTful:
- Method: PUT URL: /api/image/notes/
-
ibeis.control.manual_image_funcs.
set_image_orientation
(ibs, gid_list, orientation_list)[source]¶ - RESTful:
- Method: PUT URL: /api/image/orientation/
-
ibeis.control.manual_image_funcs.
set_image_party_rowids
(ibs, image_rowid_list, party_rowid_list, duplicate_behavior=u'error')[source]¶ party_rowid_list -> image.party_rowid[image_rowid_list]
Parameters: - image_rowid_list –
- party_rowid_list –
- TemplateInfo:
- Tsetter_native_column tbl = image col = party_rowid
- RESTful:
- Method: PUT URL: /api/image/party_rowids/
-
ibeis.control.manual_image_funcs.
set_image_reviewed
(ibs, gid_list, reviewed_list)[source]¶ Sets the image all instances found bit
- RESTful:
- Method: PUT URL: /api/image/reviewed/
-
ibeis.control.manual_image_funcs.
set_image_time_posix
(ibs, image_rowid_list, image_time_posix_list, duplicate_behavior='error')[source]¶ image_time_posix_list -> image.image_time_posix[image_rowid_list]
- SeeAlso:
- set_image_unixtime
Parameters: - image_rowid_list –
- image_time_posix_list –
- TemplateInfo:
- Tsetter_native_column tbl = image col = image_time_posix
- RESTful:
- Method: PUT URL: /api/image/time_posix/
-
ibeis.control.manual_image_funcs.
set_image_timedelta_posix
(ibs, image_rowid_list, image_timedelta_posix_list, duplicate_behavior='error')[source]¶ image_timedelta_posix_list -> image.image_timedelta_posix[image_rowid_list]
Parameters: - image_rowid_list –
- image_timedelta_posix_list –
- TemplateInfo:
- Tsetter_native_column tbl = image col = image_timedelta_posix
- RESTful:
- Method: PUT URL: /api/image/timedelta_posix/
-
ibeis.control.manual_image_funcs.
set_image_unixtime
(ibs, gid_list, unixtime_list, duplicate_behavior=u'error')[source]¶ - Sets the image unixtime (does not modify exif yet)
- alias for set_image_time_posix
- RESTful:
- Method: PUT URL: /api/image/unixtime/
-
ibeis.control.manual_image_funcs.
set_image_uris
(ibs, gid_list, new_gpath_list)[source]¶ Sets the image URIs to a new local path. This is used when localizing or unlocalizing images. An absolute path can either be on this machine or on the cloud A relative path is relative to the ibeis image cache on this machine.
- RESTful:
- Method: PUT URL: /api/image/uris/
-
ibeis.control.manual_image_funcs.
set_image_uris_original
(ibs, gid_list, new_gpath_list, overwrite=False)[source]¶ Sets the (original) image URIs to a new local path.
Parameters: overwrite (bool) – If overwrite, replace the information in the database. This ensures that original uris cannot be accidentally overwritten. Defaults to False. - RESTful:
- Method: PUT URL: /api/image/uris_original/
ibeis.control.manual_imageset_funcs module¶
-
ibeis.control.manual_imageset_funcs.
add_imagesets
(ibs, imagesettext_list, imageset_uuid_list=None, config_rowid_list=None, notes_list=None)[source]¶ Adds a list of imagesets.
Parameters: - imagesettext_list (list) –
- imageset_uuid_list (list) –
- config_rowid_list (list) –
- notes_list (list) –
Returns: imgsetid_list – added imageset rowids
Return type: list
- RESTful:
- Method: POST URL: /api/imageset/
-
ibeis.control.manual_imageset_funcs.
delete_imagesets
(ibs, imgsetid_list)[source]¶ Removes imagesets and thier relationships (images are not effected)
- RESTful:
- Method: DELETE URL: /api/imageset/
-
ibeis.control.manual_imageset_funcs.
get_imageset_aids
(ibs, imgsetid_list)[source]¶ Returns: aids_list – a list of list of aids in each imageset Return type: list - RESTful:
- Method: GET URL: /api/imageset/aids/
Parameters: - ibs (IBEISController) – ibeis controller object
- imgsetid_list (list) –
Returns: aids_list
Return type: list
CommandLine:
python -m ibeis.control.manual_imageset_funcs --test-get_imageset_aids
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> ibs.delete_imagesets(ibs.get_valid_imgsetids()) >>> ibs.compute_occurrences() >>> imgsetid_list = ibs.get_valid_imgsetids() >>> aids_list = get_imageset_aids(ibs, imgsetid_list) >>> result = ('aids_list = %s' % (str(aids_list),)) >>> print(result)
-
ibeis.control.manual_imageset_funcs.
get_imageset_configid
(ibs, imgsetid_list)[source]¶ Returns: list_ – config_rowid of each imgsetid in imgsetid_list Return type: list - RESTful:
- Method: GET URL: /api/imageset/configid/
-
ibeis.control.manual_imageset_funcs.
get_imageset_custom_filtered_aids
(ibs, imgsetid_list)[source]¶ hacks to filter aids to only certain views and qualities
- RESTful:
- Method: GET URL: /api/imageset/custom_filtered_aids/
-
ibeis.control.manual_imageset_funcs.
get_imageset_duration
(ibs, imageset_rowid_list)[source]¶ gets the imageset’s duration
Parameters: imageset_rowid_list (list) – Returns: imageset_duration Return type: list - RESTful:
- Method: GET URL: /api/imageset/duration/
-
ibeis.control.manual_imageset_funcs.
get_imageset_end_time_posix
(ibs, imageset_rowid_list)[source]¶ imageset_end_time_posix_list <- imageset.imageset_end_time_posix[imageset_rowid_list]
gets data from the “native” column “imageset_end_time_posix” in the “imageset” table
Parameters: imageset_rowid_list (list) – Returns: imageset_end_time_posix_list Return type: list - TemplateInfo:
- Tgetter_table_column col = imageset_end_time_posix tbl = imageset
- RESTful:
- Method: GET URL: /api/imageset/end_time_posix/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> imageset_rowid_list = ibs._get_all_imageset_rowids() >>> imageset_end_time_posix_list = ibs.get_imageset_end_time_posix(imageset_rowid_list) >>> assert len(imageset_rowid_list) == len(imageset_end_time_posix_list)
-
ibeis.control.manual_imageset_funcs.
get_imageset_fraction_annotmatch_reviewed
(ibs, imgsetid_list)[source]¶ - RESTful:
- Method: GET URL: /api/imageset/fraction_annotmatch_reviewed/
-
ibeis.control.manual_imageset_funcs.
get_imageset_fraction_imgs_reviewed
(ibs, imgsetid_list)[source]¶ - RESTful:
- Method: GET URL: /api/imageset/fraction_imgs_reviewed/
-
ibeis.control.manual_imageset_funcs.
get_imageset_fraction_names_with_exemplar
(ibs, imgsetid_list)[source]¶ - RESTful:
- Method: GET URL: /api/imageset/fraction_names_with_exemplar/
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> import ibeis # NOQA >>> ibs = ibeis.opendb('testdb2') >>> imgsetid_list = ibs._get_all_imageset_rowids() >>> fraction_exemplared_names_list = ibs.get_imageset_fraction_names_with_exemplar(imgsetid_list)
-
ibeis.control.manual_imageset_funcs.
get_imageset_gids
(ibs, imgsetid_list)[source]¶ Returns: gids_list – a list of list of gids in each imageset Return type: list - RESTful:
- Method: GET URL: /api/imageset/gids/
-
ibeis.control.manual_imageset_funcs.
get_imageset_gps_lats
(ibs, imageset_rowid_list)[source]¶ imageset_gps_lat_list <- imageset.imageset_gps_lat[imageset_rowid_list]
gets data from the “native” column “imageset_gps_lat” in the “imageset” table
Parameters: imageset_rowid_list (list) – Returns: imageset_gps_lat_list Return type: list - TemplateInfo:
- Tgetter_table_column col = imageset_gps_lat tbl = imageset
- RESTful:
- Method: GET URL: /api/imageset/gps_lats/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> imageset_rowid_list = ibs._get_all_imageset_rowids() >>> imageset_gps_lat_list = ibs.get_imageset_gps_lats(imageset_rowid_list) >>> assert len(imageset_rowid_list) == len(imageset_gps_lat_list)
-
ibeis.control.manual_imageset_funcs.
get_imageset_gps_lons
(ibs, imageset_rowid_list)[source]¶ imageset_gps_lon_list <- imageset.imageset_gps_lon[imageset_rowid_list]
gets data from the “native” column “imageset_gps_lon” in the “imageset” table
Parameters: imageset_rowid_list (list) – Returns: imageset_gps_lon_list Return type: list - TemplateInfo:
- Tgetter_table_column col = imageset_gps_lon tbl = imageset
- RESTful:
- Method: GET URL: /api/imageset/gps_lons/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> imageset_rowid_list = ibs._get_all_imageset_rowids() >>> imageset_gps_lon_list = ibs.get_imageset_gps_lons(imageset_rowid_list) >>> assert len(imageset_rowid_list) == len(imageset_gps_lon_list)
-
ibeis.control.manual_imageset_funcs.
get_imageset_gsgrids
(ibs, imgsetid_list=None, gid_list=None)[source]¶ Returns: list_ – a list of imageset-image-relationship rowids for each encouterid Return type: list - RESTful:
- Method: GET URL: /api/imageset/gsgrids/
-
ibeis.control.manual_imageset_funcs.
get_imageset_imgsetids_from_text
(ibs, imagesettext_list, ensure=True)[source]¶ Returns: list_ – a list of imgsetids corresponding to each imageset imagesettext Return type: list #FIXME: make new naming scheme for non-primary-key-getters get_imageset_imgsetids_from_text_from_text
- RESTful:
- Method: GET URL: /api/imageset/imgsetids_from_text/
-
ibeis.control.manual_imageset_funcs.
get_imageset_imgsetids_from_uuid
(ibs, uuid_list)[source]¶ Returns: list_ – a list of imgsetids corresponding to each imageset imagesettext Return type: list #FIXME: make new naming scheme for non-primary-key-getters get_imageset_imgsetids_from_text_from_text
- RESTful:
- Method: GET URL: /api/imageset/imgsetids_from_text/
-
ibeis.control.manual_imageset_funcs.
get_imageset_nids
(ibs, imgsetid_list)[source]¶ Returns: list_ – a list of list of known nids in each imageset Return type: list CommandLine:
python -m ibeis.control.manual_imageset_funcs --test-get_imageset_nids
- RESTful:
- Method: GET URL: /api/imageset/nids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> ibs.delete_imagesets(ibs.get_valid_imgsetids()) >>> ibs.compute_occurrences() >>> imgsetid_list = ibs.get_valid_imgsetids() >>> nids_list = ibs.get_imageset_nids(imgsetid_list) >>> result = nids_list >>> print(result) [[1, 2, 3], [4, 5, 6, 7]]
-
ibeis.control.manual_imageset_funcs.
get_imageset_note
(ibs, imgsetid_list)[source]¶ Returns: list_ – imageset_note of each imgsetid in imgsetid_list Return type: list - RESTful:
- Method: GET URL: /api/imageset/note/
-
ibeis.control.manual_imageset_funcs.
get_imageset_notes
(ibs, imageset_rowid_list)[source]¶ imageset_note_list <- imageset.imageset_note[imageset_rowid_list]
gets data from the “native” column “imageset_note” in the “imageset” table
Parameters: imageset_rowid_list (list) – Returns: imageset_note_list Return type: list - TemplateInfo:
- Tgetter_table_column col = imageset_note tbl = imageset
- RESTful:
- Method: GET URL: /api/imageset/notes/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> imageset_rowid_list = ibs._get_all_imageset_rowids() >>> imageset_note_list = ibs.get_imageset_notes(imageset_rowid_list) >>> assert len(imageset_rowid_list) == len(imageset_note_list)
-
ibeis.control.manual_imageset_funcs.
get_imageset_num_aids
(ibs, imgsetid_list)[source]¶ Returns: nGids_list – number of images in each imageset Return type: list - RESTful:
- Method: GET URL: /api/imageset/num_aids/
-
ibeis.control.manual_imageset_funcs.
get_imageset_num_annotmatch_reviewed
(ibs, imgsetid_list)[source]¶ - RESTful:
- Method: GET URL: /api/imageset/num_annotmatch_reviewed/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> import ibeis # NOQA >>> ibs = ibeis.opendb('testdb1') >>> imgsetid_list = ibs._get_all_imageset_rowids() >>> num_annots_reviewed_list = ibs.get_imageset_num_annotmatch_reviewed(imgsetid_list)
-
ibeis.control.manual_imageset_funcs.
get_imageset_num_gids
(ibs, imgsetid_list)[source]¶ Returns: nGids_list – number of images in each imageset Return type: list - RESTful:
- Method: GET URL: /api/imageset/num_gids/
-
ibeis.control.manual_imageset_funcs.
get_imageset_num_imgs_reviewed
(ibs, imgsetid_list)[source]¶ - RESTful:
- Method: GET URL: /api/imageset/num_imgs_reviewed/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> # Reset and compute imagesets >>> ibs.delete_all_imagesets() >>> ibs.compute_occurrences() >>> imgsetid_list = ibs.get_valid_imgsetids() >>> num_reviwed_list = ibs.get_imageset_num_imgs_reviewed(imgsetid_list) >>> result = num_reviwed_list >>> print(result) [0, 0]
-
ibeis.control.manual_imageset_funcs.
get_imageset_num_names_with_exemplar
(ibs, imgsetid_list)[source]¶ - RESTful:
- Method: GET URL: /api/imageset/num_names_with_exemplar/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> import ibeis # NOQA >>> ibs = ibeis.opendb('testdb1') >>> imgsetid_list = ibs._get_all_imageset_rowids() >>> num_annots_reviewed_list = ibs.get_imageset_num_annotmatch_reviewed(imgsetid_list)
-
ibeis.control.manual_imageset_funcs.
get_imageset_percent_annotmatch_reviewed_str
(ibs, imgsetid_list)[source]¶ - RESTful:
- Method: GET URL: /api/imageset/percent_annotmatch_reviewed_str/
-
ibeis.control.manual_imageset_funcs.
get_imageset_percent_imgs_reviewed_str
(ibs, imgsetid_list)[source]¶ - RESTful:
- Method: GET URL: /api/imageset/percent_imgs_reviewed_str/
-
ibeis.control.manual_imageset_funcs.
get_imageset_percent_names_with_exemplar_str
(ibs, imgsetid_list)[source]¶ - RESTful:
- Method: GET URL: /api/imageset/percent_names_with_exemplar_str/
-
ibeis.control.manual_imageset_funcs.
get_imageset_processed_flags
(ibs, imageset_rowid_list)[source]¶ imageset_processed_flag_list <- imageset.imageset_processed_flag[imageset_rowid_list]
gets data from the “native” column “imageset_processed_flag” in the “imageset” table
Parameters: imageset_rowid_list (list) – Returns: imageset_processed_flag_list Return type: list - TemplateInfo:
- Tgetter_table_column col = imageset_processed_flag tbl = imageset
- RESTful:
- Method: GET URL: /api/imageset/processed_flags/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> imageset_rowid_list = ibs._get_all_imageset_rowids() >>> imageset_processed_flag_list = ibs.get_imageset_processed_flags(imageset_rowid_list) >>> assert len(imageset_rowid_list) == len(imageset_processed_flag_list)
-
ibeis.control.manual_imageset_funcs.
get_imageset_shipped_flags
(ibs, imageset_rowid_list)[source]¶ imageset_shipped_flag_list <- imageset.imageset_shipped_flag[imageset_rowid_list]
gets data from the “native” column “imageset_shipped_flag” in the “imageset” table
Parameters: imageset_rowid_list (list) – Returns: imageset_shipped_flag_list Return type: list - TemplateInfo:
- Tgetter_table_column col = imageset_shipped_flag tbl = imageset
- RESTful:
- Method: GET URL: /api/imageset/shipped_flags/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> imageset_rowid_list = ibs._get_all_imageset_rowids() >>> imageset_shipped_flag_list = ibs.get_imageset_shipped_flags(imageset_rowid_list) >>> assert len(imageset_rowid_list) == len(imageset_shipped_flag_list)
-
ibeis.control.manual_imageset_funcs.
get_imageset_smart_waypoint_ids
(ibs, imageset_rowid_list)[source]¶ imageset_smart_waypoint_id_list <- imageset.imageset_smart_waypoint_id[imageset_rowid_list]
gets data from the “native” column “imageset_smart_waypoint_id” in the “imageset” table
Parameters: imageset_rowid_list (list) – Returns: imageset_smart_waypoint_id_list Return type: list - TemplateInfo:
- Tgetter_table_column col = imageset_smart_waypoint_id tbl = imageset
- RESTful:
- Method: GET URL: /api/imageset/smart_waypoint_ids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> imageset_rowid_list = ibs._get_all_imageset_rowids() >>> imageset_smart_waypoint_id_list = ibs.get_imageset_smart_waypoint_ids(imageset_rowid_list) >>> assert len(imageset_rowid_list) == len(imageset_smart_waypoint_id_list)
-
ibeis.control.manual_imageset_funcs.
get_imageset_smart_xml_contents
(ibs, imageset_rowid_list)[source]¶
-
ibeis.control.manual_imageset_funcs.
get_imageset_smart_xml_fnames
(ibs, imageset_rowid_list)[source]¶ imageset_smart_xml_fname_list <- imageset.imageset_smart_xml_fname[imageset_rowid_list]
gets data from the “native” column “imageset_smart_xml_fname” in the “imageset” table
Parameters: imageset_rowid_list (list) – Returns: imageset_smart_xml_fname_list Return type: list - TemplateInfo:
- Tgetter_table_column col = imageset_smart_xml_fname tbl = imageset
- RESTful:
- Method: GET URL: /api/imageset/smart_xml_fnames/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> imageset_rowid_list = ibs._get_all_imageset_rowids() >>> imageset_smart_xml_fname_list = ibs.get_imageset_smart_xml_fnames(imageset_rowid_list) >>> assert len(imageset_rowid_list) == len(imageset_smart_xml_fname_list)
-
ibeis.control.manual_imageset_funcs.
get_imageset_start_time_posix
(ibs, imageset_rowid_list)[source]¶ imageset_start_time_posix_list <- imageset.imageset_start_time_posix[imageset_rowid_list]
gets data from the “native” column “imageset_start_time_posix” in the “imageset” table
Parameters: imageset_rowid_list (list) – Returns: imageset_start_time_posix_list Return type: list - TemplateInfo:
- Tgetter_table_column col = imageset_start_time_posix tbl = imageset
- RESTful:
- Method: GET URL: /api/imageset/start_time_posix/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_imageset_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> imageset_rowid_list = ibs._get_all_imageset_rowids() >>> imageset_start_time_posix_list = ibs.get_imageset_start_time_posix(imageset_rowid_list) >>> assert len(imageset_rowid_list) == len(imageset_start_time_posix_list)
-
ibeis.control.manual_imageset_funcs.
get_imageset_text
(ibs, imgsetid_list)[source]¶ Returns: list_ – imageset_text of each imgsetid in imgsetid_list Return type: list - RESTful:
- Method: GET URL: /api/imageset/text/
-
ibeis.control.manual_imageset_funcs.
get_imageset_uuid
(ibs, imgsetid_list)[source]¶ Returns: list_ – imageset_uuid of each imgsetid in imgsetid_list Return type: list - RESTful:
- Method: GET URL: /api/imageset/uuid/
-
ibeis.control.manual_imageset_funcs.
get_valid_imgsetids
(ibs, min_num_gids=0, processed=None, shipped=None)[source]¶ Returns: list_ – list of all imageset ids Return type: list - RESTful:
- Method: GET URL: /api/imageset/
-
ibeis.control.manual_imageset_funcs.
set_imageset_end_time_posix
(ibs, imageset_rowid_list, imageset_end_time_posix_list)[source]¶ imageset_end_time_posix_list -> imageset.imageset_end_time_posix[imageset_rowid_list]
Parameters: - imageset_rowid_list –
- imageset_end_time_posix_list –
- TemplateInfo:
- Tsetter_native_column tbl = imageset col = imageset_end_time_posix
- RESTful:
- Method: PUT URL: /api/imageset/end_time_posix/
-
ibeis.control.manual_imageset_funcs.
set_imageset_gps_lats
(ibs, imageset_rowid_list, imageset_gps_lat_list)[source]¶ imageset_gps_lat_list -> imageset.imageset_gps_lat[imageset_rowid_list]
Parameters: - imageset_rowid_list –
- imageset_gps_lat_list –
- TemplateInfo:
- Tsetter_native_column tbl = imageset col = imageset_gps_lat
- RESTful:
- Method: PUT URL: /api/imageset/gps_lats/
-
ibeis.control.manual_imageset_funcs.
set_imageset_gps_lons
(ibs, imageset_rowid_list, imageset_gps_lon_list)[source]¶ imageset_gps_lon_list -> imageset.imageset_gps_lon[imageset_rowid_list]
Parameters: - imageset_rowid_list –
- imageset_gps_lon_list –
- TemplateInfo:
- Tsetter_native_column tbl = imageset col = imageset_gps_lon
- RESTful:
- Method: PUT URL: /api/imageset/gps_lons/
-
ibeis.control.manual_imageset_funcs.
set_imageset_notes
(ibs, imageset_rowid_list, imageset_note_list)[source]¶ imageset_note_list -> imageset.imageset_note[imageset_rowid_list]
Parameters: - imageset_rowid_list –
- imageset_note_list –
- TemplateInfo:
- Tsetter_native_column tbl = imageset col = imageset_note
- RESTful:
- Method: PUT URL: /api/imageset/notes/
-
ibeis.control.manual_imageset_funcs.
set_imageset_processed_flags
(ibs, imageset_rowid_list, imageset_processed_flag_list)[source]¶ imageset_processed_flag_list -> imageset.imageset_processed_flag[imageset_rowid_list]
Parameters: - imageset_rowid_list –
- imageset_processed_flag_list –
- TemplateInfo:
- Tsetter_native_column tbl = imageset col = imageset_processed_flag
- RESTful:
- Method: PUT URL: /api/imageset/processed_flags/
-
ibeis.control.manual_imageset_funcs.
set_imageset_shipped_flags
(ibs, imageset_rowid_list, imageset_shipped_flag_list)[source]¶ imageset_shipped_flag_list -> imageset.imageset_shipped_flag[imageset_rowid_list]
Parameters: - imageset_rowid_list –
- imageset_shipped_flag_list –
- TemplateInfo:
- Tsetter_native_column tbl = imageset col = imageset_shipped_flag
- RESTful:
- Method: PUT URL: /api/imageset/shipped_flags/
-
ibeis.control.manual_imageset_funcs.
set_imageset_smart_waypoint_ids
(ibs, imageset_rowid_list, imageset_smart_waypoint_id_list)[source]¶ imageset_smart_waypoint_id_list -> imageset.imageset_smart_waypoint_id[imageset_rowid_list]
Parameters: - imageset_rowid_list –
- imageset_smart_waypoint_id_list –
- TemplateInfo:
- Tsetter_native_column tbl = imageset col = imageset_smart_waypoint_id
- RESTful:
- Method: PUT URL: /api/imageset/smart_waypoint_ids/
-
ibeis.control.manual_imageset_funcs.
set_imageset_smart_xml_fnames
(ibs, imageset_rowid_list, imageset_smart_xml_fname_list)[source]¶ imageset_smart_xml_fname_list -> imageset.imageset_smart_xml_fname[imageset_rowid_list]
Parameters: - imageset_rowid_list –
- imageset_smart_xml_fname_list –
- TemplateInfo:
- Tsetter_native_column tbl = imageset col = imageset_smart_xml_fname
- RESTful:
- Method: PUT URL: /api/imageset/smart_xml_fnames/
-
ibeis.control.manual_imageset_funcs.
set_imageset_start_time_posix
(ibs, imageset_rowid_list, imageset_start_time_posix_list)[source]¶ imageset_start_time_posix_list -> imageset.imageset_start_time_posix[imageset_rowid_list]
Parameters: - imageset_rowid_list –
- imageset_start_time_posix_list –
- TemplateInfo:
- Tsetter_native_column tbl = imageset col = imageset_start_time_posix
- RESTful:
- Method: PUT URL: /api/imageset/start_time_posix/
-
ibeis.control.manual_imageset_funcs.
set_imageset_text
(ibs, imgsetid_list, imageset_text_list)[source]¶ Sets names of imagesets (groups of animals)
- RESTful:
- Method: PUT URL: /api/imageset/text/
-
ibeis.control.manual_imageset_funcs.
update_imageset_info
(ibs, imageset_rowid_list)[source]¶ sets start and end time for imagesets
FIXME: should not need to bulk update, should be handled as it goes
- RESTful:
- Method: PUT URL: /api/imageset/info/
Example
>>> # DOCTEST_DISABLE >>> imageset_rowid_list = ibs.get_valid_imgsetids()
ibeis.control.manual_lblannot_funcs module¶
-
ibeis.control.manual_lblannot_funcs.
add_annot_relationship
(ibs, aid_list, lblannot_rowid_list, config_rowid_list=None, alr_confidence_list=None)[source]¶ - Adds a relationship between annots and lblannots
- (annotations and labels of annotations)
-
ibeis.control.manual_lblannot_funcs.
add_lblannots
(ibs, lbltype_rowid_list, value_list, note_list=None, lblannot_uuid_list=None)[source]¶ Adds new lblannots (labels of annotations) creates a new uuid for any new pair(type, value) #TODO: reverse order of rowid_list value_list in input
-
ibeis.control.manual_lblannot_funcs.
delete_annot_relations
(ibs, aid_list)[source]¶ Deletes the relationship between an annotation and a label
-
ibeis.control.manual_lblannot_funcs.
delete_annot_relations_oftype
(ibs, aid_list, _lbltype)[source]¶ Deletes the relationship between an annotation and a label
-
ibeis.control.manual_lblannot_funcs.
delete_lblannots
(ibs, lblannot_rowid_list)[source]¶ deletes lblannots from the database
-
ibeis.control.manual_lblannot_funcs.
get_alr_annot_rowids
(ibs, alrid_list)[source]¶ Parameters: alrid_list (list of rowids) – annot + label relationship rows get the annot_rowid belonging to each relationship
-
ibeis.control.manual_lblannot_funcs.
get_alr_annot_rowids_from_lblannot_rowid
(ibs, lblannot_rowid_list)[source]¶ This is a 1toM getter
Get annotation rowids of labels. There may be more than one annotation per label.
Parameters: lblannot_rowid_list (list) – of lblannot (labels of annotations) rowids Returns: aids_list – of lists annotation rowids Return type: list
-
ibeis.control.manual_lblannot_funcs.
get_alr_confidence
(ibs, alrid_list)[source]¶ Parameters: alrid_list (list of rowids) – annot + label relationship rows Returns: alr_confidence_list – confidence in an annotation relationship Return type: list of rowids
-
ibeis.control.manual_lblannot_funcs.
get_alr_config_rowid
(ibs, alrid_list)[source]¶ Parameters: alrid_list (list of rowids) – annot + label relationship rows Returns: config_rowid_list – config_rowid in an annotation relationship Return type: list
-
ibeis.control.manual_lblannot_funcs.
get_alr_lblannot_rowids
(ibs, alrid_list)[source]¶ Parameters: alrid_list (list of rowids) – annot + label relationship rows Returns: lblannot_rowids_list – label rowids (of annotations) Return type: list of rowids
-
ibeis.control.manual_lblannot_funcs.
get_alrid_from_superkey
(ibs, aid_list, lblannot_rowid_list, config_rowid_list)[source]¶ Parameters: - aid_list (list) – list of annotation row-ids
- lblannot_rowid_list (list) – list of lblannot row-ids
- config_rowid_list (list) – list of config row-ids
Returns: alrid_list – annot-label relationship id list
Return type: list
-
ibeis.control.manual_lblannot_funcs.
get_annot_alrids
(ibs, aid_list, configid=None)[source]¶ FIXME: __name__ Get all the relationship ids belonging to the input annotations if lblannot lbltype is specified the relationship ids are filtered to be only of a specific lbltype/category/type
-
ibeis.control.manual_lblannot_funcs.
get_annot_alrids_oftype
(ibs, aid_list, lbltype_rowid, configid=None)[source]¶ Get all the relationship ids belonging to the input annotations where the relationship ids are filtered to be only of a specific lbltype/category/type
-
ibeis.control.manual_lblannot_funcs.
get_annot_lblannot_rowids
(ibs, aid_list)[source]¶ Returns: list_ – the name id of each annotation. Return type: list
-
ibeis.control.manual_lblannot_funcs.
get_annot_lblannot_rowids_oftype
(ibs, aid_list, _lbltype=None)[source]¶ Returns: list_ – the name id of each annotation. Return type: list
-
ibeis.control.manual_lblannot_funcs.
get_annot_lblannot_value_of_lbltype
(ibs, aid_list, _lbltype, lblannot_value_getter)[source]¶ Returns: lblannot_value_list – a list of strings [‘fred’, ‘sue’, ...] for each chip identifying the animal Return type: list
-
ibeis.control.manual_lblannot_funcs.
get_lblannot_rowid_from_superkey
(ibs, lbltype_rowid_list, value_list)[source]¶ Returns: list_ – lblannot_rowid_list from the superkey (lbltype, value) Return type: list
-
ibeis.control.manual_lblannot_funcs.
get_lblannot_rowid_from_uuid
(ibs, lblannot_uuid_list)[source]¶ UNSAFE
Returns: lblannot_rowid_list from the superkey (lbltype, value)
-
ibeis.control.manual_lblannot_funcs.
get_lblannot_values
(ibs, lblannot_rowid_list, _lbltype=None)[source]¶ Returns: text lblannots
-
ibeis.control.manual_lblannot_funcs.
set_alr_confidence
(ibs, alrid_list, confidence_list)[source]¶ sets annotation-lblannot-relationship confidence
-
ibeis.control.manual_lblannot_funcs.
set_alr_lblannot_rowids
(ibs, alrid_list, lblannot_rowid_list)[source]¶ Associates whatever annotation is at row(alrid) with a new lblannot_rowid. (effectively changes the label value of the rowid)
-
ibeis.control.manual_lblannot_funcs.
set_annot_lblannot_from_rowid
(ibs, aid_list, lblannot_rowid_list, _lbltype)[source]¶ Sets items/lblannot_rowids of a list of annotations.
-
ibeis.control.manual_lblannot_funcs.
set_annot_lblannot_from_value
(ibs, aid_list, value_list, _lbltype, ensure=True)[source]¶ Associates the annot and lblannot of a specific type and value Adds the lblannot if it doesnt exist. Wrapper around convenience function for set_annot_from_lblannot_rowid
ibeis.control.manual_lblimage_funcs module¶
-
ibeis.control.manual_lblimage_funcs.
add_image_relationship_one
(ibs, gid_list, lblimage_rowid_list, config_rowid_list=None, glr_confidence_list=None)[source]¶ Adds a relationship between images and lblimages (imageations and labels of imageations)
-
ibeis.control.manual_lblimage_funcs.
add_lblimages
(ibs, lbltype_rowid_list, value_list, note_list=None, lblimage_uuid_list=None)[source]¶ Adds new lblimages (labels of imageations) creates a new uuid for any new pair(type, value) #TODO: reverse order of rowid_list value_list in input
-
ibeis.control.manual_lblimage_funcs.
get_glr_confidence
(ibs, glrid_list)[source]¶ Returns: list_ – confidence in an image relationship Return type: list
-
ibeis.control.manual_lblimage_funcs.
get_glr_config_rowid
(ibs, glrid_list)[source]¶ Returns: list_ – config_rowid in an image relationship Return type: list
-
ibeis.control.manual_lblimage_funcs.
get_glr_image_rowids
(ibs, glrid_list)[source]¶ get the image_rowid belonging to each relationship
-
ibeis.control.manual_lblimage_funcs.
get_glr_lblimage_rowids
(ibs, glrid_list)[source]¶ get the lblimage_rowid belonging to each relationship
-
ibeis.control.manual_lblimage_funcs.
get_glrid_from_superkey
(ibs, gid_list, lblimage_rowid_list, config_rowid_list)[source]¶ Parameters: - gid_list (list) – list of image row-ids
- lblimage_rowid_list (list) – list of lblimage row-ids
- config_rowid_list (list) – list of config row-ids
Returns: glrid_list – image-label relationship id list
Return type: list
-
ibeis.control.manual_lblimage_funcs.
get_image_glrids
(ibs, gid_list, configid=None)[source]¶ FIXME: __name__ Get all the relationship ids belonging to the input images if lblimage lbltype is specified the relationship ids are filtered to be only of a specific lbltype/category/type
-
ibeis.control.manual_lblimage_funcs.
get_lblimage_rowid_from_superkey
(ibs, lbltype_rowid_list, value_list)[source]¶ Returns: list_ – lblimage_rowid_list from the superkey (lbltype, value) Return type: list
ibeis.control.manual_lbltype_funcs module¶
-
ibeis.control.manual_lbltype_funcs.
add_lbltype
(ibs, text_list, default_list)[source]¶ Adds a label type and its default value Should only be called at the begining of the program.
ibeis.control.manual_meta_funcs module¶
controller functions for contributors, versions, configs, and other metadata
-
ibeis.control.manual_meta_funcs.
add_config
(ibs, cfgsuffix_list, contrib_rowid_list=None)[source]¶ Adds an algorithm / actor configuration as a string
- RESTful:
- Method: POST URL: /api/config/
Parameters: - ibs (IBEISController) – ibeis controller object
- cfgsuffix_list (list) –
- contrib_rowid_list (list) – (default = None)
Returns: config_rowid_list
Return type: list
CommandLine:
python -m ibeis.control.manual_meta_funcs --exec-add_config
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_meta_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='testdb1') >>> cfgsuffix_list = ['_CHIP(sz450)'] >>> contrib_rowid_list = None >>> config_rowid_list = add_config(ibs, cfgsuffix_list, contrib_rowid_list) >>> result = ('config_rowid_list = %s' % (str(config_rowid_list),)) >>> print(result)
-
ibeis.control.manual_meta_funcs.
add_contributors
(ibs, tag_list, uuid_list=None, name_first_list=None, name_last_list=None, loc_city_list=None, loc_state_list=None, loc_country_list=None, loc_zip_list=None, notes_list=None)[source]¶ Adds a list of contributors.
Returns: contrib_id_list – contributor rowids Return type: list - RESTful:
- Method: POST URL: /api/contributor/
-
ibeis.control.manual_meta_funcs.
add_metadata
(ibs, metadata_key_list, metadata_value_list, db)[source]¶ Adds metadata
Returns: metadata_rowid_list – metadata rowids Return type: list - RESTful:
- Method: POST URL: /api/metadata/
-
ibeis.control.manual_meta_funcs.
add_new_temp_contributor
(ibs, user_prompt=False, offset=None, autolocate=False)[source]¶ - RESTful:
- Method: POST URL: /api/contributor/new_temp/
-
ibeis.control.manual_meta_funcs.
add_version
(ibs, versiontext_list)[source]¶ Adds an algorithm / actor configuration as a string
-
ibeis.control.manual_meta_funcs.
delete_configs
(ibs, config_rowid_list)[source]¶ deletes images from the database that belong to fids
- RESTful:
- Method: DELETE URL: /api/config/
-
ibeis.control.manual_meta_funcs.
delete_contributors
(ibs, contrib_rowid_list)[source]¶ deletes contributors from the database and all information associated
- RESTful:
- Method: DELETE URL: /api/contributor/
-
ibeis.control.manual_meta_funcs.
ensure_contributor_rowids
(ibs, user_prompt=False, autolocate=False)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- user_prompt (bool) –
Returns: Return type: list
CommandLine:
python -m ibeis.control.manual_meta_funcs --test-ensure_contributor_rowids
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_meta_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb(db='testdb1') >>> gid_list = ibs.get_valid_gids() >>> ibs.delete_contributors(ibs.get_valid_contrib_rowids()) >>> contrib_rowid_list1 = ibs.get_image_contributor_rowid(gid_list) >>> assert ut.allsame(contrib_rowid_list1) >>> ut.assert_eq(contrib_rowid_list1[0], None) >>> user_prompt = ut.get_argflag('--user-prompt') >>> autolocate = ut.get_argflag('--user-prompt') >>> # execute function >>> result = ensure_contributor_rowids(ibs, user_prompt, autolocate) >>> # verify results >>> ibs.print_contributor_table() >>> print(result) >>> contrib_rowid_list2 = ibs.get_image_contributor_rowid(gid_list) >>> assert ut.allsame(contrib_rowid_list2) >>> ut.assert_eq(contrib_rowid_list2[0], 1)
-
ibeis.control.manual_meta_funcs.
get_all_uncontributed_configs
(ibs)[source]¶ - RESTful:
- Method: GET URL: /api/contributor/all_uncontributed_configs/
-
ibeis.control.manual_meta_funcs.
get_all_uncontributed_images
(ibs)[source]¶ - RESTful:
- Method: GET URL: /api/contributor/all_uncontributed_images/
-
ibeis.control.manual_meta_funcs.
get_config_contributor_rowid
(ibs, config_rowid_list)[source]¶ Returns: cfgsuffix_list – contributor’s rowid for algorithm configs Return type: list - RESTful:
- Method: GET URL: /api/contributor/config_rowid/
-
ibeis.control.manual_meta_funcs.
get_config_rowid_from_suffix
(ibs, cfgsuffix_list)[source]¶ Gets an algorithm configuration as a string
DEPRICATE
- RESTful:
- Method: GET URL: /api/contributor/config_rowid_from_suffix/
Parameters: - ibs (IBEISController) – ibeis controller object
- cfgsuffix_list (list) –
Returns: gid_list
Return type: list
CommandLine:
python -m ibeis.control.manual_meta_funcs --exec-get_config_rowid_from_suffix
-
ibeis.control.manual_meta_funcs.
get_config_suffixes
(ibs, config_rowid_list)[source]¶ Returns: cfgsuffix_list – suffixes for algorithm configs Return type: list - RESTful:
- Method: GET URL: /api/contributor/config_suffixes/
-
ibeis.control.manual_meta_funcs.
get_contributor_city
(ibs, contrib_rowid_list)[source]¶ Returns: contrib_city_list – a contributor’s location - city Return type: list - RESTful:
- Method: GET URL: /api/contributor/city/
-
ibeis.control.manual_meta_funcs.
get_contributor_config_rowids
(ibs, contrib_rowid_list)[source]¶ Returns: config_rowid_list – config rowids for a contributor Return type: list - RESTful:
- Method: GET URL: /api/contributor/config_rowids/
-
ibeis.control.manual_meta_funcs.
get_contributor_country
(ibs, contrib_rowid_list)[source]¶ Returns: contrib_country_list – a contributor’s location - country Return type: list - RESTful:
- Method: GET URL: /api/contributor/country/
-
ibeis.control.manual_meta_funcs.
get_contributor_first_name
(ibs, contrib_rowid_list)[source]¶ Returns: contrib_name_first_list – a contributor’s first name Return type: list - RESTful:
- Method: GET URL: /api/contributor/first_name/
-
ibeis.control.manual_meta_funcs.
get_contributor_gids
(ibs, contrib_rowid_list)[source]¶ TODO: Template 1_M reverse getter
Returns: gid_list – gids for a contributor Return type: list - RESTful:
- Method: GET URL: /api/contributor/gids/
-
ibeis.control.manual_meta_funcs.
get_contributor_imgsetids
(ibs, config_rowid_list)[source]¶ Returns: imgsetid_list – imgsetids for a contributor Return type: list - RESTful:
- Method: GET URL: /api/contributor/imgsetids/
-
ibeis.control.manual_meta_funcs.
get_contributor_last_name
(ibs, contrib_rowid_list)[source]¶ Returns: contrib_name_last_list – a contributor’s last name Return type: list - RESTful:
- Method: GET URL: /api/contributor/last_name/
-
ibeis.control.manual_meta_funcs.
get_contributor_location_string
(ibs, contrib_rowid_list)[source]¶ Returns: contrib_list – a contributor’s location Return type: list - RESTful:
- Method: GET URL: /api/contributor/location_string/
-
ibeis.control.manual_meta_funcs.
get_contributor_name_string
(ibs, contrib_rowid_list, include_tag=False)[source]¶ Returns: contrib_name_list – a contributor’s full name Return type: list - RESTful:
- Method: GET URL: /api/contributor/name_string/
-
ibeis.control.manual_meta_funcs.
get_contributor_note
(ibs, contrib_rowid_list)[source]¶ Returns: contrib_note_list – a contributor’s note Return type: list - RESTful:
- Method: GET URL: /api/contributor/note/
-
ibeis.control.manual_meta_funcs.
get_contributor_rowid_from_tag
(ibs, tag_list)[source]¶ Returns: contrib_rowid_list – a contributor Return type: list - RESTful:
- Method: GET URL: /api/contributor/rowid_from_tag/
-
ibeis.control.manual_meta_funcs.
get_contributor_rowid_from_uuid
(ibs, uuid_list)[source]¶ Returns: contrib_rowid_list – a contributor Return type: list - RESTful:
- Method: GET URL: /api/contributor/rowid_from_uuid/
-
ibeis.control.manual_meta_funcs.
get_contributor_state
(ibs, contrib_rowid_list)[source]¶ Returns: list_ – a contributor’s location - state Return type: list - RESTful:
- Method: GET URL: /api/contributor/state/
-
ibeis.control.manual_meta_funcs.
get_contributor_tag
(ibs, contributor_rowid_list, eager=True, nInput=None)[source]¶ contributor_tag_list <- contributor.contributor_tag[contributor_rowid_list]
gets data from the “native” column “contributor_tag” in the “contributor” table
Parameters: contributor_rowid_list (list) – Returns: contributor_tag_list - a contributor’s tag Return type: list - TemplateInfo:
- Tgetter_table_column col = contributor_tag tbl = contributor
CommandLine:
python -m ibeis.templates.template_generator --key contributor --Tcfg with_api_cache=False with_deleters=False
- RESTful:
- Method: GET URL: /api/contributor/tag/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_meta_funcs import * # NOQA >>> ibs, qreq_ = testdata_ibs() >>> contributor_rowid_list = ibs._get_all_contributor_rowids() >>> eager = True >>> contributor_tag_list = ibs.get_contributor_tag(contributor_rowid_list, eager=eager) >>> assert len(contributor_rowid_list) == len(contributor_tag_list)
-
ibeis.control.manual_meta_funcs.
get_contributor_uuid
(ibs, contrib_rowid_list)[source]¶ Returns: contrib_uuid_list – a contributor’s uuid Return type: list - RESTful:
- Method: GET URL: /api/contributor/uuid/
-
ibeis.control.manual_meta_funcs.
get_contributor_zip
(ibs, contrib_rowid_list)[source]¶ Returns: contrib_zip_list – a contributor’s location - zip Return type: list - RESTful:
- Method: GET URL: /api/contributor/zip/
-
ibeis.control.manual_meta_funcs.
get_database_version
(ibs, db)[source]¶ Gets the specified database version from the controller
- RESTful:
- Method: GET URL: /api/core/dbversion/
-
ibeis.control.manual_meta_funcs.
get_database_version_alias
(ibs, db)[source]¶ Alias: func:get_database_version
- RESTful:
- Method: GET URL: /api/core/version/
-
ibeis.control.manual_meta_funcs.
get_metadata_rowid_from_metadata_key
(ibs, metadata_key_list, db)[source]¶ - RESTful:
- Method: GET URL: /api/metadata/rowid_from_metadata_key/
-
ibeis.control.manual_meta_funcs.
get_metadata_value
(ibs, metadata_key_list, db)[source]¶ - RESTful:
- Method: GET URL: /api/metadata/value/
-
ibeis.control.manual_meta_funcs.
get_valid_configids
(ibs)[source]¶ - RESTful:
- Method: GET URL: /api/config/valid_rowids/
-
ibeis.control.manual_meta_funcs.
get_valid_contrib_rowids
(ibs)[source]¶ Returns: list_ – list of all contributor ids Return type: list Returns: contrib_rowids_list Return type: list CommandLine:
python -m ibeis.control.manual_meta_funcs --test-get_valid_contrib_rowids
- RESTful:
- Method: GET URL: /api/contributor/valid_rowids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_meta_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> contrib_rowids_list = get_valid_contrib_rowids(ibs) >>> result = str(contrib_rowids_list) >>> print(result)
-
ibeis.control.manual_meta_funcs.
set_config_contributor_rowid
(ibs, config_rowid_list, contrib_rowid_list)[source]¶ Sets the config’s contributor rowid
- RESTful:
- Method: PUT URL: /api/config/contributor_rowid/
-
ibeis.control.manual_meta_funcs.
set_config_contributor_unassigned
(ibs, contrib_rowid)[source]¶ - RESTful:
- Method: PUT URL: /api/config/contributor_unassigned/
-
ibeis.control.manual_meta_funcs.
set_database_version
(ibs, db, version)[source]¶ Sets the specified database’s version from the controller
ibeis.control.manual_name_funcs module¶
python -c “import utool as ut; ut.write_modscript_alias(‘Tgen.sh’, ‘ibeis.templates.template_generator’)” # NOQA sh Tgen.sh –key name –invert –Tcfg with_getters=True with_setters=False –modfname manual_name_funcs # NOQA sh Tgen.sh –key name –invert –Tcfg with_getters=True with_setters=True –modfname manual_name_funcs –funcname-filter=sex # NOQA
-
ibeis.control.manual_name_funcs.
add_names
(ibs, name_text_list, name_uuid_list=None, name_note_list=None)[source]¶ Adds a list of names.
Returns: name_rowid_list – their nids Return type: list - RESTful:
- Method: POST URL: /api/name/
-
ibeis.control.manual_name_funcs.
delete_empty_nids
(ibs)[source]¶ Removes names that have no Rois from the database
- RESTful:
- Method: DELETE URL: /api/name/empty_nids/
-
ibeis.control.manual_name_funcs.
delete_names
(ibs, name_rowid_list, safe=True, strict=False, verbose=False)[source]¶ deletes names from the database
CAREFUL. YOU PROBABLY DO NOT WANT TO USE THIS at least ensure that no annot is associated with any of these nids
- RESTful:
- Method: DELETE URL: /api/name/
Example
>>> # UNPORTED_DOCTEST >>> gpath_list = grabdata.get_test_gpaths(ndata=None)[0:4] >>> gid_list = ibs.add_images(gpath_list) >>> bbox_list = [(0, 0, 100, 100)]*len(gid_list) >>> name_list = ['a', 'b', 'a', 'd'] >>> aid_list = ibs.add_annots(gid_list, bbox_list=bbox_list, name_list=name_list) >>> assert len(aid_list) != 0, "No annotations added" >>> nid_list = ibs.get_valid_nids() >>> assert len(nid_list) != 0, "No names added" >>> nid = nid_list[0] >>> assert nid is not None, "nid is None" >>> ibs.delete_names(nid) >>> all_nids = ibs.get_valid_nids() >>> assert nid not in all_nids, "NID not deleted"
-
ibeis.control.manual_name_funcs.
get_empty_nids
(ibs)[source]¶ get name rowids that do not have any annotations (not including UNKONWN)
Returns: nid_list - all names without any animals (does not include unknown names) an nid is not invalid if it has a valid alias Return type: list CommandLine:
python -m ibeis.control.manual_name_funcs --test-get_empty_nids
- RESTful:
- Method: GET URL: /api/name/empty_nids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> new_nid_list = ibs.make_next_nids(num=2) >>> empty_nids = ibs.get_empty_nids() >>> assert len(empty_nids) == 2, 'get_empty_nids fails1' >>> assert new_nid_list == empty_nids, 'get_empty_nids fails2' >>> ibs.delete_empty_nids() >>> empty_nids2 = ibs.get_empty_nids() >>> assert len(empty_nids2) == 0, 'get_empty_nids fails3' >>> result = str(empty_nids2) >>> print(result) []
-
ibeis.control.manual_name_funcs.
get_name_age_months_est_max
(ibs, name_rowid_list)[source]¶ - RESTful:
- Method: GET URL: /api/name/age_months_est_max/
-
ibeis.control.manual_name_funcs.
get_name_age_months_est_min
(ibs, name_rowid_list)[source]¶ - RESTful:
- Method: GET URL: /api/name/age_months_est_min/
-
ibeis.control.manual_name_funcs.
get_name_aids
(ibs, nid_list, enable_unknown_fix=True)[source]¶ # TODO: Rename to get_anot_rowids_from_name_rowid
Returns: aids_list a list of list of aids in each name Return type: list - RESTful:
- Method: GET URL: /api/name/aids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> # Map annotations to name ids >>> aid_list = ibs.get_valid_aids() >>> nid_list = ibs.get_annot_name_rowids(aid_list) >>> # Get annotation ids for each name >>> aids_list = ibs.get_name_aids(nid_list) >>> # Run Assertion Test >>> groupid2_items = ut.group_items(aids_list, nid_list) >>> grouped_items = list(six.itervalues(groupid2_items)) >>> passed_iter = map(ut.allsame, grouped_items) >>> passed_list = list(passed_iter) >>> assert all(passed_list), 'problem in get_name_aids' >>> # Print gropued items >>> print(ut.dict_str(groupid2_items, newlines=False))
- Ignore;
from ibeis.control.manual_name_funcs import * # NOQA import ibeis #ibs = ibeis.opendb(‘testdb1’) #ibs = ibeis.opendb(‘PZ_MTEST’) ibs = ibeis.opendb(‘PZ_Master0’) #ibs = ibeis.opendb(‘GZ_ALL’)
nid_list = ibs.get_valid_nids() nid_list_ = [const.UNKNOWN_NAME_ROWID if nid <= 0 else nid for nid in nid_list]
- with ut.Timer(‘sql’):
- #aids_list1 = ibs.get_name_aids(nid_list, enable_unknown_fix=False) aids_list1 = ibs.db.get(const.ANNOTATION_TABLE, (ANNOT_ROWID,), nid_list_, id_colname=NAME_ROWID, unpack_scalars=False)
- with ut.Timer(‘hackquery + group’):
opstr = ‘’’ SELECT annot_rowid, name_rowid FROM annotations WHERE name_rowid IN
(%s) ORDER BY name_rowid ASC, annot_rowid ASC‘’’ % (‘, ‘.join(map(str, nid_list))) pair_list = ibs.db.connection.execute(opstr).fetchall() aids = np.array(ut.get_list_column(pair_list, 0)) nids = np.array(ut.get_list_column(pair_list, 1)) unique_nids, groupx = vt.group_indices(nids) grouped_aids_ = vt.apply_grouping(aids, groupx) aids_list5 = [sorted(arr.tolist()) for arr in grouped_aids_]
- for aids1, aids5 in zip(aids_list1, aids_list5):
- if (aids1) != (aids5):
- print(aids1) print(aids5) print(‘—–’)
ut.assert_lists_eq(list(map(tuple, aids_list5)), list(map(tuple, aids_list1)))
- with ut.Timer(‘numpy’):
- # alt method valid_aids = np.array(ibs.get_valid_aids()) valid_nids = np.array(ibs.get_annot_name_rowids(valid_aids, distinguish_unknowns=False)) aids_list2 = [valid_aids.take(np.flatnonzero(valid_nids == nid)).tolist() for nid in nid_list_]
- with ut.Timer(‘numpy2’):
- # alt method valid_aids = np.array(ibs.get_valid_aids()) valid_nids = np.array(ibs.get_annot_name_rowids(valid_aids, distinguish_unknowns=False)) aids_list3 = [valid_aids.take(np.flatnonzero(np.equal(valid_nids, nid))).tolist() for nid in nid_list_]
- with ut.Timer(‘numpy3’):
- # alt method valid_aids = np.array(ibs.get_valid_aids()) valid_nids = np.array(ibs.db.get_all_col_rows(const.ANNOTATION_TABLE, NAME_ROWID)) aids_list4 = [valid_aids.take(np.flatnonzero(np.equal(valid_nids, nid))).tolist() for nid in nid_list_]
assert aids_list2 == aids_list3 assert aids_list3 == aids_list4 assert aids_list1 == aids_list2
valid_aids = ibs.get_valid_aids() %timeit ibs.db.get_all_col_rows(‘annotations’, ‘rowid’) %timeit ibs.db.get_all_col_rows(‘annotations’, ‘name_rowid’) %timeit ibs.get_annot_name_rowids(valid_aids, distinguish_unknowns=False) %timeit ibs.get_valid_aids() %timeit ibs.get_annot_name_rowids(ibs.get_valid_aids(), distinguish_unknowns=False) valid_nids1 = ibs.get_annot_name_rowids(valid_aids, distinguish_unknowns=False) valid_nids2 = ibs.db.get_all_col_rows(‘annotations’, ‘name_rowid’) assert valid_nids1 == valid_nids2
ibs.db.fname ibs.db.fpath
import sqlite3
con = sqlite3.connect(ibs.db.fpath)
opstr = ‘’’ SELECT annot_rowid, name_rowid FROM annotations WHERE name_rowid IN
(SELECT name_rowid FROM name) ORDER BY name_rowid ASC, annot_rowid ASC‘’‘
annot_rowid_list = con.execute(opstr).fetchall() aid_list = ut.get_list_column(annot_rowid_list, 0) nid_list = ut.get_list_column(annot_rowid_list, 1)
# HACKY HACKY HACK
- with ut.Timer(‘hackquery + group’):
#nid_list = ibs.get_valid_nids()[10:15] nid_list = ibs.get_valid_nids() opstr = ‘’’ SELECT annot_rowid, name_rowid FROM annotations WHERE name_rowid IN
(%s) ORDER BY name_rowid ASC, annot_rowid ASC‘’’ % (‘, ‘.join(map(str, nid_list))) pair_list = ibs.db.connection.execute(opstr).fetchall() aids = np.array(ut.get_list_column(pair_list, 0)) nids = np.array(ut.get_list_column(pair_list, 1)) unique_nids, groupx = vt.group_indices(nids) grouped_aids_ = vt.apply_grouping(aids, groupx) grouped_aids = [arr.tolist() for arr in grouped_aids_]
- SELECT
- name_rowid, COUNT(annot_rowid) AS number, GROUP_CONCAT(annot_rowid) AS aid_list
FROM annotations WHERE name_rowid in (SELECT name_rowid FROM name)
GROUP BY name_rowidORDER BY name_rowid ASC
import vtool as vt vt vt.aid_list[0]
annot_rowid_list = con.execute(opstr).fetchall() opstr = ‘’‘
SELECT annot_rowid FROM annotations WHERE name_rowid=? ‘’‘cur = ibs.db.connection.cursor()
cur = con.execute(‘BEGIN IMMEDIATE TRANSACTION’) cur = ibs.db.connection res = [cur.execute(opstr, (nid,)).fetchall() for nid in nid_list_] cur.execute(‘COMMIT TRANSACTION’)
res = [ibs.db.cur.execute(opstr, (nid,)).fetchall() for nid in nid_list_]
-
ibeis.control.manual_name_funcs.
get_name_alias_texts
(ibs, name_rowid_list)[source]¶ Returns: list_ – name_alias_text_list Return type: list CommandLine:
python -m ibeis.control.manual_name_funcs --test-get_name_texts
CommandLine:
python -m ibeis.control.manual_name_funcs --test-get_name_alias_texts
- RESTful:
- Method: GET URL: /api/name/alias_texts/
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> name_rowid_list = ibs.get_valid_nids() >>> # execute function >>> name_alias_text_list = get_name_alias_texts(ibs, name_rowid_list) >>> # verify results >>> result = str(name_alias_text_list) >>> print(result) [None, None, None, None, None, None, None]
-
ibeis.control.manual_name_funcs.
get_name_exemplar_aids
(ibs, nid_list)[source]¶ Returns: list_ – a list of list of cids in each name Return type: list CommandLine:
python -m ibeis.control.manual_name_funcs --test-get_name_exemplar_aids
- RESTful:
- Method: GET URL: /api/name/exemplar_aids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> aid_list = ibs.get_valid_aids() >>> nid_list = ibs.get_annot_name_rowids(aid_list) >>> exemplar_aids_list = ibs.get_name_exemplar_aids(nid_list) >>> result = exemplar_aids_list >>> print(result) [[], [2, 3], [2, 3], [], [5, 6], [5, 6], [7], [8], [], [10], [], [12], [13]]
-
ibeis.control.manual_name_funcs.
get_name_gids
(ibs, nid_list)[source]¶ Returns: list_ – the image ids associated with name ids Return type: list - RESTful:
- Method: GET URL: /api/name/gids/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> nid_list = ibs._get_all_known_name_rowids() >>> gids_list = ibs.get_name_gids(nid_list) >>> result = gids_list >>> print(result) [[2, 3], [5, 6], [7], [8], [10], [12], [13]]
-
ibeis.control.manual_name_funcs.
get_name_imgsetids
(ibs, nid_list)[source]¶ - RESTful:
- Method: GET URL: /api/name/imgsetids/
-
ibeis.control.manual_name_funcs.
get_name_notes
(ibs, name_rowid_list)[source]¶ Returns: list_ – notes_list - name notes Return type: list - RESTful:
- Method: GET URL: /api/name/notes/
-
ibeis.control.manual_name_funcs.
get_name_num_annotations
(ibs, nid_list)[source]¶ Returns: list_ – the number of annotations for each name Return type: list CommandLine:
python -m ibeis.control.manual_name_funcs --test-get_name_num_annotations
- RESTful:
- Method: GET URL: /api/name/num_annotations/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> nid_list = ibs._get_all_known_name_rowids() >>> result = get_name_num_annotations(ibs, nid_list) >>> print(result) [2, 2, 1, 1, 1, 1, 1]
-
ibeis.control.manual_name_funcs.
get_name_num_exemplar_annotations
(ibs, nid_list)[source]¶ Returns: list_ – the number of annotations, which are exemplars for each name Return type: list - RESTful:
- Method: GET URL: /api/name/num_exemplar_annotations/
-
ibeis.control.manual_name_funcs.
get_name_rowids_from_text
(ibs, name_text_list, ensure=True)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- name_text_list (list) –
- ensure (bool) – adds as new names if non-existant (default = True)
Returns: name_rowid_list – Creates one if it doesnt exist
Return type: list
CommandLine:
python -m ibeis.control.manual_name_funcs --test-get_name_rowids_from_text:0 python -m ibeis.control.manual_name_funcs --test-get_name_rowids_from_text:1
- TODO:
- should ensure be defaulted to False?
- RESTful:
- Method: GET URL: /api/name/rowids_from_text/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> import utool as ut >>> ibs = ibeis.opendb('testdb1') >>> name_text_list = [u'Fred', u'Sue', '____', u'zebra_grevys', 'TYPO', '____'] >>> ensure = False >>> name_rowid_list = ibs.get_name_rowids_from_text(name_text_list, ensure) >>> print(ut.list_str(list(zip(name_text_list, name_rowid_list)))) >>> ensure = True >>> name_rowid_list = ibs.get_name_rowids_from_text(name_text_list, ensure) >>> print(ut.list_str(list(zip(name_text_list, name_rowid_list)))) >>> ibs.print_name_table() >>> result = str(name_rowid_list) + '\n' >>> typo_rowids = ibs.get_name_rowids_from_text(['TYPO', 'Fred', 'Sue', 'zebra_grevys']) >>> ibs.delete_names(typo_rowids) >>> result += str(ibs._get_all_known_name_rowids()) >>> print('----') >>> ibs.print_name_table() >>> print(result) [8, 9, 0, 10, 11, 0] [1, 2, 3, 4, 5, 6, 7]
-
ibeis.control.manual_name_funcs.
get_name_rowids_from_text_
(ibs, name_text_list, ensure=True)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- name_text_list (list) –
Returns: name_rowid_list
Return type: list
CommandLine:
python -m ibeis.control.manual_name_funcs --test-get_name_rowids_from_text_
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> import utool as ut # NOQA >>> ibs = ibeis.opendb('testdb1') >>> name_text_list = [u'Fred', 'easy', u'Sue', '____', u'zebra_grevys', 'TYPO', 'jeff'] >>> name_rowid_list = ibs.get_name_rowids_from_text_(name_text_list) >>> ibs.print_name_table() >>> result = str(name_rowid_list) >>> print(result) [None, 1, None, 0, None, None, 3]
-
ibeis.control.manual_name_funcs.
get_name_rowids_from_uuid
(ibs, uuid_list, nid_hack=False, ensure=True)[source]¶ Parameters: - ibs (IBEISController) – ibeis controller object
- name_text_list (list) –
Returns: name_rowid_list
Return type: list
-
ibeis.control.manual_name_funcs.
get_name_sex
(ibs, name_rowid_list, eager=True, nInput=None)[source]¶ name_sex_list <- name.name_sex[name_rowid_list]
gets data from the “native” column “name_sex” in the “name” table
Parameters: name_rowid_list (list) – Returns: name_sex_list Return type: list - TemplateInfo:
- Tgetter_table_column col = name_sex tbl = name
- RESTful:
- Method: GET URL: /api/name/sex/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> name_rowid_list = ibs._get_all_name_rowids() >>> eager = True >>> name_sex_list = ibs.get_name_sex(name_rowid_list, eager=eager) >>> assert len(name_rowid_list) == len(name_sex_list)
-
ibeis.control.manual_name_funcs.
get_name_sex_text
(ibs, name_rowid_list, eager=True, nInput=None)[source]¶ - RESTful:
- Method: GET URL: /api/name/sex_text/
-
ibeis.control.manual_name_funcs.
get_name_temp_flag
(ibs, name_rowid_list, eager=True, nInput=None)[source]¶ name_temp_flag_list <- name.name_temp_flag[name_rowid_list]
gets data from the “native” column “name_temp_flag” in the “name” table
Parameters: name_rowid_list (list) – Returns: name_temp_flag_list Return type: list - TemplateInfo:
- Tgetter_table_column col = name_temp_flag tbl = name
CommandLine:
python -m ibeis.control.manual_name_funcs --test-get_name_temp_flag
- RESTful:
- Method: GET URL: /api/name/temp_flag/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> ibs, config2_ = testdata_ibs() >>> name_rowid_list = ibs._get_all_name_rowids() >>> eager = True >>> name_temp_flag_list = ibs.get_name_temp_flag(name_rowid_list, eager=eager) >>> assert len(name_rowid_list) == len(name_temp_flag_list)
-
ibeis.control.manual_name_funcs.
get_name_texts
(ibs, name_rowid_list, apply_fix=True)[source]¶ Returns: list_ – text names Return type: list CommandLine:
python -m ibeis.control.manual_name_funcs --test-get_name_texts
- RESTful:
- Method: GET URL: /api/name/texts/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> name_rowid_list = ibs._get_all_known_name_rowids() >>> name_text_list = get_name_texts(ibs, name_rowid_list) >>> result = str(name_text_list) >>> print(result) [u'easy', u'hard', u'jeff', u'lena', u'occl', u'polar', u'zebra']
-
ibeis.control.manual_name_funcs.
get_name_uuids
(ibs, nid_list)[source]¶ Returns: list_ – uuids_list - name uuids Return type: list - RESTful:
- Method: GET URL: /api/name/uuids/
-
ibeis.control.manual_name_funcs.
get_num_names
(ibs, **kwargs)[source]¶ Number of valid names
CommandLine:
python -m ibeis.control.manual_name_funcs --test-get_num_names
- RESTful:
- Method: GET URL: /api/name/num/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> result = get_num_names(ibs) >>> print(result) 7
-
ibeis.control.manual_name_funcs.
get_valid_nids
(ibs, imgsetid=None, filter_empty=False, min_pername=None)[source]¶ Returns: list_ – all valid names with at least one animal (does not include unknown names) Return type: list - RESTful:
- Method: GET URL: /api/name/
-
ibeis.control.manual_name_funcs.
sanitize_name_texts
(ibs, name_text_list)[source]¶ - RESTful:
- Method: PUT URL: /api/name/sanitize
-
ibeis.control.manual_name_funcs.
set_name_alias_texts
(ibs, name_rowid_list, name_alias_text_list)[source]¶ Returns: list_ – name_alias_text_list Return type: list CommandLine:
python -m ibeis.control.manual_name_funcs --test-get_name_texts
- RESTful:
- Method: PUT URL: /api/name/alias_texts/
-
ibeis.control.manual_name_funcs.
set_name_notes
(ibs, name_rowid_list, notes_list)[source]¶ Sets a note for each name (multiple annotations)
- RESTful:
- Method: PUT URL: /api/name/notes/
-
ibeis.control.manual_name_funcs.
set_name_sex
(ibs, name_rowid_list, name_sex_list, duplicate_behavior=u'error')[source]¶ name_sex_list -> name.name_sex[name_rowid_list]
Parameters: - name_rowid_list –
- name_sex_list –
- TemplateInfo:
- Tsetter_native_column tbl = name col = name_sex
- RESTful:
- Method: PUT URL: /api/name/sex/
-
ibeis.control.manual_name_funcs.
set_name_sex_text
(ibs, name_rowid_list, name_sex_text_list)[source]¶ - RESTful:
- Method: PUT URL: /api/name/sex_text/
-
ibeis.control.manual_name_funcs.
set_name_temp_flag
(ibs, name_rowid_list, name_temp_flag_list, duplicate_behavior='error')[source]¶ name_temp_flag_list -> name.name_temp_flag[name_rowid_list]
Parameters: - name_rowid_list –
- name_temp_flag_list –
- TemplateInfo:
- Tsetter_native_column tbl = name col = name_temp_flag
- RESTful:
- Method: PUT URL: /api/name/temp_flag/
-
ibeis.control.manual_name_funcs.
set_name_texts
(ibs, name_rowid_list, name_text_list, verbose=False)[source]¶ Changes the name text. Does not affect the animals of this name. Effectively just changes the TEXT UUID
CommandLine:
python -m ibeis.control.manual_name_funcs --test-set_name_texts
- RESTful:
- Method: PUT URL: /api/name/texts/
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_name_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> nid_list = ibs.get_valid_nids()[0:2] >>> name_list = ibs.get_name_texts(nid_list) >>> # result = set_name_texts(ibs, nid_list, name_list) >>> print(result)
ibeis.control.manual_species_funcs module¶
python -c “import utool as ut; ut.write_modscript_alias(‘Tgen.sh’, ‘ibeis.templates.template_generator’)” sh Tgen.sh –key species –invert –Tcfg with_getters=True with_setters=False –modfname manual_species_funcs
# TODO: Fix this name it is too special case
-
ibeis.control.manual_species_funcs.
add_species
(ibs, species_nice_list, species_text_list=None, species_code_list=None, species_uuid_list=None, species_note_list=None, skip_cleaning=False)[source]¶ Adds a list of species.
Returns: speciesid_list - species rowids Return type: list - RESTful:
- Method: POST URL: /api/species/
CommandLine:
python -m ibeis.control.manual_species_funcs --test-add_species
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_species_funcs import * # NOQA >>> import ibeis >>> import utool as ut >>> ibs = ibeis.opendb('testdb1') >>> species_text_list = [ ... 'jaguar', 'zebra_plains', 'zebra_plains', '____', 'TYPO', ... '____', 'zebra_grevys', 'bear_polar'] >>> species_rowid_list = ibs.add_species(species_text_list) >>> print(ut.list_str(list(zip(species_text_list, species_rowid_list)))) >>> ibs.print_species_table() >>> species_text = ibs.get_species_texts(species_rowid_list) >>> # Ensure we leave testdb1 in a clean state >>> ibs.delete_species(ibs.get_species_rowids_from_text(['jaguar', 'TYPO'])) >>> all_species_rowids = ibs._get_all_species_rowids() >>> result = ut.list_str(species_text, nl=False) + '\n' >>> result += ut.list_str(all_species_rowids, nl=False) + '\n' >>> result += ut.list_str(ibs.get_species_texts(all_species_rowids), nl=False) >>> print(result) ['jaguar', 'zebra_plains', 'zebra_plains', '____', 'typo', '____', 'zebra_grevys', 'bear_polar'] [1, 2, 3] ['zebra_plains', 'zebra_grevys', 'bear_polar']
[u’jaguar’, u’zebra_plains’, u’zebra_plains’, ‘____’, ‘____’, ‘____’, u’zebra_grevys’, u’bear_polar’] [8, 9, 10] [u’zebra_plains’, u’zebra_grevys’, u’bear_polar’]
-
ibeis.control.manual_species_funcs.
delete_species
(ibs, species_rowid_list)[source]¶ deletes species from the database
CAREFUL. YOU PROBABLY DO NOT WANT TO USE THIS at least ensure that no annot is associated with any of these species rowids
- RESTful:
- Method: DELETE URL: /api/species/
-
ibeis.control.manual_species_funcs.
get_all_species_nice
(ibs)[source]¶ Returns: list_ – all nids of known animals (does not include unknown names) Return type: list
-
ibeis.control.manual_species_funcs.
get_all_species_texts
(ibs)[source]¶ Returns: list_ – all nids of known animals (does not include unknown names) Return type: list
-
ibeis.control.manual_species_funcs.
get_species_codes
(ibs, species_rowid_list)[source]¶ Returns: list_ – code_list - species codes Return type: list - RESTful:
- Method: GET URL: /api/species/codes/
-
ibeis.control.manual_species_funcs.
get_species_enabled
(ibs, species_rowid_list)[source]¶ Returns: list_ – “Species Enabled” flag, true if the species is enabled Return type: list - RESTful:
- Method: GET URL: /api/species/enabled/
-
ibeis.control.manual_species_funcs.
get_species_nice
(ibs, species_rowid_list)[source]¶ Returns: species_text_list nice names Return type: list CommandLine:
python -m ibeis.control.manual_species_funcs --test-get_species_nice --enableall
- RESTful:
- Method: GET URL: /api/species/nice/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_species_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> ibs._clean_species() >>> species_rowid_list = ibs._get_all_species_rowids() >>> result = get_species_nice(ibs, species_rowid_list) >>> print(result) [u'Zebra (Plains)', u"Zebra (Grevy's)", u'Polar Bear']
-
ibeis.control.manual_species_funcs.
get_species_notes
(ibs, species_rowid_list)[source]¶ Returns: list_ – notes_list - species notes Return type: list - RESTful:
- Method: GET URL: /api/species/notes/
-
ibeis.control.manual_species_funcs.
get_species_rowids_from_text
(ibs, species_text_list, ensure=True)[source]¶ Returns: species_rowid_list – Creates one if it doesnt exist Return type: list CommandLine:
python -m ibeis.control.manual_species_funcs --test-get_species_rowids_from_text:0 python -m ibeis.control.manual_species_funcs --test-get_species_rowids_from_text:1
- RESTful:
- Method: GET URL: /api/species/rowids_from_text/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_species_funcs import * # NOQA >>> import ibeis >>> import utool as ut >>> ibs = ibeis.opendb('testdb1') >>> species_text_list = [ ... u'jaguar', u'zebra_plains', u'zebra_plains', '____', 'TYPO', ... '____', u'zebra_grevys', u'bear_polar'] >>> ensure = False >>> species_rowid_list = ibs.get_species_rowids_from_text(species_text_list, ensure) >>> print(ut.list_str(list(zip(species_text_list, species_rowid_list)))) >>> ensure = True >>> species_rowid_list = ibs.get_species_rowids_from_text(species_text_list, ensure) >>> print(ut.list_str(list(zip(species_text_list, species_rowid_list)))) >>> ibs.print_species_table() >>> species_text = ibs.get_species_texts(species_rowid_list) >>> # Ensure we leave testdb1 in a clean state >>> ibs.delete_species(ibs.get_species_rowids_from_text(['jaguar', 'TYPO'])) >>> all_species_rowids = ibs._get_all_species_rowids() >>> result = ut.list_str(species_text, nl=False) + '\n' >>> result += ut.list_str(all_species_rowids, nl=False) + '\n' >>> result += ut.list_str(ibs.get_species_texts(all_species_rowids), nl=False) >>> print(result) ['jaguar', 'zebra_plains', 'zebra_plains', '____', 'typo', '____', 'zebra_grevys', 'bear_polar'] [1, 2, 3] ['zebra_plains', 'zebra_grevys', 'bear_polar']
[u’jaguar’, u’zebra_plains’, u’zebra_plains’, ‘____’, ‘____’, ‘____’, u’zebra_grevys’, u’bear_polar’] [8, 9, 10] [u’zebra_plains’, u’zebra_grevys’, u’bear_polar’]
- Example1:
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_species_funcs import * # NOQA >>> import ibeis >>> import utool as ut # NOQA >>> ibs = ibeis.opendb('testdb1') >>> species_text_list = [ ... u'jaguar', u'zebra_plains', u'zebra_plains', '____', 'TYPO', ... '____', u'zebra_grevys', u'bear_polar'] >>> ensure = False >>> species_rowid_list = ibs.get_species_rowids_from_text(species_text_list, ensure)
-
ibeis.control.manual_species_funcs.
get_species_texts
(ibs, species_rowid_list)[source]¶ Returns: species_text_list text names Return type: list CommandLine:
python -m ibeis.control.manual_species_funcs --test-get_species_texts --enableall
- RESTful:
- Method: GET URL: /api/species/texts/
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_species_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb('testdb1') >>> species_rowid_list = ibs._get_all_species_rowids() >>> result = get_species_texts(ibs, species_rowid_list) >>> print(result) [u'zebra_plains', u'zebra_grevys', u'bear_polar']
-
ibeis.control.manual_species_funcs.
get_species_uuids
(ibs, species_rowid_list)[source]¶ Returns: list_ – uuids_list - species uuids Return type: list - RESTful:
- Method: GET URL: /api/species/uuids/
-
ibeis.control.manual_species_funcs.
sanitize_species_texts
(ibs, species_text_list)[source]¶ changes unknown species to the unknown value
Parameters: - ibs (IBEISController) – ibeis controller object
- species_text_list (list) –
Returns: Return type: list
CommandLine:
python -m ibeis.control.manual_species_funcs --test-sanitize_species_texts
- RESTful:
- Method: POST URL: /api/species/sanitize
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_species_funcs import * # NOQA >>> import ibeis >>> # build test data >>> ibs = ibeis.opendb('testdb1') >>> species_text_list = ['foo', 'bar', 'zebra_plains'] >>> # execute function >>> species_text_list_ = sanitize_species_texts(ibs, species_text_list) >>> # verify results >>> result = ut.list_str(species_text_list_, nl=False) >>> print(result) ['foo', 'bar', 'zebra_plains']
ibeis.control.manual_wildbook_funcs module¶
- CommandLine;
- # Reset IBEIS database (can skip if done) python -m ibeis.tests.reset_testdbs –reset_mtest python -m ibeis –tf reset_mtest
- CommandLine;
# Reset Wildbook database python -m ibeis.control.manual_wildbook_funcs –exec-reset_local_wildbook
# Install Wildbook python -m ibeis.control.manual_wildbook_funcs –exec-install_wildbook
# Startup Wildbook python -m ibeis.control.manual_wildbook_funcs –exec-startup_wildbook_server
# Login to wildbook (can skip) python -m ibeis.control.manual_wildbook_funcs –exec-test_wildbook_login
# Ship ImageSets to wildbook python -m ibeis.control.manual_wildbook_funcs –test-wildbook_signal_imgsetid_list
# Change annotations names to a single name python -m ibeis.control.manual_wildbook_funcs –test-wildbook_signal_annot_name_changes:1
# Change annotations names back to normal python -m ibeis.control.manual_wildbook_funcs –test-wildbook_signal_annot_name_changes:2
-
ibeis.control.manual_wildbook_funcs.
download_tomcat
()[source]¶ Put tomcat into a directory controlled by ibeis
CommandLine:
# Reset python -c "import utool as ut; ut.delete(ut.unixjoin(ut.get_app_resource_dir('ibeis'), 'tomcat'))"
-
ibeis.control.manual_wildbook_funcs.
find_installed_tomcat
(check_unpacked=True, strict=True)[source]¶ Asserts that tomcat was properly installed
Parameters: check_unpacked (bool) – (default = True) Returns: tomcat_dpath Return type: str CommandLine:
python -m ibeis --tmod ibeis.control.manual_wildbook_funcs --exec-find_installed_tomcat python -m ibeis.control.manual_wildbook_funcs --exec-find_installed_tomcat python -m ibeis -tm ibeis.control.manual_wildbook_funcs --exec-find_installed_tomcat python -m ibeis --tf find_installed_tomcat
Example
>>> # ENABLE_DOCTEST >>> from ibeis.control.manual_wildbook_funcs import * # NOQA >>> check_unpacked = True >>> strict = False >>> tomcat_dpath = find_installed_tomcat(check_unpacked, strict) >>> result = ('tomcat_dpath = %s' % (str(tomcat_dpath),)) >>> print(result)
-
ibeis.control.manual_wildbook_funcs.
find_java_jvm
()[source]¶ CommandLine:
python -m ibeis.control.manual_wildbook_funcs --test-find_java_jvm
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_wildbook_funcs import * # NOQA >>> result = find_java_jvm() >>> print(result)
-
ibeis.control.manual_wildbook_funcs.
find_or_download_tomcat
()[source]¶ Returns: tomcat_dpath Return type: str CommandLine:
# Reset python -m ibeis.control.manual_wildbook_funcs --test-reset_local_wildbook python -m ibeis.control.manual_wildbook_funcs --test-find_or_download_tomcat python -m ibeis --tf reset_local_wildbook python -m ibeis --tf find_or_download_tomcat
Example
>>> # SCRIPT >>> from ibeis.control.manual_wildbook_funcs import * # NOQA >>> tomcat_dpath = find_or_download_tomcat() >>> result = ('tomcat_dpath = %s' % (str(tomcat_dpath),)) >>> print(result)
-
ibeis.control.manual_wildbook_funcs.
find_or_download_wilbook_warfile
()[source]¶ - scp jonc@pachy.cs.uic.edu:/var/lib/tomcat/webapps/ibeis.war
- ~/Downloads/pachy_ibeis.war wget
-
ibeis.control.manual_wildbook_funcs.
find_tomcat
(verbose=True)[source]¶ Returns: tomcat_dpath Return type: str CommandLine:
python -m ibeis.control.manual_wildbook_funcs --test-find_tomcat python -m ibeis --tf find_tomcat
Example
>>> # SCRIPT >>> from ibeis.control.manual_wildbook_funcs import * # NOQA >>> tomcat_dpath = find_tomcat() >>> result = ('tomcat_dpath = %s' % (str(tomcat_dpath),)) >>> print(result)
-
ibeis.control.manual_wildbook_funcs.
get_wildbook_info
(ibs, tomcat_dpath=None, wb_target=None)[source]¶
-
ibeis.control.manual_wildbook_funcs.
get_wildbook_tomcat_path
(ibs, tomcat_dpath=None, wb_target=None)[source]¶
-
ibeis.control.manual_wildbook_funcs.
install_wildbook
(verbose=True)[source]¶ Script to setup wildbook on a unix based system (hopefully eventually this will generalize to win32)
CommandLine:
# Reset python -m ibeis --tf reset_local_wildbook # Setup python -m ibeis --tf install_wildbook # Startup python -m ibeis --tf startup_wildbook_server --show --exec-mode # Reset python -m ibeis.control.manual_wildbook_funcs --test-reset_local_wildbook # Setup python -m ibeis.control.manual_wildbook_funcs --test-install_wildbook # Startup python -m ibeis.control.manual_wildbook_funcs --test-startup_wildbook_server --show --exec-mode
Example
>>> # SCRIPT >>> from ibeis.control.manual_wildbook_funcs import * # NOQA >>> verbose = True >>> result = install_wildbook() >>> print(result)
-
ibeis.control.manual_wildbook_funcs.
reset_local_wildbook
()[source]¶ CommandLine:
python -m ibeis.control.manual_wildbook_funcs --test-reset_local_wildbook
Example
>>> # SCRIPT >>> from ibeis.control.manual_wildbook_funcs import * # NOQA >>> reset_local_wildbook()
-
ibeis.control.manual_wildbook_funcs.
shutdown_wildbook_server
(verbose=True)[source]¶ Parameters: verbose (bool) – verbosity flag(default = True) CommandLine:
python -m ibeis.control.manual_wildbook_funcs --exec-shutdown_wildbook_server --exec-mode python -m ibeis --tf shutdown_wildbook_server
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_wildbook_funcs import * # NOQA >>> verbose = True >>> wb_url = shutdown_wildbook_server() >>> ut.quit_if_noshow() >>> ut.get_prefered_browser(PREFERED_BROWSER).open_new_tab(wb_url)
-
ibeis.control.manual_wildbook_funcs.
startup_wildbook_server
(verbose=True)[source]¶ Parameters: verbose (bool) – verbosity flag(default = True) CommandLine:
python -m ibeis.control.manual_wildbook_funcs --test-startup_wildbook_server python -m ibeis --tf startup_wildbook_server --show
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_wildbook_funcs import * # NOQA >>> verbose = True >>> wb_url = startup_wildbook_server() >>> ut.quit_if_noshow() >>> ut.get_prefered_browser(PREFERED_BROWSER).open_new_tab(wb_url)
-
ibeis.control.manual_wildbook_funcs.
submit_wildbook_url
(url, payload=None, browse_on_error=True, dryrun=False, timeout=2)[source]¶ mirroring the one in IBEISController.py, but with changed functionality
-
ibeis.control.manual_wildbook_funcs.
test_wildbook_login
()[source]¶ Helper function to test wildbook login automagically
Returns: (wb_target, tomcat_dpath) Return type: tuple CommandLine:
python -m ibeis.control.manual_wildbook_funcs --exec-test_wildbook_login python -m ibeis --tf test_wildbook_login
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_wildbook_funcs import * # NOQA >>> test_wildbook_login()
-
ibeis.control.manual_wildbook_funcs.
testdata_wildbook_server
()[source]¶ DEPRICATE SeeAlso:
~/local/build_scripts/init_wildbook.sh
-
ibeis.control.manual_wildbook_funcs.
update_wildbook_config
(ibs, wildbook_tomcat_path, dryrun=False)[source]¶
-
ibeis.control.manual_wildbook_funcs.
wildbook_signal_annot_name_changes
(ibs, aid_list=None, tomcat_dpath=None, wb_target=None, dryrun=False)[source]¶ Parameters: - aid_list (int) – list of annotation ids(default = None)
- tomcat_dpath (None) – (default = None)
- wb_target (None) – (default = None)
- dryrun (bool) – (default = False)
CommandLine:
python -m ibeis.control.manual_wildbook_funcs --test-wildbook_signal_annot_name_changes:0 --dryrun python -m ibeis.control.manual_wildbook_funcs --test-wildbook_signal_annot_name_changes:1 --dryrun python -m ibeis.control.manual_wildbook_funcs --test-wildbook_signal_annot_name_changes:1 python -m ibeis.control.manual_wildbook_funcs --test-wildbook_signal_annot_name_changes:2 python -m ibeis --tf wildbook_signal_annot_name_changes:0 --dryrun python -m ibeis --tf wildbook_signal_annot_name_changes:1 --dryrun python -m ibeis --tf wildbook_signal_annot_name_changes:1 python -m ibeis --tf wildbook_signal_annot_name_changes:2
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_wildbook_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='PZ_MTEST') >>> #gid_list = ibs.get_valid_gids()[0:10] >>> gid_list = ibs.get_valid_gids()[3:5] >>> aid_list = ut.flatten(ibs.get_image_aids(gid_list)) >>> # Test case where some names change, some do not. There are no new names. >>> old_nid_list = ibs.get_annot_name_rowids(aid_list) >>> new_nid_list = ut.list_roll(old_nid_list, 1) >>> ibs.set_annot_name_rowids(aid_list, new_nid_list) >>> dryrun = ut.get_argflag('--dryrun') >>> wb_target, tomcat_dpath = testdata_wildbook_server() >>> result = ibs.wildbook_signal_annot_name_changes(aid_list, tomcat_dpath, wb_target, dryrun) >>> ibs.set_annot_name_rowids(aid_list, old_nid_list)
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_wildbook_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='PZ_MTEST') >>> #gid_list = ibs.get_valid_gids()[0:10] >>> gid_list = ibs.get_valid_gids()[3:5] >>> aid_list = ut.flatten(ibs.get_image_aids(gid_list)) >>> # Test case where all names change to one known name >>> #old_nid_list = ibs.get_annot_name_rowids(aid_list) >>> #new_nid_list = [old_nid_list[0]] * len(old_nid_list) >>> old_nid_list = [1, 2] >>> new_nid_list = [1, 1] >>> print('old_nid_list = %r' % (old_nid_list,)) >>> print('new_nid_list = %r' % (new_nid_list,)) >>> ibs.set_annot_name_rowids(aid_list, new_nid_list) >>> dryrun = ut.get_argflag('--dryrun') >>> wb_target, tomcat_dpath = testdata_wildbook_server() >>> result = ibs.wildbook_signal_annot_name_changes(aid_list, tomcat_dpath, wb_target, dryrun) >>> # Undo changes here (not undone in wildbook) >>> #ibs.set_annot_name_rowids(aid_list, old_nid_list)
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_wildbook_funcs import * # NOQA >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='PZ_MTEST') >>> gid_list = ibs.get_valid_gids()[3:5] >>> aid_list = ut.flatten(ibs.get_image_aids(gid_list)) >>> old_nid_list = [1, 2] >>> ibs.set_annot_name_rowids(aid_list, old_nid_list) >>> # Signal what currently exists (should put them back to normal) >>> dryrun = ut.get_argflag('--dryrun') >>> wb_target, tomcat_dpath = testdata_wildbook_server() >>> result = ibs.wildbook_signal_annot_name_changes(aid_list, tomcat_dpath, wb_target, dryrun)
-
ibeis.control.manual_wildbook_funcs.
wildbook_signal_imgsetid_list
(ibs, imgsetid_list=None, set_shipped_flag=True, open_url_on_complete=True, tomcat_dpath=None, wb_target=None, dryrun=False)[source]¶ Exports specified imagesets to wildbook. This is a synchronous call.
Parameters: - imgsetid_list (list) – (default = None)
- set_shipped_flag (bool) – (default = True)
- open_url_on_complete (bool) – (default = True)
- RESTful:
- Method: PUT URL: /api/wildbook/signal_imgsetid_list/
CommandLine:
python -m ibeis.control.manual_wildbook_funcs --test-wildbook_signal_imgsetid_list python -m ibeis.control.manual_wildbook_funcs --test-wildbook_signal_imgsetid_list --dryrun python -m ibeis.control.manual_wildbook_funcs --test-wildbook_signal_imgsetid_list --break
- SeeAlso:
- ~/local/build_scripts/init_wildbook.sh
Example
>>> # DISABLE_DOCTEST >>> from ibeis.control.manual_wildbook_funcs import * # NOQA >>> dryrun = ut.get_argflag('--dryrun') >>> wb_target, tomcat_dpath = testdata_wildbook_server() >>> import ibeis >>> ibs = ibeis.opendb(defaultdb='PZ_MTEST') >>> #gid_list = ibs.get_valid_gids()[0:10] >>> gid_list = ibs.get_valid_gids()[3:5] >>> new_imgsetid = ibs.create_new_imageset_from_images(gid_list) # NOQA >>> print('new imageset uuid = %r' % (ibs.get_imageset_uuid(new_imgsetid),)) >>> print('new imageset text = %r' % (ibs.get_imageset_text(new_imgsetid),)) >>> imgsetid_list = [new_imgsetid] >>> ibs.set_imageset_processed_flags([new_imgsetid], [1]) >>> gid_list = ibs.get_imageset_gids(new_imgsetid) >>> ibs.set_image_reviewed(gid_list, [1] * len(gid_list)) >>> set_shipped_flag = True >>> open_url_on_complete = True >>> result = ibs.wildbook_signal_imgsetid_list(imgsetid_list, set_shipped_flag, open_url_on_complete, tomcat_dpath, wb_target, dryrun) >>> # cleanup >>> #ibs.delete_imagesets(new_imgsetid) >>> print(result)