- 22 Dec 2023
- 5 Minutes to read
- Print
- DarkLight
Applications - Update
- Updated on 22 Dec 2023
- 5 Minutes to read
- Print
- DarkLight
Applications can be updated by posting to the application endpoint with application_id and any attributes you want to change. The following are the attributes that can be changed. Note that application_id and type cannot be changed once an application is created.
An application JSON object with complete attributes is returned.
Name | Example | Description |
---|---|---|
name | "Person detector" | Name should be brief and descriptive |
description | "Find people walking | A full description of the purpose of the application. Use this field to capture detailed subjects and any exceptional feedback instructions. |
input_subjects | ["flicker_cats", | Array of |
output_subjects | ["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 | "best_F1" | The performance measure used to assess model performance. |
detection_ | {"cat": 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_ | ["http://127.0.0.1:99/ | A list of URL's where model detections will be surfaced in addition to web and iOS interfaces. |
gateway_ | ["http://127.0.0.1:99/ | A list of URL's where model detections will be surfaced from the gateway. |
Gateway Models | "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 the 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 being migrated to production. These processes are customer-driven. |
active | true | Flag to control if the application is active or not. Inactive applications do not process images submitted to their input subjects or request feedback. |
requested_ | 50 | Override the target rate of feedback to surface per hour. |
refresh_feedback | false | Flag to control whether the new model should re-evaluate the images waiting for user feedback when a new model is released. |
app_managers | ["user1@email.com", "user2@email.com"] | List of user email addresses, the users are given the app_manager role that is authorized to manage application settings and maintain feedback control. |
Update Application
POST /1/applications/{application_id}
Host: https://api.cogniac.io
Example: Update an Application
import cogniac
# connect to the tenant
cc = cogniac.CogniacConnection(username="testuser@cogniac.co",
password="password",
tenant_id="abcdefghijk")
# get the app object
my_app = cc.get_application('m6fqjxjn')
# Add new subject with the 'add_input_subjects' method
new_subj = cc.create_subject('horse')
my_app.add_input_subject(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}
{
"active" : true,
"app_managers" : [
"testuser@cogniac.co"
],
"app_type_config" : {
"fps_requirement" : null,
"model_constraint_types" : null,
"output_top_N" : 1,
"show_heatmap" : true
},
"application_id" : "rjcrnrgi",
"candidate_model_count" : 0,
"consensus_release_id" : null,
"consensus_release_timestamp" : null,
"created_at" : 1701128008.92167,
"created_by" : "testuser@cogniac.co",
"current_performance" : null,
"custom_fields" : {
"evaluate_training" : false,
"gateway_lower_detection_probability" : 0,
"gateway_upper_detection_probability" : 0.5,
"show_heatmap" : true
},
"description" : "Application Description Updated",
"detection_post_line_users" : [],
"detection_post_urls" : [
"http://example.com/cogniac-post"
],
"detection_thresholds" : {
"cat" : 0.5,
"dog" : 0.7
},
"drop_input_focus" : false,
"edgeflow_upload_policies" : [],
"feedback_resample_ratio" : null,
"gateway_post_urls" : [],
"gpu_memory_gigabytes" : null,
"gpu_throughput_megapixels_per_second" : null,
"hpo_credit" : 0,
"inference_execution_policies" : {
"max_batch" : 8,
"replicas" : 1,
"runtime_policy" : {
"gpu_selection_policy" : "by-free-memory",
"gpu_simul_load" : 1,
"model_load_policy" : "realtime",
"model_seconds" : 0,
"rtc_timeout_seconds" : 5
}
},
"input_queue_count" : 0,
"input_subjects" : [],
"input_threshold" : null,
"last_candidate_at" : null,
"last_eval_time" : null,
"last_released_at" : null,
"max_gpu_throughput_megapixels_per_second" : null,
"model_id" : null,
"model_image_id" : null,
"model_initialization_time_seconds" : null,
"model_runtime_image" : null,
"modified_at" : 1701128008.92167,
"name" : "Test App Updated",
"output_subjects" : [
"dog",
"cat"
],
"output_subjects_external_ids" : {},
"override_upstream_detection_filter" : false,
"production_gateway_model_id" : "disabled",
"realtime" : false,
"refresh_feedback" : false,
"release_metrics" : "best_F1",
"release_model_count" : 0,
"replay" : false,
"requested_feedback_per_hour" : null,
"staging_gateway_model_id" : "disabled",
"system_feedback_per_hour" : 0,
"tenant_id" : " abcdefg.hijk",
"training_data_count" : null,
"training_summary" : {
"training_in_progress" : 0
},
"type" : "classification",
"validation_data_count" : null
}