wbia.web package

Submodules

wbia.web.apis module

Dependencies: flask, tornado

wbia.web.apis.annot_src_api(rowid=None, fresh=False, **kwargs)[source]

Returns the image file of annot <aid>

Example

>>> # WEB_DOCTEST
>>> from wbia.web.app import *  # NOQA
>>> import wbia
>>> web_ibs = wbia.opendb_bg_web('testdb1', start_job_queue=False)
>>> web_ibs.send_wbia_request('/api/annot/src/', type_='get', aid=1)
>>> print(resp)
>>> web_ibs.terminate2()
RESTful:
Method: GET URL: /api/annot/src/<rowid>/
wbia.web.apis.api_test_datasets_id(ibs, dataset, *args, **kwargs)[source]
wbia.web.apis.background_src_api(rowid=None, fresh=False, **kwargs)[source]

Returns the image file of annot <aid>

Example

>>> # WEB_DOCTEST
>>> from wbia.web.app import *  # NOQA
>>> import wbia
>>> web_ibs = wbia.opendb_bg_web('testdb1', start_job_queue=False)
>>> web_ibs.send_wbia_request('/api/annot/src/', type_='get', aid=1)
>>> print(resp)
>>> web_ibs.terminate2()
RESTful:
Method: GET URL: /api/annot/src/<rowid>/
wbia.web.apis.heartbeat(ibs, *args, **kwargs)[source]
wbia.web.apis.hello_world(*args, **kwargs)[source]
CommandLine:
python -m wbia.web.apis –exec-hello_world:0 python -m wbia.web.apis –exec-hello_world:1

Example

>>> # xdoctest: +REQUIRES(--web)
>>> from wbia.web.app import *  # NOQA
>>> import wbia
>>> web_ibs = wbia.opendb_bg_web(browser=True, start_job_queue=False, url_suffix='/api/test/helloworld/?test0=0')  # start_job_queue=False)
>>> print('web_ibs = %r' % (web_ibs,))
>>> print('Server will run until control c')
>>> #web_ibs.terminate2()
Example1:
>>> # xdoctest: +REQUIRES(--web)
>>> from wbia.web.app import *  # NOQA
>>> import wbia
>>> import requests
>>> import wbia
>>> web_ibs = wbia.opendb_bg_web('testdb1', start_job_queue=False)
>>> web_port = ibs.get_web_port_via_scan()
>>> if web_port is None:
>>>     raise ValueError('IA web server is not running on any expected port')
>>> domain = 'http://127.0.0.1:%s' % (web_port, )
>>> url = domain + '/api/test/helloworld/?test0=0'
>>> payload = {
>>>     'test1' : 'test1',
>>>     'test2' : None,  # NOTICE test2 DOES NOT SHOW UP
>>> }
>>> resp = requests.post(url, data=payload)
>>> print(resp)
>>> web_ibs.terminate2()
wbia.web.apis.image_conv_feature_api(rowid=None, model='resnet50', **kwargs)[source]
RESTful:
Method: GET URL: /api/image/feature/json/<uuid>/
wbia.web.apis.image_conv_feature_api_json(uuid=None, model='resnet50', **kwargs)[source]
RESTful:
Method: GET URL: /api/image/feature/json/<uuid>/
wbia.web.apis.image_src_api(rowid=None, thumbnail=False, fresh=False, **kwargs)[source]

Returns the image file of image <gid>

Example

>>> # xdoctest: +REQUIRES(--web)
>>> from wbia.web.app import *  # NOQA
>>> import wbia
>>> web_ibs = wbia.opendb_bg_web('testdb1', start_job_queue=False)
>>> web_ibs.send_wbia_request('/api/image/src/', type_='get', gid=1)
>>> print(resp)
>>> web_ibs.terminate2()
RESTful:
Method: GET URL: /api/image/src/<rowid>/
wbia.web.apis.image_src_api_json(uuid=None, **kwargs)[source]

Returns the image file of image <gid>

Example

>>> # xdoctest: +REQUIRES(--web)
>>> from wbia.web.app import *  # NOQA
>>> import wbia
>>> web_ibs = wbia.opendb_bg_web('testdb1', start_job_queue=False)
>>> web_ibs.send_wbia_request('/api/image/src/', type_='get', gid=1)
>>> print(resp)
>>> web_ibs.terminate2()
RESTful:
Method: GET URL: /api/image/src/<gid>/
wbia.web.apis.image_upload(cleanup=True, **kwargs)[source]

Returns the gid for an uploaded image.

Parameters:
  • image (image binary) – the POST variable containing the binary (multi-form) image data
  • **kwargs – Arbitrary keyword arguments; the kwargs are passed down to the add_images function
Returns:

gid corresponding to the image submitted.

lexigraphical order.

Return type:

gid (rowids)

RESTful:
Method: POST URL: /api/upload/image/
wbia.web.apis.image_upload_zip(**kwargs)[source]

Returns the gid_list for image files submitted in a ZIP archive. The image archive should be flat (no folders will be scanned for images) and must be smaller than 100 MB. The archive can submit multiple images, ideally in JPEG format to save space. Duplicate image uploads will result in the duplicate images receiving the same gid based on the hashed pixel values.

Parameters:
  • image_zip_archive (binary) – the POST variable containing the binary (multi-form) image archive data
  • **kwargs – Arbitrary keyword arguments; the kwargs are passed down to the add_images function
Returns:

the list of gids corresponding to the images

submitted. The gids correspond to the image names sorted in lexigraphical order.

Return type:

gid_list (list if rowids)

RESTful:
Method: POST URL: /api/image/zip
wbia.web.apis.web_embed(*args, **kwargs)[source]

wbia.web.apis_detect module

Dependencies: flask, tornado.

wbia.web.apis_detect.aoi_cnn(ibs, aid_list, testing=False, model_tag='candidacy', **kwargs)[source]
wbia.web.apis_detect.commit_detection_results(ibs, gid_list, results_list, note=None, update_json_log=True)[source]
wbia.web.apis_detect.commit_detection_results_filtered(ibs, gid_list, filter_species_list=None, filter_viewpoint_list=None, note=None, update_json_log=True)[source]
wbia.web.apis_detect.commit_localization_results(ibs, gid_list, results_list, note=None, labeler_algo='pipeline', labeler_model_tag=None, use_labeler_species=False, orienter_algo=None, orienter_model_tag=None, update_json_log=True, **kwargs)[source]
wbia.web.apis_detect.detect_cnn_json(ibs, gid_list, detect_func, config={}, **kwargs)[source]

Run 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:dict of detection results (not annotations)
Return type:results_dict (list)
CommandLine:
python -m wbia.web.apis_detect –test-detect_cnn_yolo_json

Example

>>> # DISABLE_DOCTEST
>>> from wbia.web.apis_detect import *  # NOQA
>>> import wbia
>>> ibs = wbia.opendb('testdb1')
>>> gid_list = ibs.get_valid_gids()[0:2]
>>> results_dict = ibs.detect_cnn_yolo_json(gid_list)
>>> print(results_dict)
wbia.web.apis_detect.detect_cnn_json_wrapper(ibs, image_uuid_list, detect_func, **kwargs)[source]

Detect with CNN (general).

REST:
Method: GET URL: /api/detect/cnn/yolo/json/
Parameters:image_uuid_list (list) – list of image uuids to detect on.
wbia.web.apis_detect.detect_cnn_lightnet(ibs, gid_list, model_tag=None, commit=True, testing=False, **kwargs)[source]

Run 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:
list of lists of annotation ids detected in each
image
Return type:aids_list (list)
CommandLine:
python -m wbia.web.apis_detect –test-detect_cnn_lightnet –show
RESTful:
Method: PUT, GET URL: /api/detect/cnn/lightnet/

Example

>>> # DISABLE_DOCTEST
>>> from wbia.web.apis_detect import *  # NOQA
>>> import wbia
>>> ibs = wbia.opendb('PZ_MTEST')
>>> gid_list = ibs.get_valid_gids()[:5]
>>> aids_list = ibs.detect_cnn_lightnet(gid_list)
>>> if ut.show_was_requested():
>>>     import wbia.plottool as pt
>>>     from wbia.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))
wbia.web.apis_detect.detect_cnn_lightnet_json(ibs, gid_list, config={}, **kwargs)[source]
wbia.web.apis_detect.detect_cnn_lightnet_json_wrapper(ibs, image_uuid_list, **kwargs)[source]
wbia.web.apis_detect.detect_cnn_yolo(ibs, gid_list, model_tag=None, commit=True, testing=False, **kwargs)[source]

Run 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:
list of lists of annotation ids detected in each
image
Return type:aids_list (list)
CommandLine:
python -m wbia.web.apis_detect –test-detect_cnn_yolo –show
RESTful:
Method: PUT, GET URL: /api/detect/cnn/yolo/

Example

>>> # DISABLE_DOCTEST
>>> from wbia.web.apis_detect import *  # NOQA
>>> import wbia
>>> ibs = wbia.opendb('PZ_MTEST')
>>> gid_list = ibs.get_valid_gids()[:5]
>>> aids_list = ibs.detect_cnn_yolo(gid_list)
>>> if ut.show_was_requested():
>>>     import wbia.plottool as pt
>>>     from wbia.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))
wbia.web.apis_detect.detect_cnn_yolo_exists(ibs, gid_list, testing=False)[source]

Check to see if a detection has been completed.

Parameters:gid_list (list) – list of image ids to run detection on
Returns:
list of flags for if the detection has been run on
the image
Return type:flag_list (list)
CommandLine:
python -m wbia.web.apis_detect –test-detect_cnn_yolo_exists
RESTful:
Method: GET URL: /api/detect/cnn/yolo/exists/

Example

>>> # DISABLE_DOCTEST
>>> from wbia.web.apis_detect import *  # NOQA
>>> import wbia
>>> ibs = wbia.opendb('PZ_MTEST')
>>> gid_list = ibs.get_valid_gids()
>>> depc = ibs.depc_image
>>> aids_list = ibs.detect_cnn_yolo(gid_list[:3], testing=True)
>>> result = ibs.detect_cnn_yolo_exists(gid_list[:5])
>>> ibs.delete_annots(ut.flatten(aids_list))
>>> print(result)
[True, True, True, False, False]
wbia.web.apis_detect.detect_cnn_yolo_json(ibs, gid_list, config={}, **kwargs)[source]
wbia.web.apis_detect.detect_cnn_yolo_json_wrapper(ibs, image_uuid_list, **kwargs)[source]
wbia.web.apis_detect.detect_random_forest(ibs, gid_list, species, commit=True, **kwargs)[source]

Run 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:

list of lists of annotation ids detected in each

image

Return type:

aids_list (list)

CommandLine:
python -m wbia.web.apis_detect –test-detect_random_forest –show
RESTful:
Method: PUT, GET URL: /api/detect/randomforest/

Example

>>> # DISABLE_DOCTEST
>>> from wbia.web.apis_detect import *  # NOQA
>>> import wbia
>>> ibs = wbia.opendb('testdb1')
>>> gid_list = ibs.get_valid_gids()[0:2]
>>> species = wbia.const.TEST_SPECIES.ZEB_PLAIN
>>> aids_list = ibs.detect_random_forest(gid_list, species)
>>> # Visualize results
>>> if ut.show_was_requested():
>>>     import wbia.plottool as pt
>>>     from wbia.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))
wbia.web.apis_detect.detect_ws_injury(ibs, gid_list)[source]

Classify if a whale shark is injured.

Parameters:gid_list (list) – list of image ids to run classification on
Returns:
predictions is list of strings representing a possible tag.
confidences is a list of floats of correspoinding cofidence to the prediction
Return type:result_list (dictionary)
wbia.web.apis_detect.detection_lightnet_test(ibs, config={})[source]
wbia.web.apis_detect.detection_yolo_test(ibs, config={})[source]
wbia.web.apis_detect.get_species_with_detectors(ibs)[source]

Get valid species for detection.

RESTful:
Method: GET URL: /api/detect/species/
wbia.web.apis_detect.get_working_species(ibs)[source]

Get working species for detection.

RESTful:
Method: GET URL: /api/detect/species/working/
wbia.web.apis_detect.has_species_detector(ibs, species_text)[source]

TODO: extend to use non-constant species.

RESTful:
Method: GET URL: /api/detect/species/enabled/
wbia.web.apis_detect.labeler_cnn(ibs, aid_list, testing=False, algo='pipeline', model_tag='candidacy', **kwargs)[source]
wbia.web.apis_detect.log_detections(ibs, aid_list, fallback=True)[source]
wbia.web.apis_detect.models_cnn(ibs, config_dict, parse_classes_func, parse_line_func, check_hash=False, hidden_models=[], **kwargs)[source]
wbia.web.apis_detect.models_cnn_lightnet(ibs, **kwargs)[source]

Return the models (and their labels) for the YOLO CNN detector

RESTful:
Method: PUT, GET URL: /api/labels/cnn/lightnet/
wbia.web.apis_detect.models_cnn_yolo(ibs, **kwargs)[source]

Return the models (and their labels) for the YOLO CNN detector

RESTful:
Method: PUT, GET URL: /api/labels/cnn/yolo/
wbia.web.apis_detect.process_detection_html(ibs, **kwargs)[source]

Process the return from the detection review interface. Pass the POST result from the detection review form directly to this function unmodified.

Returns:Same format as func:start_detect_image
Return type:detection results (dict)
RESTful:
Method: POST URL: /api/review/detect/cnn/yolo/
wbia.web.apis_detect.review_detection_html(ibs, image_uuid, result_list, callback_url, callback_method='POST', include_jquery=False, config=None)[source]

Return the detection review interface for a particular image UUID and a list of results for that image.

Parameters:
  • image_uuid (UUID) – the UUID of the image you want to review detections for
  • result_list (list of dict) – list of detection results returned by the detector
  • callback_url (str) – URL that the review form will submit to (action) when the user is complete with their review
  • callback_method (str) – HTTP method the review form will submit to (method). Defaults to ‘POST’
Returns:

json response with the detection web interface in html

Return type:

template (html)

RESTful:
Method: GET URL: /api/review/detect/cnn/yolo/
wbia.web.apis_detect.review_detection_test(image_uuid=None, result_list=None, callback_url=None, callback_method='POST', **kwargs)[source]
wbia.web.apis_detect.wic_cnn(ibs, gid_list, testing=False, algo='cnn', model_tag='candidacy', **kwargs)[source]
wbia.web.apis_detect.wic_cnn_json(ibs, gid_list, config={}, **kwargs)[source]

wbia.web.apis_engine module

wbia.web.apis_engine.ensure_simple_server(port=5832)[source]
CommandLine:
python -m wbia.web.apis_engine –exec-ensure_simple_server python -m utool.util_web –exec-start_simple_webserver

