Applications - Update
Applications can be updated by posting to the application endpoint with application_id and any attributes you want to change. Following are the attributes that can be changed. Note application_id and type cannot be changed once an application is created.
An application json object with full attributes are returned.
Name | Example | Description |
---|---|---|
name string | "Person detector" | Name should be brief and descriptive |
description string | "Find people walking into the front door" | A full description of the purpose of the application. Use this field to capture detailed subject and any exceptional feedback instructions. |
input_subjects array | ["flicker_cats", "animals_pics"] | Array of input subjects id's (note that input subjects' must be already created and have a valid id before adding to an Application) |
output_subjects array | ["cat","dog","face"] | List of subject tags corresponding to objects, patterns, or features that are of interest in this application (note that output subjects' must be already created and have a valid id before adding to an Application) |
release_metrics string | "best_F1" | The performance measure used when to assess model performance. Must be one of 'best_recall', 'best_precision', 'best_F1'. Defaults to 'best_F1' |
detection_ thresholds dictionary | {"cat": 0.5, "dog": 0.7, "face": 0.5} | Map between subjects and associated probability thresholds. Detections below the specified probability threshold will not be forwarded to subsequent applications (if any). Detections below the threshold will not be posted to the detection_post_urls (if any). |
detection_ post_urls array | ["http://127.0.0.1:99/ my_model_output.net", "https://detections-now.com/detections"] | A list of URL's where model detections will be surfaced in addition to web and iOS interfaces. Posts are retried for thirty seconds, but URL's that fail retried posts after thirty seconds are blacklisted for five minutes. |
gateway_ post_urls array | ["http://127.0.0.1:99/ my_model_output.net", "https://detections-now.com/detections"] | A list of URL's where model detections will be surfaced from the gateway. Posts are retried for thirty seconds, but URL's that fail retried posts after thirty seconds are blacklisted for five minutes. Specifying a gateway post URL implies that the gateway will implement the application along with any linked applications. |
Gateway Models Staging Model ID Production Model ID string | "Hpo-d-8e49-DmDT9hhuJLSiFuWOge-YN-OW_mtsv1_INT_10000.tgz" | Specify a model for gateway use. Both fields can be left blank in which case the gateway will use latest model used in cloud infrastructure for inference. This model can either be a production or staging. Production models are considered stable, staging models can be used to validate against a known set of results prior to be migrated to production. These processes are customer driven. |
active bool | true | Flag to control if the the application is active or not. Inactive applications do not process images submitted to their input subjects or requests feed back. |
requested_ feedback_per_hour integer | 50 | Override the target rate of feedback to surface per hour. A Null or value indicates the system feedback rate should be used. The default value is Null: system selects feedback rate. Select a higher value to schedule more feedback feedback requests, or a lower value to schedule fewer feedback requests. |
refresh_feedback bool | false | Flag to control whether the images waiting for user feedback should be re-evaluated by the new model when a new model is released. |
app_managers array | ["[email protected]", "[email protected]"] | List of user email address, the users are given the app_manager role that is authorized to manage application settings and maintain feedback control. |
POST /1/applications/{application_id}
Host: https://api.cogniac.io
Example: Update an Application
curl -X POST https://api.cogniac.io/1/applications/di71rG94 \
-H "Authorization: Bearer abcdefg.hijklmnop.qrstuvwxyz" \
-H "Content-Type: application/json" \
-d '{
"name":"Test App Updated",
"description":"Application Description Updated",
"output_subjects":["cat","dog","horse"],
"release_metrics":"best_F1",
"detection_thresholds":{"cat": 0.5, "dog": 0.7, "horse": 0.5}
}'
import cogniac
# connect to the tenant
cc = cogniac.CogniacConnection(username="[email protected]",
password="myPassword",
tenant_id="63QhzFLc9tg4")
# get the app object
my_app = cc.get_application('di71rG94')
# Add new subjects with the 'add_output_subjects' method
new_subj = cc.create_subject('horse')
my_app.add_output_subjects(new_subj)
# Update application attribbutes
# by updating Cogniac app object attributes
my_app.name = 'Test App Updated'
my_app.description = 'Application Description Updated'
my_app.detection_thresholds = {"cat": 0.5, "dog": 0.7, new_subj.subject_uid: 0.5})
{
"application_id": "di71rG94",
"tenant_id": "abcdefghijk",
"name": "Test App Updated",
"description": "Application Description Updated",
"type": "classification",
"release_metrics": "best_F1",
"input_subjects": [
"123",
"456"
],
"output_subjects": [
"cat",
"dog",
"horse"
],
"detection_thresholds": {
"dog": 0.7,
"cat": 0.5,
"horse": 0.5
},
"active": true,
"refresh_feedback": false,
"app_managers": [
"[email protected]"
],
"detection_post_urls": [
"http://example.com/cogniac-post"
],
"gateway_post_urls": [],
"custom_fields": {},
"hpo_credit": 1,
"created_by": "[email protected]",
"created_at": 1508537094.552487,
"modified_at": 1508550643.610814,
"system_feedback_per_hour": 0,
"requested_feedback_per_hour": null,
"release_model_count": 1,
"best_model_ccp_filename": "InitialModel_di71rG94_lWPACS.tgz",
"candidate_model_count": 2,
"current_performance": null,
"last_candidate_at": 1508537109.651132,
"last_released_at": null,
"training_data_count": null,
"validation_data_count": null,
"replay": false,
}
Updated over 5 years ago