Example

>>> # DISABLE_DOCTEST
>>> from wbia.web.apis_engine import *  # NOQA
>>> result = ensure_simple_server()
>>> print(result)
wbia.web.apis_engine.ensure_uuid_list(list_)[source]
wbia.web.apis_engine.start_detect_image_lightnet(ibs, image_uuid_list, callback_url=None, callback_method=None, **kwargs)[source]
REST:
Method: GET/api/engine/detect/cnn/lightnet/ URL:
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
wbia.web.apis_engine.start_detect_image_test_lightnet(ibs)[source]
wbia.web.apis_engine.start_detect_image_test_yolo(ibs)[source]
wbia.web.apis_engine.start_detect_image_yolo(ibs, image_uuid_list, callback_url=None, callback_method=None, **kwargs)[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
wbia.web.apis_engine.start_flukebook_sync(ibs, **kwargs)[source]
REST:
Method: GET URL: /api/engine/flukebook/sync/
wbia.web.apis_engine.start_identify_annots(ibs, qannot_uuid_list, dannot_uuid_list=None, pipecfg={}, callback_url=None, callback_method=None)[source]
REST:
Method: GET URL: /api/engine/query/annot/rowid/
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 wbia.web.apis_engine –exec-start_identify_annots:0 # Run using server process python -m wbia.web.apis_engine –exec-start_identify_annots:1

# Split into multiple processes python -m wbia.web.apis_engine –main –bg python -m wbia.web.apis_engine –exec-start_identify_annots:1 –fg

python -m wbia.web.apis_engine –exec-start_identify_annots:1 –domain http://52.33.105.88

python -m wbia.web.apis_engine –exec-start_identify_annots:1 –duuids=[] python -m wbia.web.apis_engine –exec-start_identify_annots:1 –domain http://52.33.105.88 –duuids=03a17411-c226-c960-d180-9fafef88c880

Example

>>> # DISABLE_DOCTEST
>>> from wbia.web.apis_engine import *  # NOQA
>>> from wbia.web import apis_engine
>>> import wbia
>>> ibs, qaids, daids = wbia.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

>>> # DISABLE_DOCTEST
>>> from wbia.web.apis_engine import *  # NOQA
>>> import wbia
>>> ibs = wbia.opendb('testdb1')  # , domain='http://52.33.105.88')
>>> aids = ibs.get_valid_aids()[0:2]
>>> qaids = aids[0:1]
>>> daids = aids
>>> query_config_dict = {
>>>     #'pipeline_root' : 'BC_DTW'
>>> }
>>> qreq_ = ibs.new_query_request(qaids, daids, cfgdict=query_config_dict)
>>> cm_list = qreq_.execute()

Example

>>> # xdoctest: +REQUIRES(--web)
>>> from wbia.web.apis_engine import *  # NOQA
>>> import wbia
>>> web_ibs = wbia.opendb_bg_web('testdb1')  # , domain='http://52.33.105.88')
>>> aids = web_ibs.send_wbia_request('/api/annot/', 'get')[0:2]
>>> uuid_list = web_ibs.send_wbia_request('/api/annot/uuid/', type_='get', 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_wbia_request('/api/engine/query/annot/rowid/', **data)
>>> status_response = web_ibs.wait_for_results(jobid, delays=[1, 5, 30])
>>> print('status_response = %s' % (status_response,))
>>> result_response = web_ibs.read_engine_results(jobid)
>>> print('result_response = %s' % (result_response,))
>>> cm_dict = result_response['json_result'][0]
>>> print('Finished test')
>>> web_ibs.terminate2()
>>> bgserver.terminate2()
Ignore:
qaids = daids = ibs.get_valid_aids() jobid = ibs.start_identify_annots(**payload)
wbia.web.apis_engine.start_identify_annots_query(ibs, query_annot_uuid_list=None, query_annot_name_list=None, database_annot_uuid_list=None, database_annot_name_list=None, matching_state_list=[], query_config_dict={}, echo_query_params=True, include_qaid_in_daids=True, callback_url=None, callback_method=None)[source]
REST:
Method: GET URL: /api/engine/query/graph/
Parameters:
  • query_annot_uuid_list (list) – specifies the query annotations to identify.
  • query_annot_name_list (list) – specifies the query annotation names
  • database_annot_uuid_list (list) – specifies the annotations that the algorithm is allowed to use for identification. If not specified all annotations are used. (default=None)
  • database_annot_name_list (list) – specifies the database annotation names (default=None)
  • matching_state_list (list of tuple) – the list of matching state 3-tuples corresponding to the query_annot_uuid_list (default=None)
  • query_config_dict (dict) – dictionary of algorithmic configuration arguments. (default=None)
  • echo_query_params (bool) – flag for if to return the original query parameters with the result
CommandLine:
# Normal mode python -m wbia.web.apis_engine start_identify_annots_query # Split mode wbia –web python -m wbia.web.apis_engine start_identify_annots_query –show –domain=localhost

Example

>>> # DISABLE_DOCTEST
>>> from wbia.web.apis_engine import *  # NOQA
>>> import wbia
>>> #domain = 'localhost'
>>> domain = None
>>> web_ibs = wbia.opendb_bg_web('testdb1', domain=domain)  # , domain='http://52.33.105.88')
>>> aids = web_ibs.send_wbia_request('/api/annot/', 'get')[0:3]
>>> uuid_list = web_ibs.send_wbia_request('/api/annot/uuid/', type_='get', aid_list=aids)
>>> quuid_list = ut.get_argval('--quuids', type_=list, default=uuid_list)[0:1]
>>> duuid_list = ut.get_argval('--duuids', type_=list, default=uuid_list)
>>> query_config_dict = {
>>>    #'pipeline_root' : 'BC_DTW'
>>> }
>>> data = dict(
>>>     query_annot_uuid_list=quuid_list, database_annot_uuid_list=duuid_list,
>>>     query_config_dict=query_config_dict,
>>> )
>>> jobid = web_ibs.send_wbia_request('/api/engine/query/graph/', **data)
>>> print('jobid = %r' % (jobid,))
>>> status_response = web_ibs.wait_for_results(jobid)
>>> result_response = web_ibs.read_engine_results(jobid)
>>> print('result_response = %s' % (ut.repr3(result_response),))
>>> inference_result = result_response['json_result']
>>> if isinstance(inference_result, six.string_types):
>>>    print(inference_result)
>>> cm_dict = inference_result['cm_dict']
>>> quuid = quuid_list[0]
>>> cm = cm_dict[str(quuid)]
>>> web_ibs.terminate2()
wbia.web.apis_engine.start_identify_annots_query_complete(ibs, annot_uuid_list=None, annot_name_list=None, matching_state_list=[], query_config_dict={}, k=5, echo_query_params=True, callback_url=None, callback_method=None)[source]
REST:
Method: GET URL: /api/engine/query/complete/
Parameters:
  • annot_uuid_list (list) – specifies the query annotations to identify.
  • annot_name_list (list) – specifies the query annotation names
  • matching_state_list (list of tuple) – the list of matching state 3-tuples corresponding to the query_annot_uuid_list (default=None)
  • query_config_dict (dict) – dictionary of algorithmic configuration arguments. (default=None)
  • echo_query_params (bool) – flag for if to return the original query parameters with the result
wbia.web.apis_engine.start_labeler_cnn(ibs, annot_uuid_list, callback_url=None, callback_method=None, **kwargs)[source]
wbia.web.apis_engine.start_predict_ws_injury_interim_svm(ibs, annot_uuid_list, callback_url=None, callback_method=None, **kwargs)[source]
REST:
Method: POST URL: /api/engine/classify/whaleshark/injury/
Parameters:
  • annot_uuid_list (list) – list of annot uuids to detect on.
  • callback_url (url) – url that will be called when detection succeeds or fails
CommandLine:
python -m wbia.web.apis_engine start_predict_ws_injury_interim_svm

Example

>>> # DISABLE_DOCTEST
>>> from wbia.web.apis_engine import *  # NOQA
>>> from wbia.web import apis_engine
>>> import wbia
>>> ibs, qaids, daids = wbia.testdata_expanded_aids(
>>>     defaultdb='WS_ALL', a=['default:qsize=2,dsize=10'])
>>> annot_uuid_list = ibs.get_annot_uuids(qaids)
>>> ibs.initialize_job_manager()
>>> jobid = ibs.start_predict_ws_injury_interim_svm(annot_uuid_list)
>>> 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()
wbia.web.apis_engine.start_review_query_chips_best(ibs, annot_uuid, callback_url=None, callback_method=None, **kwargs)[source]
wbia.web.apis_engine.start_web_query_all(ibs)[source]
REST:
Method: GET URL: /api/engine/query/web/
wbia.web.apis_engine.start_wic_image(ibs, image_uuid_list, callback_url=None, callback_method=None, **kwargs)[source]
REST:
Method: GET URL: /api/engine/wic/cnn/
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
wbia.web.apis_engine.web_check_annot_uuids_with_names(annot_uuid_list, name_list)[source]
wbia.web.apis_engine.web_check_uuids(ibs, image_uuid_list=[], qannot_uuid_list=[], dannot_uuid_list=[])[source]
Parameters:
  • ibs (wbia.IBEISController) – image analysis api
  • image_uuid_list (list) – (default = [])
  • qannot_uuid_list (list) – (default = [])
  • dannot_uuid_list (list) – (default = [])
CommandLine:
python -m wbia.web.apis_engine –exec-web_check_uuids –show

Example

>>> # DISABLE_DOCTEST
>>> from wbia.web.apis_engine import *  # NOQA
>>> import wbia
>>> ibs = wbia.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.WebDuplicateUUIDException:
>>>     pass
>>> else:
>>>     raise AssertionError('Should have gotten WebDuplicateUUIDException')
>>> 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')

wbia.web.apis_json module

Dependencies: flask, tornado

class wbia.web.apis_json.ParseError(value)[source]

Bases: object

wbia.web.apis_json.add_annotmatch_json(ibs, match_annot_uuid1_list, match_annot_uuid2_list, match_evidence_decision_list=None, match_meta_decision_list=None, match_confidence_list=None, match_user_list=None, match_tag_list=None, match_modified_list=None, match_count_list=None)[source]
wbia.web.apis_json.add_annots_json(ibs, image_uuid_list, annot_bbox_list, annot_theta_list, annot_viewpoint_list=None, annot_quality_list=None, annot_species_list=None, annot_multiple_list=None, annot_interest_list=None, annot_name_list=None, **kwargs)[source]
REST:
Method: POST URL: /api/annot/json/
Ignore:
sudo pip install boto
Parameters:
  • image_uuid_list (list of str) – list of image UUIDs to be used in IBEIS IA
  • annot_bbox_list (list of 4-tuple) – list of bounding box coordinates encoded as a 4-tuple of the values (xtl, ytl, width, height) where xtl is the ‘top left corner, x value’ and ytl is the ‘top left corner, y value’.
  • annot_theta_list (list of float) – list of radian rotation around center. Defaults to 0.0 (no rotation).
  • annot_species_list (list of str) – list of species for the annotation, if known. If the list is partially known, use None (null in JSON) for unknown entries.
  • annot_name_list (list of str) – list of names for the annotation, if known. If the list is partially known, use None (null in JSON) for unknown entries.
  • **kwargs – key-value pairs passed to the ibs.add_annots() function.
CommandLine:
python -m wbia.web.app –test-add_annots_json

Example

>>> # DISABLE_DOCTEST
>>> import wbia
>>> from wbia.control.IBEISControl import *  # NOQA
>>> web_instance = wbia.opendb(db='testdb1')
>>> _payload = {
>>>     'image_uuid_list': [
>>>         uuid.UUID('7fea8101-7dec-44e3-bf5d-b8287fd231e2'),
>>>         uuid.UUID('c081119a-e08e-4863-a710-3210171d27d6'),
>>>     ],
>>>     'annot_uuid_list': [
>>>         uuid.UUID('fe1547c5-1425-4757-9b8f-b2b4a47f552d'),
>>>         uuid.UUID('86d3959f-7167-4822-b99f-42d453a50745'),
>>>     ],
>>>     'annot_bbox_list': [
>>>         [0, 0, 1992, 1328],
>>>         [0, 0, 1194, 401],
>>>     ],
>>> }
>>> aid_list = wbia.web.app.add_annots_json(web_instance, **_payload)
>>> print(aid_list)
>>> print(web_instance.get_annot_image_uuids(aid_list))
>>> print(web_instance.get_annot_uuids(aid_list))
>>> print(web_instance.get_annot_bboxes(aid_list))
wbia.web.apis_json.add_images_json(ibs, image_uri_list, image_unixtime_list=None, image_gps_lat_list=None, image_gps_lon_list=None, **kwargs)[source]
REST:
Method: POST URL: /api/image/json/
Ignore:
sudo pip install boto
Parameters:
  • image_uri_list (list) –

    list of string image uris, most likely HTTP(S) or S3 encoded URLs. Alternatively, this can be a list of dictionaries (JSON objects) that specify AWS S3 stored assets. An example below:

    image_uri_list = [
    http://domain.com/example/asset1.png’, ‘/home/example/Desktop/example/asset2.jpg’, ‘s3://s3.amazon.com/example-bucket-2/asset1-in-bucket-2.tif’, {
    ’bucket’ : ‘example-bucket-1’, ‘key’ : ‘example/asset1.png’, ‘auth_domain’ : None, # Uses 127.0.0.1 ‘auth_access_id’ : None, # Uses system default ‘auth_secret_key’ : None, # Uses system default

    }, {

    ’bucket’ : ‘example-bucket-1’, ‘key’ : ‘example/asset2.jpg’, # if unspecified, auth uses 127.0.0.1 and system defaults

    }, {

    ’bucket’ : ‘example-bucket-2’, ‘key’ : ‘example/asset1-in-bucket-2.tif’, ‘auth_domain’ : ‘s3.amazon.com’, ‘auth_access_id’ : ‘____________________’, ‘auth_secret_key’ : ‘________________________________________’,

    },

    ]

    Note that you cannot specify AWS authentication access ids or secret keys using string uri’s. For specific authentication methods, please use the latter list of dictionaries.

  • image_time_posix_list (list of int) – list of image’s POSIX timestamps
  • image_gps_lat_list (list of float) – list of image’s GPS latitude values
  • image_gps_lon_list (list of float) – list of image’s GPS longitude values
  • **kwargs – key-value pairs passed to the ibs.add_images() function.
CommandLine:

python -m wbia.web.apis_json –test-add_images_json

,”bucket”:”flukebook-prod-asset-store”,”key”:”“

Example

>>> # xdoctest: +REQUIRES(--web)
>>> from wbia.control.IBEISControl import *  # NOQA
>>> import wbia
>>> import uuid
>>> web_instance = wbia.opendb(db='testdb1')
>>> _payload = {
>>>     'image_uri_list': [
>>>         'https://upload.wikimedia.org/wikipedia/commons/4/49/Zebra_running_Ngorongoro.jpg',
>>>         {
>>>             'bucket'          : 'test-asset-store',
>>>             'key'             : 'caribwhale/20130903-JAC-0002.JPG',
>>>         },
>>>         {
>>>             'bucket'          : 'flukebook-prod-asset-store',
>>>             'key'             : '3/a/3a76b0e8-1c64-403d-ace1-679cf2f081c0/f2.jpg',
>>>         },
>>>     ],
>>>     'image_uuid_list': [
>>>         uuid.uuid4(),
>>>         uuid.uuid4(),
>>>         uuid.uuid4(),
>>>     ],
>>>     'image_width_list': [
>>>         1992,
>>>         1194,
>>>         500,
>>>     ],
>>>     'image_height_list': [
>>>         1328,
>>>         401,
>>>         500,
>>>     ],
>>> }
>>> gid_list = wbia.web.apis_json.add_images_json(web_instance, **_payload)
>>> print(gid_list)
>>> print(web_instance.get_image_uuids(gid_list))
>>> print(web_instance.get_image_uris(gid_list))
>>> print(web_instance.get_image_paths(gid_list))
>>> print(web_instance.get_image_uris_original(gid_list))
wbia.web.apis_json.add_imagesets_json(ibs, imageset_text_list, imageset_uuid_list=None, config_rowid_list=None, imageset_notes_list=None, imageset_occurence_flag_list=None)[source]

Adds a list of imagesets.

Parameters:
  • imagesettext_list (list) –
  • imageset_uuid_list (list) –
  • config_rowid_list (list) –
  • notes_list (list) –
Returns:

added imageset uuids

Return type:

imageset_uuid_list (list)

RESTful:
Method: POST URL: /api/imageset/json/
wbia.web.apis_json.add_names_json(ibs, name_text_list, name_uuid_list=None, name_note_list=None)[source]
wbia.web.apis_json.add_parts_json(ibs, annot_uuid_list, part_bbox_list, part_theta_list, **kwargs)[source]
REST:
Method: POST URL: /api/part/json/
Ignore:
sudo pip install boto
Parameters:
  • annot_uuid_list (list of str) – list of annot UUIDs to be used in IBEIS IA
  • part_uuid_list (list of str) – list of annotations UUIDs to be used in IBEIS IA
  • part_bbox_list (list of 4-tuple) – list of bounding box coordinates encoded as a 4-tuple of the values (xtl, ytl, width, height) where xtl is the ‘top left corner, x value’ and ytl is the ‘top left corner, y value’.
  • part_theta_list (list of float) – list of radian rotation around center. Defaults to 0.0 (no rotation).
  • **kwargs – key-value pairs passed to the ibs.add_annots() function.
wbia.web.apis_json.add_review_json(ibs, review_annot_uuid1_list, review_annot_uuid2_list, review_evidence_decision_list, review_meta_decision_list=None, review_uuid_list=None, review_user_list=None, review_user_confidence_list=None, review_tags_list=None, review_client_start_time_posix=None, review_client_end_time_posix=None, review_server_start_time_posix=None, review_server_end_time_posix=None)[source]
wbia.web.apis_json.add_species_json(ibs, species_nice_list, species_text_list=None, species_code_list=None, species_uuid_list=None, species_note_list=None, skip_cleaning=False)[source]
wbia.web.apis_json.annotation_src_api_json(ibs, uuid=None)[source]
wbia.web.apis_json.chaos_imageset(ibs)[source]
REST:
Method: POST URL: /api/image/json/
Parameters:image_uuid_list (list of str) – list of image UUIDs to be delete from IBEIS
wbia.web.apis_json.delete_annots_json(ibs, annot_uuid_list)[source]
REST:
Method: DELETE URL: /api/annot/json/
Parameters:annot_uuid_list (list of str) – list of annot UUIDs to be delete from IBEIS
wbia.web.apis_json.delete_images_json(ibs, image_uuid_list)[source]
REST:
Method: DELETE URL: /api/image/json/
Parameters:image_uuid_list (list of str) – list of image UUIDs to be delete from IBEIS
wbia.web.apis_json.delete_imageset_json(ibs, imageset_uuid_list)[source]
REST:
Method: DELETE URL: /api/imageset/json/
Parameters:imageset_uuid_list (list of str) – list of imageset UUIDs to be delete from IBEIS
wbia.web.apis_json.delete_name_json(ibs, name_uuid_list)[source]
REST:
Method: DELETE URL: /api/name/json/
Parameters:name_uuid_list (list of str) – list of name UUIDs to be delete from IBEIS
wbia.web.apis_json.delete_species_json(ibs, species_uuid_list)[source]
REST:
Method: DELETE URL: /api/species/json/
Parameters:species_uuid_list (list of str) – list of species UUIDs to be delete from IBEIS
wbia.web.apis_json.get_annot_age_months_est_json(ibs, annot_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_annot_age_months_est_max_json(ibs, annot_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_annot_age_months_est_max_texts_json(ibs, annot_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_annot_age_months_est_min_json(ibs, annot_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_annot_age_months_est_min_texts_json(ibs, annot_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_annot_age_months_est_texts_json(ibs, annot_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_annot_aids_from_uuid_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_bboxes_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_detect_confidence_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_exemplar_flags_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_gids_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_hashid_uuid_json(ibs, annot_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_annot_image_contributor_tag_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_image_gps_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_image_names_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_image_paths_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_image_set_texts_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_image_unixtimes_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_image_uuids_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_imgset_uuids_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_imgsetids_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_interest_json(ibs, annot_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_annot_multiple_json(ibs, annot_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_annot_name_rowids_json(ibs, annot_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_annot_name_texts_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_nids_json(ibs, annot_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_annot_notes_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_num_verts_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_qualities_json(ibs, annot_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_annot_quality_texts_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_reviewed_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_rotated_verts_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_sex_json(ibs, annot_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_annot_sex_texts_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_species_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_species_rowids_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_species_texts_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_species_uuids_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_thetas_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_verts_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_viewpoint_texts_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_viewpoints_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_yaw_texts_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_annot_yaws_json(ibs, annot_uuid_list)[source]
wbia.web.apis_json.get_contributor_rowids_from_uuid_json(ibs, contributor_uuid_list)[source]
wbia.web.apis_json.get_image_aids_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_aids_of_species_json(ibs, image_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_image_annot_uuids_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_annot_uuids_of_species_json(ibs, image_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_image_detect_confidence_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_gids_from_uuid_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_gnames_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_gps_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_hash_json(ibs, image_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_image_heights_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_imagesettext_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_imgset_uuids_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_imgsetids_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_lat_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_location_codes_json(ibs, image_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_image_lon_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_name_uuids_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_nids_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_notes_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_num_annotations_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_orientation_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_orientation_str_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_paths_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_reviewed_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_sizes_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_species_rowids_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_species_uuids_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_timedelta_posix_json(ibs, image_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_image_unixtimes_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_uris_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_uris_original_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_image_uuids_with_annot_uuids(ibs, gid_list=None)[source]
wbia.web.apis_json.get_image_widths_json(ibs, image_uuid_list)[source]
wbia.web.apis_json.get_imageset_aids_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_annot_uuids_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_duration_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_end_time_posix_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_gids_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_gps_lats_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_gps_lons_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_image_uuids_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_imgsetids_from_text_json(ibs, imageset_text_list, **kwargs)[source]
wbia.web.apis_json.get_imageset_imgsetids_from_uuid_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_name_uuids_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_nids_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_note_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_num_aids_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_num_annots_reviewed_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_num_gids_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_num_imgs_reviewed_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_num_names_with_exemplar_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_occurrence_flags_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_processed_flags_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_shipped_flags_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_smart_waypoint_ids_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_smart_xml_contents_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_smart_xml_fnames_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_start_time_posix_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_imageset_text_json(ibs, imageset_uuid_list)[source]
wbia.web.apis_json.get_name_age_months_est_max_json(ibs, name_uuid_list)[source]
wbia.web.apis_json.get_name_age_months_est_min_json(ibs, name_uuid_list)[source]
wbia.web.apis_json.get_name_aids_json(ibs, name_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_name_alias_texts_json(ibs, name_uuid_list)[source]
wbia.web.apis_json.get_name_annot_uuids_json(ibs, name_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_name_exemplar_aids_json(ibs, name_uuid_list)[source]
wbia.web.apis_json.get_name_exemplar_name_uuids_json(ibs, name_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_name_gids_json(ibs, name_uuid_list)[source]
wbia.web.apis_json.get_name_image_uuids_json(ibs, name_uuid_list)[source]
wbia.web.apis_json.get_name_imgset_uuids_json(ibs, name_uuid_list)[source]
wbia.web.apis_json.get_name_imgsetids_json(ibs, name_uuid_list)[source]
wbia.web.apis_json.get_name_nids_with_gids_json(ibs, nid_list=None)[source]
wbia.web.apis_json.get_name_notes_json(ibs, name_uuid_list)[source]
wbia.web.apis_json.get_name_num_annotations_json(ibs, name_uuid_list)[source]
wbia.web.apis_json.get_name_num_exemplar_annotations_json(ibs, name_uuid_list)[source]
wbia.web.apis_json.get_name_rowids_from_text_json(ibs, name_text_list, **kwargs)[source]
wbia.web.apis_json.get_name_rowids_from_uuid_json(ibs, name_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_name_sex_json(ibs, name_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_name_sex_text_json(ibs, name_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_name_temp_flag_json(ibs, name_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_name_texts_json(ibs, name_uuid_list, **kwargs)[source]
wbia.web.apis_json.get_species_codes_json(ibs, species_uuid_list)[source]
wbia.web.apis_json.get_species_nice_json(ibs, species_uuid_list)[source]
wbia.web.apis_json.get_species_notes_json(ibs, species_uuid_list)[source]
wbia.web.apis_json.get_species_rowids_from_text_json(ibs, species_text_list, **kwargs)[source]
wbia.web.apis_json.get_species_rowids_from_uuids_json(ibs, species_uuid_list)[source]
wbia.web.apis_json.get_species_texts_json(ibs, species_uuid_list)[source]
wbia.web.apis_json.get_valid_annot_uuids_json(ibs, **kwargs)[source]
wbia.web.apis_json.get_valid_image_uuids_json(ibs, **kwargs)[source]
wbia.web.apis_json.get_valid_imageset_uuids_json(ibs, **kwargs)[source]
wbia.web.apis_json.get_valid_name_uuids_json(ibs, **kwargs)[source]
wbia.web.apis_json.get_valid_part_uuids_json(ibs, **kwargs)[source]
wbia.web.apis_json.image_base64_api_json(ibs, uuid=None, thumbnail=False, fresh=False, **kwargs)[source]
wbia.web.apis_json.labeler_cnn_json_wrapper(ibs, annot_uuid_list, **kwargs)[source]
wbia.web.apis_json.set_annot_bboxes_json(ibs, annot_uuid_list, bbox_list, **kwargs)[source]
wbia.web.apis_json.set_annot_interest_json(ibs, annot_uuid_list, flag_list, **kwargs)[source]
wbia.web.apis_json.set_annot_multiple_json(ibs, annot_uuid_list, flag_list, **kwargs)[source]
wbia.web.apis_json.set_annot_name_texts_json(ibs, annot_uuid_list, name_text_list, **kwargs)[source]
wbia.web.apis_json.set_annot_note_json(ibs, annot_uuid_list, annot_note_list, **kwargs)[source]
wbia.web.apis_json.set_annot_quality_texts_json(ibs, annot_uuid_list, quality_text_list, **kwargs)[source]
wbia.web.apis_json.set_annot_species_json(ibs, annot_uuid_list, species_text_list, **kwargs)[source]
wbia.web.apis_json.set_annot_tag_text_json(ibs, annot_uuid_list, annot_tags_list, **kwargs)[source]
wbia.web.apis_json.set_annot_thetas_json(ibs, annot_uuid_list, theta_list, **kwargs)[source]
wbia.web.apis_json.set_annot_viewpoints_json(ibs, annot_uuid_list, viewpoint_list, **kwargs)[source]
wbia.web.apis_json.set_annotmatch_confidence_json(ibs, match_annot_uuid1_list, match_annot_uuid2_list, match_confidence_list, **kwargs)[source]
wbia.web.apis_json.set_annotmatch_count_json(ibs, match_annot_uuid1_list, match_annot_uuid2_list, match_count_list, **kwargs)[source]
wbia.web.apis_json.set_annotmatch_evidence_decision_json(ibs, match_annot_uuid1_list, match_annot_uuid2_list, match_decision_list, **kwargs)[source]
wbia.web.apis_json.set_annotmatch_meat_decision_json(ibs, match_annot_uuid1_list, match_annot_uuid2_list, match_decision_list, **kwargs)[source]
wbia.web.apis_json.set_annotmatch_posixtime_modified_json(ibs, match_annot_uuid1_list, match_annot_uuid2_list, match_modified_list, **kwargs)[source]
wbia.web.apis_json.set_annotmatch_reviewer_json(ibs, match_annot_uuid1_list, match_annot_uuid2_list, match_user_list, **kwargs)[source]
wbia.web.apis_json.set_annotmatch_tag_text_json(ibs, match_annot_uuid1_list, match_annot_uuid2_list, match_tags_list, **kwargs)[source]
wbia.web.apis_json.set_exemplars_from_quality_and_viewpoint_json(ibs, annot_uuid_list, annot_name_list, **kwargs)[source]
wbia.web.apis_json.set_image_imagesettext_json(ibs, image_uuid_list, imageset_text_list)[source]
wbia.web.apis_json.set_image_imgset_uuids_json(ibs, image_uuid_list, imageset_uuid_list)[source]
wbia.web.apis_json.set_image_imgsetids_json(ibs, image_uuid_list, imageset_rowid_list)[source]
wbia.web.apis_json.set_name_notes_json(ibs, name_uuid_list, name_note_list, **kwargs)[source]
wbia.web.apis_json.set_name_texts_json(ibs, name_uuid_list, name_text_list, **kwargs)[source]
wbia.web.apis_json.set_part_bboxes_json(ibs, part_uuid_list, bbox_list, **kwargs)[source]
wbia.web.apis_json.set_part_quality_texts_json(ibs, part_uuid_list, quality_text_list, **kwargs)[source]
wbia.web.apis_json.set_part_thetas_json(ibs, part_uuid_list, theta_list, **kwargs)[source]
wbia.web.apis_json.set_part_types_json(ibs, part_uuid_list, type_text_list, **kwargs)[source]
wbia.web.apis_json.set_part_viewpoints_json(ibs, part_uuid_list, viewpoint_list, **kwargs)[source]

wbia.web.apis_microsoft module

Dependencies: flask, tornado.

wbia.web.apis_microsoft.microsoft_annotation_add(ibs, image, bbox, theta=None, species=None, viewpoint=None, name=None, *args, **kwargs)[source]

Add an Annotation to the system and return the UUID — parameters: - name: image

in: body description: A Image model for which the annotation will be added as a child required: true schema:

$ref: “#/definitions/Image”
  • name: bbox in: formData description: a 4-tuple of coordinates that defines a rectangle in the format (x-axis top left corner, y-axis top left corner, width, height) in pixels. These values are expected to be bounded by the size of the parent image. required: true type: array items:

    type: number format: float

  • name: theta in: formData description: a rotation around the center of the annotation, in radians. Default is 0.0 required: false type: number

  • name: species in: formData description: a user-defined string to specify the species of the annotation (e.g. ‘zebra’ or ‘massai_giraffe’). This value is used to filter matches and run-time models for ID. Default is None. required: false type: string

  • name: viewpoint in: formData description: a user-defined string to specify the viewpoint of the annotation (e.g. ‘right’ or ‘front_left’). This value is used to filter matches and run-time models for ID. Default is None. required: false type: string

  • name: name in: body description: a Name model to assign to the created Annotation required: false schema:

    $ref: “#/definitions/Name”

consumes: - multipart/form-data produces: - application/json responses:

200:

description: Returns an Annotations model with a UUID schema:

$ref: “#/definitions/Annotation”
400:
description: Invalid input parameter
wbia.web.apis_microsoft.microsoft_annotation_delete(ibs, annotation)[source]

Delete an Annotation model from the database. — parameters: - name: annotation

in: body description: A Annotation model to delete required: true schema:

$ref: “#/definitions/Annotation”

produces: - application/json responses:

200:

description: Returns a success status flag (True if deleted) schema:

type: boolean
400:
description: Invalid input parameter
wbia.web.apis_microsoft.microsoft_annotation_metadata(ibs, annotation, *args, **kwargs)[source]

Get the Annotation’s metadata (bbox, theta, species, viewpoint).

We provide no setters for Annotations. If you wish to modify the metadata on an Annotation model, please delete it and add it again. Modifying the metadata on an annotation may alter its derived UUID — parameters: - name: annotation

in: body description: A Annotation model required: true schema:

$ref: “#/definitions/Image”

produces: - application/json responses:

200:

description: Returns a JSON object with the metadata for the annotation schema:

type: object
400:
description: Invalid input parameter
wbia.web.apis_microsoft.microsoft_core_specification_swagger(*args, **kwargs)[source]

Returns the API specification in the Swagger 2.0 (OpenAPI) JSON format.

The Swagger API specification (https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md) provides a standardized method to export REST API documentation and examples. Our documentation is built on-demand with the help of the Python package flask-swagger (https://github.com/gangverk/flask-swagger).

The API specification includes GET, POST, PUT, and DELETE methods and Model definitions. — definitions: - schema:

id: Image description: An Image is a semantic construct that represents an uploaded image. Images can be uploaded for later processing or be used immediately for detection. Object detection will create Annotation models, which have a required Image parent. An Image can have multiple detections (i.e. Annotation models). required:

  • uuid
properties:
uuid:
description: a deterministically-derived UUID based on the image pixels, which can be used to identify duplicate Images. type: string format: uuid
  • schema:

    id: Annotation description: An Annotation is a semantic construct that represents a committed detection, with a bounding box and species classification assigned as stored attributes. An Annotation is required to have a parent Image. All bounding box coordinates are relative to the size of the parent Image that was uploaded. required:

    • uuid
    • bbox
    properties:
    uuid:

    description: a deterministically-derived UUID based on the parent image’s UUID and the bounding box coordinate (xtl, ytl, width, height) and orientation (theta), which can be used to identify duplicate Annotations. type: string format: uuid

    bbox:

    description: a 4-tuple of coordinates that defines a rectangle in the format (x-axis top left corner, y-axis top left corner, width, height) in pixels. These values are expected to be bounded by the size of the parent image. type: array

    theta:

    description: a rotation around the center of the annotation, in radians type: number

    species:

    description: a user-defined string to specify the species of the annotation (e.g. ‘zebra’ or ‘massai_giraffe’). This value is used to filter matches and run-time models for ID. type: string

    viewpoint:

    description: a user-defined string to specify the viewpoint of the annotation (e.g. ‘right’ or ‘front_left’). This value is used to filter matches and run-time models for ID. type: string

    name:

    description: the name of the individual format: uuid type: string

  • schema:

    id: Detection description: A Detection is a semantic constrict that represents an un-committed detection. A Detection can be committed to an Annotation to be stored permanently on the parent Image. required:

    • _image
    • score
    • bbox
    • xtl
    • ytl
    • xbr
    • ybr
    • width
    • height
    • theta
    • label
    properties:
    image:

    description: The Image that this Detection was found in $ref: “#/definitions/Image”

    score:

    description: The detection’s classification score type: integer format: int32

    bbox:

    description: The bounding box for this annotation, represented in the format (xtl, ytl, width, height) type: array items:

    type: number format: float

    xtl:

    description: The pixel coordinate for the top-left corner along the x-axis (xtl = x-axis top left) for the bounding box type: integer format: int32

    ytl:

    description: The pixel coordinate for the top-left corner along the y-axis (ytl = y-axis top left) for the bounding box type: integer format: int32

    xbr:

    description: The pixel coordinate for the bottom-right corner along the x-axis (ytl = x-axis bottom right) for the bounding box type: integer format: int32

    ybr:

    description: The pixel coordinate for the bottom-right corner along the y-axis (ytl = y-axis bottom right) for the bounding box type: integer format: int32

    width:

    description: The pixel width for the bounding box type: integer format: int32

    height:

    description: The pixel height for the bounding box type: integer format: int32

    theta:

    description: The rotation of the bounding box around its center, represented in radians type: number format: float

    species:

    description: The semantic species classification (class label) of the bounding box type: string

    viewpoint:

    description: The semantic viewpoint classification (class label) of the bounding box type: string

  • schema:

    id: Name description: A Name is the identification label for a group of Annotations required:

    • uuid
    • alias
    properties:
    uuid:

    description: a deterministically-derived UUID based on the image pixels, which can be used to identify duplicate Images. type: string format: uuid

    alias:

    description: a string alias for this individual, helpful for user-facing interfaces type: string

  • schema:

    id: Task description: A Task is a semantic construct that represents a background task (i.e. detection) in an asynchronous call. A Task has an optional callback on completion or the status (and result) can be checked via the API required:

    • uuid
    properties:
    uuid:

    description: a random UUID to identify a given asynchronous call, used to check status and results of a background task type: string format: uuid

produces: - application/json responses:

200:
description: Returns the Swagger 2.0 JSON format
wbia.web.apis_microsoft.microsoft_core_status(ibs, *args, **kwargs)[source]

Returns the health status of the API back-end; optionally can be used as a service heatbeat. — produces: - application/json responses:

200:

description: Returns the status of the server schema:

type: object properties:

status:
type: string enum: - healthy - warning - critical
examples:
application/json:
status: healthy
wbia.web.apis_microsoft.microsoft_detect(ibs, images, model, score_threshold=0.0, use_nms=True, nms_threshold=0.4, __jobid__=None, *args, **kwargs)[source]
wbia.web.apis_microsoft.microsoft_detect_batch(ibs, images, model, score_threshold=0.0, use_nms=True, nms_threshold=0.4, async_=True, callback_url=None, callback_method=None, *args, **kwargs)[source]

The asynchronous variant of POST ‘detect’ that takes in a list of Image models and returns a task ID.

It may be more ideal for a particular application to upload many images at one time and perform processing later in a large batch. This type of batch detection is certainly much more efficient because the detection on GPU can process more images in parallel. However, if you intend to run the detector on an upload as quickly as possible, please use the on-demand, non-batched API. — parameters: - name: images

in: body description: A JSON list of Image models for which detection will be processed. required: true type: array
  • name: model in: formData description: The model name to use with detection. Available models can be queried using the API $PREFIX/detect/model/ required: true type: string
  • name: score_threshold in: formData description: A score threshold to filter the detection results. Default 0.0. Must be in range [0, 1], inclusive required: false type: number format: float
  • name: use_nms in: formData description: Flag to turn on/off Non-Maximum Suppression (NMS). Default True. required: false type: boolean
  • name: nms_threshold in: formData description: A Intersection-over-Union (IoU) threshold to suppress detection results with NMS. Default 0.0. Must be in range [0, 1], inclusive required: false type: number format: float
  • name: callback_url in: formData description: The URL of where to callback when the task is completed, must be a fully resolvable address and accessible. The callback will include a ‘body’ parameter called task which will provide a Task model required: false type: string format: url
  • name: callback_method in: formData description: The HTTP method for which to make the callback. Default POST. required: false type: string enum: - get - post - put - delete

consumes: - multipart/form-data responses:

200:

description: Returns a Task model schema:

$ref: “#/definitions/Task”
400:
description: Invalid input parameter
x-task-response:

description: The task returns an array of arrays of Detection models, in parallel lists with the provided Image models schema:

type: array items:

schema:

type: array items:

$ref: “#/definitions/Detection”
wbia.web.apis_microsoft.microsoft_detect_input_validation(model, score_threshold, use_nms, nms_threshold)[source]
wbia.web.apis_microsoft.microsoft_detect_model(ibs, *args, **kwargs)[source]

Returns the available models and their supported species for detection. These models are pre-trained and are downloaded as needed on first start-up.

The current model names that are supported for demoing and their species: - hammerhead -> shark_hammerhead - jaguar -> jaguar - lynx -> lynx - manta -> manta_ray_giant - seaturtle -> fish, ignore, person, turtle_green, turtle_green+head, turtle_hawksbill, turtle_hawksbill+head - ggr2 -> giraffe, zebra — produces: - application/json responses:

200:

description: Returns an object of models (keys) and their supported species (values) listed as an array of strings. schema:

type: object
wbia.web.apis_microsoft.microsoft_detect_upload(ibs, model, score_threshold=0.0, use_nms=True, nms_threshold=0.4, *args, **kwargs)[source]

Returns the detection results for an uploaded image and a provided model configuration.

The uploaded image will be used to perform object detection for a given model. A detection will return at most 845 Detections (13 x 13 grid of 5 bounding boxes based on the YOLO v2 by Redmon et al.). — parameters: - name: image

in: formData description: The image for which detection will be processed. required: true type: file enum: - image/png - image/jpg - image/tiff
  • name: model in: formData description: The model name to use with detection. Available models can be queried using the API $PREFIX/detect/model/ required: true type: string
  • name: score_threshold in: formData description: A score threshold to filter the detection results. Default 0.0. Must be in range [0, 1], inclusive required: false type: number format: float
  • name: use_nms in: formData description: Flag to turn on/off Non-Maximum Suppression (NMS). Default True. Must be in range [0, 1], inclusive required: false type: boolean
  • name: nms_threshold in: formData description: A Intersection-over-Union (IoU) threshold to suppress detection results with NMS. Default 0.0. Must be in range [0, 1], inclusive required: false type: number format: float

consumes: - multipart/form-data responses:

200:

description: Returns an array of Detection models on the uploaded image schema:

type: array items:

$ref: “#/definitions/Detection”
400:
description: Invalid input parameter
415:
description: Unsupported media type in the request body. Currently only image/png, image/jpeg, image/tiff are supported.
wbia.web.apis_microsoft.microsoft_get_test_data(ibs, dataset)[source]

Return test data annotations. — parameters: - name: dataset

in: body description: A name for the dataset. Must be one of ‘zebra’, ‘dolphin’, ‘humpback’ required: true type: string

produces: - application/json responses:

200:
description: A JSON object with the query and database Annotation model lists
400:
description: Invalid input parameter
wbia.web.apis_microsoft.microsoft_identify(ibs, query_annotation, database_annotations, algorithm, callback_url=None, callback_method=None, *args, **kwargs)[source]

The asynchronous call to identify a list of pre-uploaded query annotations against a database of annotations. Returns a task ID.

This call expects all of the data has been already uploaded and the appropriate metadata set. For example, this call expects any known ground-truth nameshave already been made and assigned to the appropriate Annotation models. Conversely, we also provide a method for marking individual reviews between two Annotation models. The decision between a given pair should always be one of [‘match’, ‘nomatch’, or ‘notcomp’]. The full docuemntation for this call can be seen in the POST ‘decision’ API. — parameters: - name: query_annotation

in: formData description: An Annotation models to query for an identification required: true schema:

$ref: “#/definitions/Annotation”
  • name: database_annotations in: formData description: A JSON list of Annotation models to compare the query Annotation against required: true type: array items:

    $ref: “#/definitions/Annotation”

  • name: algorithm in: formData description: The algorithm you with to run ID with. Must be one of “HotSpotter”, “CurvRank”, “Finfindr”, or “Deepsense” required: true type: string

  • name: callback_url in: formData description: The URL of where to callback when the task is completed, must be a fully resolvable address and accessible. The callback will include a ‘body’ parameter called task which will provide a Task model required: false type: string format: url

  • name: callback_method in: formData description: The HTTP method for which to make the callback. Default POST. required: false type: string enum: - get - post - put - delete

consumes: - multipart/form-data responses:

200:

description: Returns a Task model schema:

$ref: “#/definitions/Task”
400:
description: Invalid input parameter
wbia.web.apis_microsoft.microsoft_identify_visualize(reference, query_annotation, database_annotation, version='heatmask')[source]

Visualize the results of matching, precomputed and rendered to disk for easy look-up.

— parameters: - name: reference

in: formData description: A reference string to refer to the rendered match results on disk for a given identification Task required: true type: string
  • name: query_annotation in: formData description: The query Annotation model required: true schema:

    $ref: “#/definitions/Annotation”

  • name: database_annotation in: formData description: The database Annotation model required: true schema:

    $ref: “#/definitions/Annotation”

  • name: version in: formData description: The version of the visualization. Must be one of “heatmask” or “original”. Defaults to “heatmask” required: false type: string

consumes: - multipart/form-data responses:

200:

description: Returns a Task model schema:

$ref: “#/definitions/Task”
400:
description: Invalid input parameter
wbia.web.apis_microsoft.microsoft_image_annotations(ibs, image, *args, **kwargs)[source]

Get the Annotation models for a given Image model — parameters: - name: image

in: body description: A Image model to use for querying associated Annotation UUIDs required: true schema:

$ref: “#/definitions/Image”

produces: - application/json responses:

200:

description: Returns a (possibly empty) list of Annotations models schema:

type: array items:

$ref: “#/definitions/Annotation”
400:
description: Invalid input parameter
wbia.web.apis_microsoft.microsoft_image_delete(ibs, image)[source]

Delete an Image model from the database.

Also deletes any derived Detection models or any added Annotations for the deleted Image model. — parameters: - name: image

in: body description: A Image model to delete required: true schema:

$ref: “#/definitions/Image”

produces: - application/json responses:

200:

description: Returns a success status flag (True if deleted) schema:

type: boolean
400:
description: Invalid input parameter
wbia.web.apis_microsoft.microsoft_image_upload(ibs, *args, **kwargs)[source]

Upload an Image to the system and return the UUID — parameters: - name: image

in: formData description: The image to upload. required: true type: file enum: - image/png - image/jpg - image/tiff

consumes: - multipart/form-data produces: - application/json responses:

200:

description: Returns an Image model with a UUID schema:

$ref: “#/definitions/Image”
400:
description: Invalid input parameter
415:
description: Unsupported media type in the request body. Currently only image/png, image/jpeg, image/tiff are supported.
wbia.web.apis_microsoft.microsoft_name_add(ibs, alias, *args, **kwargs)[source]

Add a Name to the system and return the UUID — parameters: - name: alias

in: formData description: a user-defined string to specify an alias for this name, useful for forward facing interfaces required: false type: string

consumes: - multipart/form-data produces: - application/json responses:

200:

description: Returns an Name model with a UUID schema:

$ref: “#/definitions/Name”
400:
description: Invalid input parameter
wbia.web.apis_microsoft.microsoft_name_annotations(ibs, name, *args, **kwargs)[source]

Get the Annotation models for a given Name model — parameters: - name: name

in: body description: A Name model to use for querying associated Annotation UUIDs required: true schema:

$ref: “#/definitions/Name”

produces: - application/json responses:

200:

description: Returns a (possibly empty) list of Annotations models schema:

type: array items:

$ref: “#/definitions/Annotation”
400:
description: Invalid input parameter
wbia.web.apis_microsoft.microsoft_name_delete(ibs, name)[source]

Delete a Name model from the database.

This operation DOES NOT delete any associated Annotation models with this Name, it simply disassociates them. — parameters: - name: name

in: body description: A Name model to delete required: true schema:

$ref: “#/definitions/Name”

produces: - application/json responses:

200:

description: Returns a success status flag (True if deleted) schema:

type: boolean
400:
description: Invalid input parameter
wbia.web.apis_microsoft.microsoft_task_result(ibs, task)[source]

Retrieve the result of a completed asynchronous Task — parameters: - name: task

in: body description: A Task model required: true schema:

$ref: “#/definitions/Task”
responses:
200:
description: Returns the result of the provided Task
400:
description: Invalid input parameter
wbia.web.apis_microsoft.microsoft_task_status(ibs, task)[source]

Check the status of an asynchronous Task.

A Task is an asynchronous task that was launched as a background process with an optional callback. The status of a given Task with a UUID can be checked with this call. The status of the call depends on where in the execution queue the Task is currently, which will be processed in a first-come-first-serve list and only one Task at a time to present atomicity of the API.

The status can be one of the following: - received -> The Task request was received but has not passed any input validation. - accepted -> The Task request has passed basic input validation and will be queued soon for execution. - queued -> The Task is queued in the execution list and will be processed in order and one at a time. - working -> The Task is being processed, awaiting completed results or an error exception - publishing -> The Task is publishing the results of the background API call. - completed -> One of two end states: the Task is complete, completed results available for downloading with the REST API. - exception -> One of two end states: the Task has encountered an error, an error message can be received using the results REST API. - unknown -> The Task you asked for is not known, indicating that the either UUID is not recognized (i.e. a Task with that ID was never currently created) or the server has been restarted.

Important: when the API server is restarted, all queued and running background Tasks are killed and all Task requests and cached results are deleted. — parameters: - name: task

in: body description: A Task model required: true schema:

$ref: “#/definitions/Task”
responses:
200:

description: Returns the status of the provided Task schema:

type: object properties:

status:
type: string enum: - received - accepted - queued - working - publishing - completed - exception - unknown
400:
description: Invalid input parameter
wbia.web.apis_microsoft.query_chips_graph_microsoft(ibs, *args, **kwargs)[source]

wbia.web.apis_query module

Dependencies: flask, tornado

SeeAlso:
routes.turk_identification
wbia.web.apis_query.add_annots_query_chips_graph_v2(ibs, graph_uuid, annot_uuid_list)[source]
wbia.web.apis_query.delete_query_chips_graph_v2(ibs, graph_uuid)[source]
wbia.web.apis_query.ensure_review_image(ibs, aid, cm, qreq_, view_orientation='vertical', draw_matches=True, draw_heatmask=False, verbose=False)[source]

” Create the review image for a pair of annotations

CommandLine:
python -m wbia.web.apis_query ensure_review_image –show

Example

>>> # SCRIPT
>>> from wbia.web.apis_query import *  # NOQA
>>> import wbia
>>> cm, qreq_ = wbia.testdata_cm('PZ_MTEST', a='default:dindex=0:10,qindex=0:1')
>>> ibs = qreq_.ibs
>>> aid = cm.get_top_aids()[0]
>>> tt = ut.tic('make image')
>>> image, _ = ensure_review_image(ibs, aid, cm, qreq_)
>>> ut.toc(tt)
>>> ut.quit_if_noshow()
>>> print('image.shape = %r' % (image.shape,))
>>> print('image.dtype = %r' % (image.dtype,))
>>> ut.print_object_size(image)
>>> import wbia.plottool as pt
>>> pt.imshow(image)
>>> ut.show_if_requested()
wbia.web.apis_query.ensure_review_image_v2(ibs, match, draw_matches=False, draw_heatmask=False, view_orientation='vertical', overlay=True)[source]
wbia.web.apis_query.get_graph_client_query_chips_graph_v2(ibs, graph_uuid)[source]
wbia.web.apis_query.get_recognition_query_aids(ibs, is_known, species=None)[source]

DEPCIRATE

RESTful:
Method: GET URL: /api/query/annot/rowid/
wbia.web.apis_query.process_graph_match_html(ibs, **kwargs)[source]
RESTful:
Method: POST URL: /api/review/query/graph/
wbia.web.apis_query.process_graph_match_html_v2(ibs, graph_uuid, **kwargs)[source]
wbia.web.apis_query.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.

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/chip/
CommandLine:

python -m wbia.web.apis_query –test-query_chips

# Test speed of single query python -m wbia –tf IBEISController.query_chips –db PZ_Master1

-a default:qindex=0:1,dindex=0:500 –nocache-hs
python -m wbia –tf IBEISController.query_chips –db PZ_Master1
-a default:qindex=0:1,dindex=0:3000 –nocache-hs

python -m wbia.web.apis_query –test-query_chips:1 –show python -m wbia.web.apis_query –test-query_chips:2 –show

Example

>>> # SLOW_DOCTEST
>>> # xdoctest: +SKIP
>>> from wbia.control.IBEISControl import *  # NOQA
>>> import wbia
>>> qreq_ = wbia.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
>>> # xdoctest: +SKIP
>>> import wbia
>>> from wbia.control.IBEISControl import *  # NOQA
>>> qaid_list = [1]
>>> daid_list = [1, 2, 3, 4, 5]
>>> ibs = wbia.opendb_test(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
>>> # xdoctest: +SKIP
>>> import wbia
>>> from wbia.control.IBEISControl import *  # NOQA
>>> qaid_list = [1]
>>> daid_list = [1, 2, 3, 4, 5]
>>> ibs = wbia.opendb_test(db='testdb1')
>>> cfgdict = {'pipeline_root':'BC_DTW'}
>>> qreq_ = ibs.new_query_request(qaid_list, daid_list, cfgdict=cfgdict, verbose=True)
>>> cm = ibs.query_chips(qreq_=qreq_)[0]
>>> ut.quit_if_noshow()
>>> cm.ishow_analysis(qreq_)
>>> ut.show_if_requested()
wbia.web.apis_query.query_chips_dict(ibs, *args, **kwargs)[source]

Runs query_chips, but returns a json compatible dictionary

RESTful:
Method: GET URL: /api/query/chip/dict/
wbia.web.apis_query.query_chips_graph(ibs, qaid_list, daid_list, user_feedback=None, query_config_dict={}, echo_query_params=True, cache_images=True, n=16, view_orientation='horizontal', return_summary=True, **kwargs)[source]
wbia.web.apis_query.query_chips_graph_complete(ibs, aid_list, query_config_dict={}, k=5, **kwargs)[source]
wbia.web.apis_query.query_chips_graph_match_thumb(extern_reference, query_annot_uuid, database_annot_uuid, version)[source]
wbia.web.apis_query.query_chips_graph_v2(ibs, annot_uuid_list=None, query_config_dict={}, review_callback_url=None, review_callback_method='POST', finished_callback_url=None, finished_callback_method='POST', creation_imageset_rowid_list=None, **kwargs)[source]
CommandLine:

python -m wbia.web.apis_query –test-query_chips_graph_v2:0

python -m wbia reset_mtest_graph

python -m wbia –db PZ_MTEST –web –browser –url=/turk/identification/hardcase/ python -m wbia –db PZ_MTEST –web –browser –url=/turk/identification/graph/

Example

>>> # xdoctest: +REQUIRES(--web)
>>> from wbia.web.apis_query import *
>>> import wbia
>>> # Open local instance
>>> ibs = wbia.opendb('PZ_MTEST')
>>> uuid_list = ibs.annots().uuids[0:10]
>>> # Start up the web instance
>>> web_ibs = wbia.opendb_bg_web(db='PZ_MTEST', web=True, browser=False)
>>> data = dict(annot_uuid_list=uuid_list)
>>> resp = web_ibs.send_wbia_request('/api/query/graph/v2/', **data)
>>> print('resp = %r' % (resp,))
>>> #cmdict_list = json_dict['response']
>>> #assert 'score_list' in cmdict_list[0]

Example

>>> # DEBUG_SCRIPT
>>> from wbia.web.apis_query import *
>>> # Hack a flask context
>>> current_app = ut.DynStruct()
>>> current_app.GRAPH_CLIENT_DICT = {}
>>> old = query_chips_graph_v2.__globals__.get('current_app', None)
>>> query_chips_graph_v2.__globals__['current_app'] = current_app
>>> import wbia
>>> ibs = wbia.opendb('PZ_MTEST')
>>> #ut.exec_funckw(query_chips_graph_v2, globals())
>>> # Run function in main process
>>> query_chips_graph_v2(ibs)
>>> # Reset context
>>> query_chips_graph_v2.__globals__['current_app'] = old
wbia.web.apis_query.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/chip/dict/simple/
SeeAlso:
query_chips
CommandLine:

python -m wbia.web.apis_query –test-query_chips_simple_dict:0 python -m wbia.web.apis_query –test-query_chips_simple_dict:1

python -m wbia.web.apis_query –test-query_chips_simple_dict:0 –humpbacks

Example

>>> # xdoctest: +REQUIRES(--web)
>>> from wbia.control.IBEISControl import *  # NOQA
>>> import wbia
>>> ibs = wbia.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 list(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.repr2(dict_list, nl=2, precision=2, hack_liststr=True)
>>> result = result.replace('u\'', '"').replace('\'', '"')
>>> print(result)

Example

>>> # xdoctest: +REQUIRES(--web)
>>> from wbia.control.IBEISControl import *  # NOQA
>>> import time
>>> import wbia
>>> import requests
>>> # Start up the web instance
>>> web_instance = wbia.opendb_in_background(db='testdb1', web=True, browser=False)
>>> time.sleep(10)
>>> web_port = ibs.get_web_port_via_scan()
>>> if web_port is None:
>>>     raise ValueError('IA web server is not running on any expected port')
>>> baseurl = 'http://127.0.1.1:%s' % (web_port, )
>>> data = dict(qaid_list=[1])
>>> resp = requests.get(baseurl + '/api/query/chip/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]
wbia.web.apis_query.query_chips_test(ibs, aid=None, limited=False, census_annotations=True, **kwargs)[source]
CommandLine:
python -m wbia.web.apis_query query_chips_test

Example

>>> # SLOW_DOCTEST
>>> # xdoctest: +SKIP
>>> from wbia.control.IBEISControl import *  # NOQA
>>> import wbia
>>> qreq_ = wbia.testdata_qreq_(defaultdb='testdb1')
>>> ibs = qreq_.ibs
>>> result_dict = ibs.query_chips_test()
>>> print(result_dict)
wbia.web.apis_query.query_graph_v2_callback(graph_client, callback_type)[source]
wbia.web.apis_query.query_graph_v2_latest_logs(future)[source]
wbia.web.apis_query.query_graph_v2_on_request_review(future)[source]
wbia.web.apis_query.remove_annots_query_chips_graph_v2(ibs, graph_uuid, annot_uuid_list)[source]
wbia.web.apis_query.review_graph_match_config_v2(ibs, graph_uuid, aid1=None, aid2=None, view_orientation='vertical', view_version=1)[source]
wbia.web.apis_query.review_graph_match_html(ibs, review_pair, cm_dict, query_config_dict, _internal_state, callback_url, callback_method='POST', view_orientation='vertical', include_jquery=False)[source]
Parameters:
  • ibs (wbia.IBEISController) – image analysis api
  • review_pair (dict) – pair of annot uuids
  • cm_dict (dict) –
  • query_config_dict (dict) –
  • _internal_state
  • callback_url (str) –
  • callback_method (unicode) – (default = u’POST’)
  • view_orientation (unicode) – (default = u’vertical’)
  • include_jquery (bool) – (default = False)
CommandLine:

python -m wbia.web.apis_query review_graph_match_html –show

wbia –web python -m wbia.web.apis_query review_graph_match_html –show –domain=localhost

Example

>>> # xdoctest: +REQUIRES(--web)
>>> from wbia.web.apis_query import *  # NOQA
>>> import wbia
>>> web_ibs = wbia.opendb_bg_web('testdb1')  # , domain='http://52.33.105.88')
>>> aids = web_ibs.send_wbia_request('/api/annot/', 'get')[0:2]
>>> uuid_list = web_ibs.send_wbia_request('/api/annot/uuid/', type_='get', aid_list=aids)
>>> quuid_list = uuid_list[0:1]
>>> duuid_list = uuid_list
>>> query_config_dict = {
>>>    # 'pipeline_root' : 'BC_DTW'
>>> }
>>> data = dict(
>>>     query_annot_uuid_list=quuid_list, database_annot_uuid_list=duuid_list,
>>>     query_config_dict=query_config_dict,
>>> )
>>> jobid = web_ibs.send_wbia_request('/api/engine/query/graph/', **data)
>>> print('jobid = %r' % (jobid,))
>>> status_response = web_ibs.wait_for_results(jobid)
>>> result_response = web_ibs.read_engine_results(jobid)
>>> inference_result = result_response['json_result']
>>> print('inference_result = %r' % (inference_result,))
>>> auuid2_cm = inference_result['cm_dict']
>>> quuid = quuid_list[0]
>>> class_dict = auuid2_cm[str(quuid)]
>>> # Get information in frontend
>>> #ibs = wbia.opendb('testdb1')
>>> #cm = match_obj = wbia.ChipMatch.from_dict(class_dict, ibs=ibs)
>>> #match_obj.print_rawinfostr()
>>> # Make the dictionary a bit more managable
>>> #match_obj.compress_top_feature_matches(num=2)
>>> #class_dict = match_obj.to_dict(ibs=ibs)
>>> cm_dict = class_dict
>>> # Package for review
>>> review_pair = {'annot_uuid_1': quuid, 'annot_uuid_2': duuid_list[1]}
>>> callback_method = u'POST'
>>> view_orientation = u'vertical'
>>> include_jquery = False
>>> kw = dict(
>>>     review_pair=review_pair,
>>>     cm_dict=cm_dict,
>>>     query_config_dict=query_config_dict,
>>>     _internal_state=None,
>>>     callback_url = None,
>>> )
>>> html_str = web_ibs.send_wbia_request('/api/review/query/graph/', type_='get', **kw)
>>> web_ibs.terminate2()
>>> ut.quit_if_noshow()
>>> import wbia.plottool as pt
>>> ut.render_html(html_str)
>>> ut.show_if_requested()
Example2:
>>> # DISABLE_DOCTEST
>>> # This starts off using web to get information, but finishes the rest in python
>>> from wbia.web.apis_query import *  # NOQA
>>> import wbia
>>> ut.exec_funckw(review_graph_match_html, globals())
>>> web_ibs = wbia.opendb_bg_web('testdb1')  # , domain='http://52.33.105.88')
>>> aids = web_ibs.send_wbia_request('/api/annot/', 'get')[0:2]
>>> uuid_list = web_ibs.send_wbia_request('/api/annot/uuid/', type_='get', aid_list=aids)
>>> quuid_list = uuid_list[0:1]
>>> duuid_list = uuid_list
>>> query_config_dict = {
>>>    # 'pipeline_root' : 'BC_DTW'
>>> }
>>> data = dict(
>>>     query_annot_uuid_list=quuid_list, database_annot_uuid_list=duuid_list,
>>>     query_config_dict=query_config_dict,
>>> )
>>> jobid = web_ibs.send_wbia_request('/api/engine/query/graph/', **data)
>>> status_response = web_ibs.wait_for_results(jobid)
>>> result_response = web_ibs.read_engine_results(jobid)
>>> web_ibs.terminate2()
>>> # NOW WORK IN THE FRONTEND
>>> inference_result = result_response['json_result']
>>> auuid2_cm = inference_result['cm_dict']
>>> quuid = quuid_list[0]
>>> class_dict = auuid2_cm[str(quuid)]
>>> # Get information in frontend
>>> ibs = wbia.opendb('testdb1')
>>> cm = wbia.ChipMatch.from_dict(class_dict, ibs=ibs)
>>> cm.print_rawinfostr()
>>> # Make the dictionary a bit more managable
>>> cm.compress_top_feature_matches(num=1)
>>> cm.print_rawinfostr()
>>> class_dict = cm.to_dict(ibs=ibs)
>>> cm_dict = class_dict
>>> # Package for review ( CANT CALL DIRECTLY BECAUSE OF OUT OF CONTEXT )
>>> review_pair = {'annot_uuid_1': quuid, 'annot_uuid_2': duuid_list[1]}
>>> x = review_graph_match_html(ibs, review_pair, cm_dict,
>>>                             query_config_dict, _internal_state=None,
>>>                             callback_url=None)
>>> ut.quit_if_noshow()
>>> import wbia.plottool as pt
>>> ut.render_html(html_str)
>>> ut.show_if_requested()
wbia.web.apis_query.review_graph_match_html_alias(*args, **kwargs)[source]
wbia.web.apis_query.review_graph_match_html_v2(ibs, graph_uuid, callback_url=None, callback_method='POST', view_orientation='vertical', view_version=1, include_jquery=False)[source]
wbia.web.apis_query.review_query_chips_best(ibs, aid, **kwargs)[source]
wbia.web.apis_query.review_query_chips_test(**kwargs)[source]
CommandLine:
python -m wbia.web.apis_query review_query_chips_test –show

Example

>>> # SCRIPT
>>> import wbia
>>> web_ibs = wbia.opendb_bg_web(
>>>     browser=True, url_suffix='/test/review/query/chip/?__format__=true')
wbia.web.apis_query.sync_query_chips_graph_v2(ibs, graph_uuid)[source]
wbia.web.apis_query.view_graphs_status(ibs)[source]

wbia.web.apis_sync module

Dependencies: flask, tornado

SeeAlso:
routes.turk_identification
wbia.web.apis_sync.detect_remote_sync_images(ibs, gid_list=None, only_sync_missing_images=True)[source]
wbia.web.apis_sync.sync_get_training_data(ibs, species_name, force_update=False, **kwargs)[source]

wbia.web.app module

Dependencies: flask, tornado

class wbia.web.app.TimedWSGIContainer(wsgi_application)[source]

Bases: tornado.wsgi.WSGIContainer

wbia.web.app.start_from_wbia(ibs, port=None, browser=None, precache=None, url_suffix=None, start_job_queue=None, start_web_loop=True)[source]

Parse command line options and start the server.

CommandLine:
python -m wbia –db PZ_MTEST –web python -m wbia –db PZ_MTEST –web –browser
wbia.web.app.start_tornado(ibs, port=None, browser=None, url_suffix=None, start_web_loop=True, fallback=True)[source]

Initialize the web server

wbia.web.app.start_web_annot_groupreview(ibs, aid_list)[source]
Parameters:
  • ibs (IBEISController) – wbia controller object
  • aid_list (list) – list of annotation rowids
CommandLine:
python -m wbia.tag_funcs –exec-start_web_annot_groupreview –db PZ_Master1 python -m wbia.tag_funcs –exec-start_web_annot_groupreview –db GZ_Master1 python -m wbia.tag_funcs –exec-start_web_annot_groupreview –db GIRM_Master1

Example

>>> # SCRIPT
>>> from wbia.tag_funcs import *  # NOQA
>>> import wbia
>>> #ibs = wbia.opendb(defaultdb='PZ_Master1')
>>> ibs = wbia.opendb(defaultdb='GZ_Master1')
>>> #aid_list = ibs.get_valid_aids()
>>> # -----
>>> any_tags = ut.get_argval('--tags', type_=list, default=['Viewpoint'])
>>> min_num = ut.get_argval('--min_num', type_=int, default=1)
>>> prop = any_tags[0]
>>> filtered_annotmatch_rowids = filter_annotmatch_by_tags(ibs, None, any_tags=any_tags, min_num=min_num)
>>> aid1_list = (ibs.get_annotmatch_aid1(filtered_annotmatch_rowids))
>>> aid2_list = (ibs.get_annotmatch_aid2(filtered_annotmatch_rowids))
>>> aid_list = list(set(ut.flatten([aid2_list, aid1_list])))
>>> result = start_web_annot_groupreview(ibs, aid_list)
>>> print(result)
wbia.web.app.tst_html_error()[source]

This test will show what our current errors look like

CommandLine:
python -m wbia.web.app –exec-tst_html_error

Example

>>> # DISABLE_DOCTEST
>>> from wbia.web.app import *  # NOQA
>>> import wbia
>>> web_ibs = wbia.opendb_bg_web(browser=True, start_job_queue=False, url_suffix='/api/image/imagesettext/?__format__=True')

wbia.web.appfuncs module

class wbia.web.appfuncs.NavbarClass[source]

Bases: object

wbia.web.appfuncs.check_valid_function_name(string)[source]
wbia.web.appfuncs.convert_nmea_to_json(nmea_str, filename, GMT_OFFSET=0)[source]
wbia.web.appfuncs.convert_tuple_to_viewpoint(viewpoint_tuple)[source]
wbia.web.appfuncs.convert_viewpoint_to_tuple(viewpoint_text)[source]
wbia.web.appfuncs.decode_refer_url(encoded)[source]
wbia.web.appfuncs.default_species(ibs)[source]
wbia.web.appfuncs.embed_image_html(imgBGR, target_width=1200.0, target_height=800.0)[source]

Creates an image embedded in HTML base64 format.

wbia.web.appfuncs.encode_refer_url(decoded)[source]
wbia.web.appfuncs.get_turk_annot_args(is_reviewed_func, speed_hack=False)[source]

Helper to return aids in an imageset or a group review

wbia.web.appfuncs.get_turk_image_args(is_reviewed_func)[source]

Helper to return gids in an imageset or a group review

wbia.web.appfuncs.imageset_annot_canonical(ibs, aid_list, canonical_part_type='__CANONICAL__')[source]
wbia.web.appfuncs.imageset_annot_demographics_processed(ibs, aid_list)[source]
wbia.web.appfuncs.imageset_annot_processed(ibs, aid_list)[source]
wbia.web.appfuncs.imageset_annot_quality_processed(ibs, aid_list)[source]
wbia.web.appfuncs.imageset_annot_viewpoint_processed(ibs, aid_list)[source]
wbia.web.appfuncs.imageset_image_cameratrap_processed(ibs, gid_list)[source]
wbia.web.appfuncs.imageset_image_processed(ibs, gid_list, is_staged=False, reviews_required=3)[source]
wbia.web.appfuncs.imageset_image_staged_progress(ibs, gid_list, reviews_required=3)[source]
wbia.web.appfuncs.imageset_part_contour_processed(ibs, part_rowid_list, reviewed_flag_progress=True)[source]
wbia.web.appfuncs.imageset_part_type_processed(ibs, part_rowid_list, reviewed_flag_progress=True)[source]
wbia.web.appfuncs.movegroup_aid(ibs, aid, src_ag, dst_ag)[source]
wbia.web.appfuncs.resize_via_web_parameters(image)[source]
wbia.web.appfuncs.send_csv_file(string, filename)[source]
wbia.web.appfuncs.template(template_directory=None, template_filename=None, **kwargs)[source]

wbia.web.graph_server module

class wbia.web.graph_server.GraphActor[source]

Bases: futures_actors.thread_actor.ThreadActor

CommandLine:
python -m wbia.web.graph_server GraphActor
Doctest:
>>> from wbia.web.graph_server import *
>>> actor = GraphActor()
>>> payload = testdata_start_payload()
>>> # Start the process
>>> start_resp = actor.handle(payload)
>>> print('start_resp = {!r}'.format(start_resp))
>>> # Respond with a user decision
>>> user_request = actor.handle({'action': 'continue_review'})
>>> # Wait for a response and  the GraphActor in another proc
>>> edge, priority, edge_data = user_request[0]
>>> user_resp_payload = testdata_feedback_payload(edge, 'match')
>>> content = actor.handle(user_resp_payload)
>>> actor.infr.dump_logs()
Doctest:
>>> from wbia.web.graph_server import *
>>> import wbia
>>> actor = GraphActor()
>>> config = {
>>>     'manual.n_peek'   : 1,
>>>     'manual.autosave' : False,
>>>     'ranking.enabled' : False,
>>>     'autoreview.enabled' : False,
>>>     'redun.enabled'   : False,
>>>     'redun.enabled'   : False,
>>>     'queue.conf.thresh' : 'absolutely_sure',
>>>     'algo.hardcase' : True,
>>> }
>>> # Start the process
>>> dbdir = wbia.sysres.db_to_dbdir('PZ_MTEST')
>>> payload = {'action': 'start', 'dbdir': dbdir, 'aids': 'all',
>>>            'config': config, 'init': 'annotmatch'}
>>> start_resp = actor.handle(payload)
>>> print('start_resp = {!r}'.format(start_resp))
>>> # Respond with a user decision
>>> user_request = actor.handle({'action': 'continue_review'})
>>> print('user_request = {!r}'.format(user_request))
>>> # Wait for a response and  the GraphActor in another proc
>>> edge, priority, edge_data = user_request[0]
>>> user_resp_payload = testdata_feedback_payload(edge, 'match')
>>> content = actor.handle(user_resp_payload)
>>> actor.infr.dump_logs()
>>> actor.infr.status()
add_annots(aids, **kwargs)[source]
add_feedback(**feedback)[source]
continue_review()[source]
get_feat_extractor()[source]
get_infr_status()[source]
handle(message)[source]

This method recieves, handles, and responds to the messages sent from the executor. This function can return arbitrary values. These values can be accessed from the main thread using the Future object returned when the message was posted to this actor by the executor.

remove_annots(aids, **kwargs)[source]
start(dbdir, aids='all', config={}, **kwargs)[source]
update_task_thresh(task, decision, value, **kwargs)[source]
class wbia.web.graph_server.GraphClient(graph_uuid=None, callbacks={}, autoinit=False)[source]

Bases: object

CommandLine:
python -m wbia.web.graph_server GraphClient

Example

>>> # ENABLE_DOCTEST
>>> from wbia.web.graph_server import *
>>> import wbia
>>> client = GraphClient(autoinit=True)
>>> # Start the GraphActor in another proc
>>> payload = testdata_start_payload()
>>> client.post(payload).result()
>>> f1 = client.post({'action': 'continue_review'})
>>> f1.add_done_callback(test_foo)
>>> user_request = f1.result()
>>> # Wait for a response and  the GraphActor in another proc
>>> edge, priority, edge_data = user_request[0]
>>> user_resp_payload = testdata_feedback_payload(edge, 'match')
>>> f2 = client.post(user_resp_payload)
>>> f2.result()
>>> # Debug by getting the actor over a mp.Pipe
>>> f3 = client.post({'action': 'debug'})
>>> actor = f3.result()
>>> actor.infr.dump_logs()
>>> #print(client.post({'action': 'logs'}).result())

# Ignore: # >>> from wbia.web.graph_server import * # >>> import wbia # >>> client = GraphClient(autoinit=True) # >>> # Start the GraphActor in another proc # >>> client.post(testdata_start_payload(list(range(1, 10)))).result() # >>> # # >>> f1 = client.post({‘action’: ‘continue_review’}) # >>> user_request = f1.result() # >>> # The infr algorithm needs a review # >>> edge, priority, edge_data = user_request[0] # >>> # # >>> client.post(testdata_feedback_payload(edge, ‘match’)) # >>> client.post({‘action’: ‘continue_review’}) # >>> client.post(testdata_feedback_payload(edge, ‘match’)) # >>> client.post(testdata_feedback_payload(edge, ‘match’)) # >>> client.post({‘action’: ‘continue_review’}) # >>> client.post(testdata_feedback_payload(edge, ‘match’)) # >>> client.post({‘action’: ‘wait’, ‘num’: float(30)}) # >>> client.post({‘action’: ‘continue_review’}) # >>> client.post(testdata_feedback_payload(edge, ‘match’)) # >>> client.post(testdata_feedback_payload(edge, ‘match’)) # >>> client.post({‘action’: ‘continue_review’}) # >>> client.post(testdata_feedback_payload(edge, ‘match’)) # >>> client.post({‘action’: ‘continue_review’}) # >>> client.post(testdata_feedback_payload(edge, ‘match’)) # >>> client.post({‘action’: ‘continue_review’}) # >>> client.post(testdata_feedback_payload(edge, ‘match’)) # >>> client.post(testdata_feedback_payload(edge, ‘match’)) # >>> client.post({‘action’: ‘continue_review’}) # >>> client.post(testdata_feedback_payload(edge, ‘match’)) # >>> client.post({‘action’: ‘continue_review’}) # >>> client.post(testdata_feedback_payload(edge, ‘match’)) # >>> client.post({‘action’: ‘continue_review’}) # >>> client.post(testdata_feedback_payload(edge, ‘match’)) # >>> client.post(testdata_feedback_payload(edge, ‘match’)) # >>> client.post({‘action’: ‘continue_review’}) # >>> client.post(testdata_feedback_payload(edge, ‘match’)) # >>> client.post({‘action’: ‘continue_review’}) # >>> client.post(testdata_feedback_payload(edge, ‘match’)) # >>> client.post({‘action’: ‘continue_review’})

add_annots()[source]
check(edge)[source]
cleanup()[source]
initialize()[source]
post(payload)[source]
refresh_status()[source]
rrr(verbose=True, reload_module=True)

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

sample(previous_edge_list=[], max_previous_edges=10)[source]
shutdown()[source]
update(data_list)[source]
wbia.web.graph_server.double_review_test()[source]
wbia.web.graph_server.test_foo(future)[source]
wbia.web.graph_server.testdata_feedback_payload(edge, decision)[source]
wbia.web.graph_server.testdata_start_payload(aids='all')[source]
wbia.web.graph_server.ut_to_json_encode(dict_)[source]

wbia.web.job_engine module

Accepts and handles requests for tasks.

Each of the following runs in its own Thread/Process.

BASICALLY DO A CLIENT/SERVER TO SPAWN PROCESSES AND THEN A PUBLISH SUBSCRIBE TO RETURN DATA

Accepter:
Receives tasks and requests Delegates tasks and responds to requests Tasks are delgated to an engine
Engine:
the engine accepts requests. the engine immediately responds WHERE it will be ready. the engine sends a message to the collector saying that something will be ready. the engine then executes a task. The engine is given direct access to the data.
Collector:

The collector accepts requests The collector can respond:

  • <ResultContent>
  • Results are ready.
  • Results are not ready.
  • Unknown jobid.
  • Error computing results.
  • Progress percent.

References

Simple task farm, with routed replies in pyzmq http://stackoverflow.com/questions/7809200/implementing-task-farm-messaging-pattern-with-zeromq https://gist.github.com/minrk/1358832

Notes

We are essentially goint to be spawning two processes. We can test these simultaniously using

python -m wbia.web.job_engine job_engine_tester
We can test these separately by first starting the background server

python -m wbia.web.job_engine job_engine_tester –bg

Alternative:
python -m wbia.web.job_engine job_engine_tester –bg –no-engine python -m wbia.web.job_engine job_engine_tester –bg –only-engine –fg-engine
And then running the forground process
python -m wbia.web.job_engine job_engine_tester –fg
class wbia.web.job_engine.JobBackend(**kwargs)[source]

Bases: object

initialize_background_processes(dbdir=None, containerized=False, thread=True)[source]
class wbia.web.job_engine.JobInterface(id_, port_dict, ibs=None)[source]

Bases: object

get_job_id_list()[source]
get_job_metadata(jobid)[source]
get_job_result(jobid)[source]
get_job_status(jobid)[source]
get_job_status_dict()[source]
get_unpacked_result(jobid)[source]
initialize_client_thread()[source]

Creates a ZMQ object in this thread. This talks to background processes.

queue_interrupted_jobs()[source]
queue_job(action, callback_url=None, callback_method=None, *args, **kwargs)[source]
IBEIS:
This is just a function that lives in the main thread and ships off a job.
FIXME: I do not like having callback_url and callback_method specified
like this with args and kwargs. If these must be there then they should be specified first, or THE PREFERED OPTION IS args and kwargs should not be specified without the * syntax

The client - sends messages, and receives replies after they have been processed by the

wait_for_job_result(jobid, timeout=10, freq=0.1)[source]
wbia.web.job_engine.calculate_timedelta(start, end)[source]
wbia.web.job_engine.close_job_manager(ibs)[source]
wbia.web.job_engine.collect_queue_loop(port_dict)
wbia.web.job_engine.collector_loop(port_dict, dbdir, containerized)[source]

Service that stores completed algorithm results

wbia.web.job_engine.convert_to_date(timestamp)[source]
wbia.web.job_engine.delete_shelve_lock_file(shelve_filepath)[source]
wbia.web.job_engine.engine_loop(id_, port_dict, dbdir, containerized)[source]
IBEIS:

This will be part of a worker process with its own IBEISController instance.

Needs to send where the results will go and then publish the results there.

The engine_loop - receives messages, performs some action, and sends a reply, preserving the leading two message parts as routing identities

wbia.web.job_engine.engine_queue_loop(port_dict)[source]

Specialized queue loop

wbia.web.job_engine.get_collector_shelve_filepaths(collector_data, jobid)[source]
wbia.web.job_engine.get_job_id_list(ibs)[source]

Web call that returns the list of job ids

CommandLine:

# Run Everything together python -m wbia.web.job_engine –exec-get_job_status

# Start job queue in its own process python -m wbia.web.job_engine job_engine_tester –bg # Start web server in its own process ./main.py –web –fg pass # Run foreground process python -m wbia.web.job_engine –exec-get_job_status:0 –fg

Example

>>> # xdoctest: +REQUIRES(--web)
>>> from wbia.web.job_engine import *  # NOQA
>>> import wbia
>>> web_ibs = wbia.opendb_bg_web('testdb1')  # , domain='http://52.33.105.88')
>>> # Test get status of a job id that does not exist
>>> response = web_ibs.send_wbia_request('/api/engine/job/', jobid='badjob')
>>> web_ibs.terminate2()
wbia.web.job_engine.get_job_metadata(ibs, jobid)[source]

Web call that returns the metadata of a job

CommandLine:

# Run Everything together python -m wbia.web.job_engine –exec-get_job_metadata

# Start job queue in its own process python -m wbia.web.job_engine job_engine_tester –bg # Start web server in its own process ./main.py –web –fg pass # Run foreground process python -m wbia.web.job_engine –exec-get_job_metadata:0 –fg

Example

>>> # WEB_DOCTEST
>>> from wbia.web.job_engine import *  # NOQA
>>> import wbia
>>> web_ibs = wbia.opendb_bg_web('testdb1')  # , domain='http://52.33.105.88')
>>> # Test get metadata of a job id that does not exist
>>> response = web_ibs.send_wbia_request('/api/engine/job/metadata/', jobid='badjob')
>>> web_ibs.terminate2()
wbia.web.job_engine.get_job_result(ibs, jobid)[source]

Web call that returns the result of a job

wbia.web.job_engine.get_job_status(ibs, jobid=None)[source]

Web call that returns the status of a job

Returns one of:
received - job has been received, but not ingested yet accepted - job has been accepted (validated) queued - job has been transferred to the engine queue working - job is being worked on by the engine publishing - job is done on the engine, pushing results to collector completed | exception - job is complete or has an error
CommandLine:

# Run Everything together python -m wbia.web.job_engine –exec-get_job_status

# Start job queue in its own process python -m wbia.web.job_engine job_engine_tester –bg # Start web server in its own process ./main.py –web –fg pass # Run foreground process python -m wbia.web.job_engine –exec-get_job_status:0 –fg

Example

>>> # xdoctest: +REQUIRES(--web)
>>> from wbia.web.job_engine import *  # NOQA
>>> import wbia
>>> web_ibs = wbia.opendb_bg_web('testdb1')  # , domain='http://52.33.105.88')
>>> # Test get status of a job id that does not exist
>>> response = web_ibs.send_wbia_request('/api/engine/job/status/', jobid='badjob')
>>> web_ibs.terminate2()
wbia.web.job_engine.get_shelve_filepaths(ibs, jobid)[source]
wbia.web.job_engine.get_shelve_lock_filepath(shelve_filepath)[source]
wbia.web.job_engine.get_shelve_value(shelve_filepath, key)[source]
wbia.web.job_engine.initialize_job_manager(ibs)[source]

Starts a background zmq job engine. Initializes a zmq object in this thread that can talk to the background processes.

Run from the webserver

CommandLine:
python -m wbia.web.job_engine –exec-initialize_job_manager:0

Example

>>> # DISABLE_DOCTEST
>>> from wbia.web.job_engine import *  # NOQA
>>> import wbia
>>> ibs = wbia.opendb(defaultdb='testdb1')
>>> from wbia.web import apis_engine
>>> from wbia.web import job_engine
>>> ibs.load_plugin_module(job_engine)
>>> ibs.load_plugin_module(apis_engine)
>>> ibs.initialize_job_manager()
>>> print('Initializqation success. Now closing')
>>> ibs.close_job_manager()
>>> print('Closing success.')

Example

>>> # xdoctest: +REQUIRES(--web)
>>> from wbia.web.job_engine import *  # NOQA
>>> import wbia
>>> import requests
>>> web_instance = wbia.opendb_bg_web(db='testdb1')
>>> web_port = ibs.get_web_port_via_scan()
>>> if web_port is None:
>>>     raise ValueError('IA web server is not running on any expected port')
>>> baseurl = 'http://127.0.1.1:%s' % (web_port, )
>>> _payload = {'image_attrs_list': [], 'annot_attrs_list': []}
>>> payload = ut.map_dict_vals(ut.to_json, _payload)
>>> resp1 = requests.post(baseurl + '/api/test/helloworld/?f=b', data=payload)
>>> #resp2 = requests.post(baseurl + '/api/image/json/', data=payload)
>>> #print(resp2)
>>> web_instance.terminate()
>>> #json_dict = resp2.json()
>>> #text = json_dict['response']
>>> #print(text)
wbia.web.job_engine.invalidate_global_cache(jobid)[source]
wbia.web.job_engine.job_engine_tester()[source]
CommandLine:

python -m wbia.web.job_engine –exec-job_engine_tester python -b -m wbia.web.job_engine –exec-job_engine_tester

python -m wbia.web.job_engine job_engine_tester python -m wbia.web.job_engine job_engine_tester –bg python -m wbia.web.job_engine job_engine_tester –fg

Example

>>> # SCRIPT
>>> from wbia.web.job_engine import *  # NOQA
>>> job_engine_tester()
wbia.web.job_engine.make_queue_loop(name='collect')[source]

Standard queue loop

Parameters:name (None) – (default = None)
wbia.web.job_engine.on_collect_request(ibs, collect_request, collector_data, shelve_path, containerized=False)[source]

Run whenever the collector recieves a message

wbia.web.job_engine.on_engine_request(ibs, jobid, action, args, kwargs)[source]

Run whenever the engine recieves a message

wbia.web.job_engine.rcv_multipart_json(sock, num=2, print=<function make_module_print_func.<locals>.print>)[source]

helper

wbia.web.job_engine.send_multipart_json(sock, idents, reply)[source]

helper

wbia.web.job_engine.set_shelve_value(shelve_filepath, key, value)[source]
wbia.web.job_engine.touch_shelve_lock_file(shelve_filepath)[source]
wbia.web.job_engine.update_proctitle(procname, dbname=None)[source]
wbia.web.job_engine.wait_for_job_result(ibs, jobid, timeout=10, freq=0.1)[source]
wbia.web.job_engine.wait_for_shelve_lock_file(shelve_filepath, timeout=600)[source]

wbia.web.prometheus module

wbia.web.prometheus.prometheus_increment_api(ibs, tag)[source]
wbia.web.prometheus.prometheus_increment_exception(ibs, tag)[source]
wbia.web.prometheus.prometheus_increment_route(ibs, tag)[source]
wbia.web.prometheus.prometheus_update(ibs, *args, **kwargs)[source]

wbia.web.routes module

Dependencies: flask, tornado

wbia.web.routes.action(**kwargs)[source]
wbia.web.routes.action_detect(**kwargs)[source]
wbia.web.routes.action_identification(**kwargs)[source]
wbia.web.routes.api_root(**kwargs)[source]
wbia.web.routes.check_engine_identification_query_object(global_feedback_limit=50)[source]
wbia.web.routes.commit_current_query_object_names(query_object, ibs)[source]
Parameters:
  • query_object (wbia.AnnotInference) –
  • ibs (wbia.IBEISController) – image analysis api
wbia.web.routes.dbinfo(**kwargs)[source]
wbia.web.routes.delete_query_chips_graph_v2_refer(graph_uuid)[source]
wbia.web.routes.error404(exception=None)[source]
wbia.web.routes.group_review(**kwargs)[source]
wbia.web.routes.image_view_api(gid=None, thumbnail=False, fresh=False, **kwargs)[source]

Returns the base64 encoded image of image <gid>

RESTful:
Method: GET URL: /image/view/<gid>/
wbia.web.routes.load_identification_query_object(autoinit=False, global_feedback_limit=50, **kwargs)[source]
wbia.web.routes.load_identification_query_object_worker(ibs, **kwargs)[source]
wbia.web.routes.login(refer=None, *args, **kwargs)[source]
wbia.web.routes.logout(**kwargs)[source]
wbia.web.routes.precompute_current_review_match_images(ibs, query_object, global_feedback_limit=50, view_orientation='vertical')[source]
wbia.web.routes.precompute_web_detection_thumbnails(ibs, gid_list=None, **kwargs)[source]
wbia.web.routes.precompute_web_viewpoint_thumbnails(ibs, aid_list=None, **kwargs)[source]
wbia.web.routes.root(**kwargs)[source]
wbia.web.routes.sightings(html_encode=True, complete=True, include_images=False, kaia=False, **kwargs)[source]
wbia.web.routes.turk(imgsetid=None)[source]
wbia.web.routes.turk_annotation(**kwargs)[source]
CommandLine:
python -m wbia.web.app –exec-turk_annotation –db PZ_Master1

Example

>>> # SCRIPT
>>> from wbia.other.ibsfuncs import *  # NOQA
>>> import wbia
>>> ibs = wbia.opendb(defaultdb='PZ_Master1')
>>> aid_list_ = ibs.find_unlabeled_name_members(suspect_yaws=True)
>>> aid_list = ibs.filter_aids_to_quality(aid_list_, 'good', unknown_ok=False)
>>> ibs.start_web_annot_groupreview(aid_list)
wbia.web.routes.turk_annotation_canonical(imgsetid=None, samples=200, species=None, version=1, **kwargs)[source]
wbia.web.routes.turk_annotation_dynamic(**kwargs)[source]
wbia.web.routes.turk_cameratrap(**kwargs)[source]
wbia.web.routes.turk_contour(part_rowid=None, imgsetid=None, previous=None, **kwargs)[source]
wbia.web.routes.turk_demographics(species='zebra_grevys', aid=None, **kwargs)[source]
wbia.web.routes.turk_detection(gid=None, only_aid=None, refer_aid=None, imgsetid=None, previous=None, previous_only_aid=None, staged_super=False, progress=None, **kwargs)[source]
wbia.web.routes.turk_detection_canonical(aid=None, imgsetid=None, previous=None, previous_only_aid=None, **kwargs)[source]
wbia.web.routes.turk_detection_dynamic(**kwargs)[source]
wbia.web.routes.turk_identification(aid1=None, aid2=None, use_engine=False, global_feedback_limit=50, **kwargs)[source]
CommandLine:
python -m wbia.web.routes turk_identification –db PZ_Master1 python -m wbia.web.routes turk_identification –db PZ_MTEST python -m wbia.web.routes turk_identification –db testdb1 –show

Example

>>> # SCRIPT
>>> from wbia.other.ibsfuncs import *  # NOQA
>>> import wbia
>>> web_ibs = wbia.opendb_bg_web('testdb1')
>>> resp = web_ibs.get('/turk/identification/lnbnn/')
>>> web_ibs.terminate2()
>>> ut.quit_if_noshow()
>>> import wbia.plottool as pt
>>> ut.render_html(resp.content)
>>> ut.show_if_requested()
wbia.web.routes.turk_identification_graph(graph_uuid=None, aid1=None, aid2=None, annot_uuid_list=None, hardcase=None, view_orientation='vertical', view_version=1, hogwild=False, hogwild_species=None, creation_imageset_rowid_list=None, kaia=False, **kwargs)[source]
CommandLine:

python -m wbia.web.routes turk_identification_graph –db PZ_Master1 python -m wbia.web.routes turk_identification_graph –db PZ_MTEST python -m wbia.web.routes turk_identification_graph –db testdb1 –show

python -m wbia –db PZ_MTEST –web –browser –url=/turk/identification/graph/ –noengine

Example

>>> # SCRIPT
>>> from wbia.other.ibsfuncs import *  # NOQA
>>> import wbia
>>> web_ibs = wbia.opendb_bg_web('testdb1')
>>> resp = web_ibs.get('/turk/identification/graph/')
>>> web_ibs.terminate2()
>>> ut.quit_if_noshow()
>>> import wbia.plottool as pt
>>> ut.render_html(resp.content)
>>> ut.show_if_requested()
wbia.web.routes.turk_identification_graph_refer(imgsetid, species=None, tier=1, year=2019, option=None, **kwargs)[source]
wbia.web.routes.turk_identification_hardcase(*args, **kwargs)[source]
CommandLine:

python -m wbia –db PZ_MTEST –web –browser –url=/turk/identification/hardcase/ python -m wbia –db PZ_MTEST –web –browser –url=/turk/identification/graph/

>>> # SCRIPT
>>> from wbia.other.ibsfuncs import *  # NOQA
>>> import wbia
>>> web_ibs = wbia.opendb_bg_web('PZ_Master1')
>>> resp = web_ibs.get('/turk/identification/hardcase/')
>>> web_ibs.terminate2()
Ignore:

import wbia ibs, aids = wbia.testdata_aids(‘PZ_Master1’, a=’:species=zebra_plains’) print(len(aids)) infr = wbia.AnnotInference(ibs, aids=aids, autoinit=’staging’) infr.load_published() print(ut.repr4(infr.status())) infr.qt_review_loop()

verifiers = infr.learn_evaluation_verifiers()

verif = verifiers[‘match_state’] edges = list(infr.edges()) real = list(infr.edge_decision_from(edges)) hardness = 1 - verif.easiness(edges, real)

wbia.web.routes.turk_part_types(part_rowid=None, imgsetid=None, previous=None, hotkeys=8, refresh=False, previous_part_types=None, **kwargs)[source]
wbia.web.routes.turk_quality(**kwargs)[source]
PZ Needs Tags:
17242 14468 14427 15946 14771 14084 4102 6074 3409

GZ Needs Tags; 1302

CommandLine:
python -m wbia.web.app –exec-turk_quality –db PZ_Master1 python -m wbia.web.app –exec-turk_quality –db GZ_Master1 python -m wbia.web.app –exec-turk_quality –db GIRM_Master1

Example

>>> # SCRIPT
>>> from wbia.other.ibsfuncs import *  # NOQA
>>> import wbia
>>> ibs = wbia.opendb(defaultdb='testdb1')
>>> aid_list_ = ibs.find_unlabeled_name_members(qual=True)
>>> valid_views = ['primary', 'primary1', 'primary-1']
>>> aid_list = ibs.filter_aids_to_viewpoint(aid_list_, valid_views, unknown_ok=False)
>>> ibs.start_web_annot_groupreview(aid_list)
wbia.web.routes.turk_species(hotkeys=8, refresh=False, previous_species_rowids=None, **kwargs)[source]
wbia.web.routes.turk_splits(aid=None, **kwargs)[source]
wbia.web.routes.turk_viewpoint(**kwargs)[source]
CommandLine:
python -m wbia.web.app –exec-turk_viewpoint –db PZ_Master1

Example

>>> # SCRIPT
>>> from wbia.other.ibsfuncs import *  # NOQA
>>> import wbia
>>> ibs = wbia.opendb(defaultdb='PZ_Master1')
>>> aid_list_ = ibs.find_unlabeled_name_members(suspect_yaws=True)
>>> aid_list = ibs.filter_aids_to_quality(aid_list_, 'good', unknown_ok=False)
>>> ibs.start_web_annot_groupreview(aid_list)
wbia.web.routes.turk_viewpoint2(**kwargs)[source]
CommandLine:
python -m wbia.web.app –exec-turk_viewpoint –db PZ_Master1

Example

>>> # SCRIPT
>>> from wbia.other.ibsfuncs import *  # NOQA
>>> import wbia
>>> ibs = wbia.opendb(defaultdb='PZ_Master1')
>>> aid_list_ = ibs.find_unlabeled_name_members(suspect_yaws=True)
>>> aid_list = ibs.filter_aids_to_quality(aid_list_, 'good', unknown_ok=False)
>>> ibs.start_web_annot_groupreview(aid_list)
wbia.web.routes.turk_viewpoint3(**kwargs)[source]
wbia.web.routes.upload(*args, **kwargs)[source]
wbia.web.routes.upload_zip(**kwargs)[source]
wbia.web.routes.view(**kwargs)[source]
wbia.web.routes.view_advanced0(**kwargs)[source]
wbia.web.routes.view_advanced1(**kwargs)[source]
wbia.web.routes.view_advanced2(**kwargs)[source]
wbia.web.routes.view_advanced3(**kwargs)[source]
wbia.web.routes.view_advanced4(**kwargs)[source]
wbia.web.routes.view_annotations(**kwargs)[source]
wbia.web.routes.view_graphs(sync=False, **kwargs)[source]
wbia.web.routes.view_images(**kwargs)[source]
wbia.web.routes.view_imagesets(**kwargs)[source]
wbia.web.routes.view_jobs(**kwargs)[source]
wbia.web.routes.view_map(**kwargs)[source]
wbia.web.routes.view_names(**kwargs)[source]
wbia.web.routes.view_parts(pid_list=None, aid_list=None, gid_list=None, imgsetid_list=None, page=1, **kwargs)[source]
wbia.web.routes.view_viewpoints(**kwargs)[source]
wbia.web.routes.wb_counts(**kwargs)[source]
wbia.web.routes.wb_counts_alias1(**kwargs)[source]
wbia.web.routes.wb_counts_alias2(**kwargs)[source]

wbia.web.routes_ajax module

Dependencies: flask, tornado

wbia.web.routes_ajax.annotation_src(aid=None, ibs=None, **kwargs)[source]
wbia.web.routes_ajax.image_src(gid=None, thumbnail=False, ibs=None, **kwargs)[source]
wbia.web.routes_ajax.image_src_path(gpath, orient='auto', **kwargs)[source]
wbia.web.routes_ajax.part_src(part_rowid, **kwargs)[source]
wbia.web.routes_ajax.probchip_src(aid=None, ibs=None, **kwargs)[source]

wbia.web.routes_csv module

Dependencies: flask, tornado

wbia.web.routes_csv.download_associations_list(**kwargs)[source]
wbia.web.routes_csv.download_associations_matrix(**kwargs)[source]
wbia.web.routes_csv.download_sightings(**kwargs)[source]
wbia.web.routes_csv.get_aid_list_csv(**kwargs)[source]
wbia.web.routes_csv.get_annotation_special_kaia_dung_samples(**kwargs)[source]
wbia.web.routes_csv.get_annotation_special_megan(**kwargs)[source]
wbia.web.routes_csv.get_annotation_special_monica_laurel_max(desired_species=None, **kwargs)[source]
wbia.web.routes_csv.get_associations_dict(ibs, desired_species=None, **kwargs)[source]
wbia.web.routes_csv.get_demographic_info(**kwargs)[source]
wbia.web.routes_csv.get_gid_list_csv(**kwargs)[source]
wbia.web.routes_csv.get_gid_with_aids_csv(**kwargs)[source]
wbia.web.routes_csv.get_image_info(**kwargs)[source]
wbia.web.routes_csv.get_nid_with_gids_csv(**kwargs)[source]

wbia.web.routes_demo module

Dependencies: flask, tornado

wbia.web.routes_demo.demo(*args, **kwargs)[source]

wbia.web.routes_experiments module

Dependencies: flask, tornado

wbia.web.routes_experiments.experiment_init_db(tag)[source]
wbia.web.routes_experiments.experiments_image_src(tag=None, **kwargs)[source]
wbia.web.routes_experiments.experiments_interest(dbtag1='demo-jasonp', dbtag2='demo-chuck', **kwargs)[source]
wbia.web.routes_experiments.experiments_voting(**kwargs)[source]
wbia.web.routes_experiments.experiments_voting_area_src(ibs, aoi=False, **kwargs)[source]
wbia.web.routes_experiments.experiments_voting_bbox_width(ibs, **kwargs)[source]
wbia.web.routes_experiments.experiments_voting_center_src(ibs, aoi=False, **kwargs)[source]
wbia.web.routes_experiments.experiments_voting_counts(ibs, **kwargs)[source]
wbia.web.routes_experiments.experiments_voting_initialize(enabled_list=None)[source]
wbia.web.routes_experiments.experiments_voting_variance(ibs, team_index, **kwargs)[source]
wbia.web.routes_experiments.view_experiments(**kwargs)[source]
wbia.web.routes_experiments.voting_data(method=3, option='inclusive', species='all', team1=True, team2=True, team3=True, team4=True, team5=True)[source]
wbia.web.routes_experiments.voting_uuid_list(ibs, team_list)[source]

wbia.web.routes_submit module

Dependencies: flask, tornado

wbia.web.routes_submit.group_review_submit(**kwargs)[source]
CommandLine:
python -m wbia.web.app –exec-group_review_submit

Example

>>> # UNSTABLE_DOCTEST
>>> from wbia.web.app import *  # NOQA
>>> import wbia
>>> import wbia.web
>>> ibs = wbia.opendb('testdb1')
>>> aid_list = ibs.get_valid_aids()[::2]
>>> ibs.start_web_annot_groupreview(aid_list)
wbia.web.routes_submit.submit_annotation(**kwargs)[source]
wbia.web.routes_submit.submit_annotation_canonical(samples=200, species=None, version=1, **kwargs)[source]
wbia.web.routes_submit.submit_cameratrap(**kwargs)[source]
wbia.web.routes_submit.submit_contour(**kwargs)[source]
wbia.web.routes_submit.submit_demographics(species='zebra_grevys', **kwargs)[source]
wbia.web.routes_submit.submit_detection(**kwargs)[source]
wbia.web.routes_submit.submit_identification(**kwargs)[source]
wbia.web.routes_submit.submit_identification_v2(graph_uuid, **kwargs)[source]
wbia.web.routes_submit.submit_identification_v2_kaia(graph_uuid, **kwargs)[source]
wbia.web.routes_submit.submit_login(name, organization, refer=None, *args, **kwargs)[source]
wbia.web.routes_submit.submit_part_types(**kwargs)[source]
wbia.web.routes_submit.submit_quality(**kwargs)[source]
wbia.web.routes_submit.submit_species(**kwargs)[source]
wbia.web.routes_submit.submit_splits(**kwargs)[source]
wbia.web.routes_submit.submit_viewpoint(**kwargs)[source]
wbia.web.routes_submit.submit_viewpoint2(**kwargs)[source]
wbia.web.routes_submit.submit_viewpoint3(**kwargs)[source]

wbia.web.test_api module

This is a proof of concept for connecting to an authenticated Qubica Server

wbia.web.test_api.get_api_result(uri, user_email=None, user_enc_pass=None, **kwargs)[source]

Make a GET API request to the server

wbia.web.test_api.get_authorization_header(uri, user_email=None, user_enc_pass=None)[source]
wbia.web.test_api.get_signature(key, message)[source]
wbia.web.test_api.post_api_result(uri, user_email=None, user_enc_pass=None, **kwargs)[source]

Make a GET API request to the server

wbia.web.test_api.run_test_api()[source]
CommandLine:
python -m wbia.web.test_api –test-run_test_api

Example

>>> # xdoctest: +REQUIRES(--web)
>>> from wbia.web.test_api import *  # NOQA
>>> response = run_test_api()
>>> print('Server response: %r' % (response, ))
>>> result = response
(200, u'{"status": {"cache": -1, "message": "", "code": 200, "success": true}, "response": "testdb1"}', <bound method Response.json of <Response [200]>>)

Module contents