Applications - Create

Applications can be created by posting to application endpoint with following arguments, with only name and type are required. Input and output subjects are optional but the application is not useful until they are specified. And they can only be specified if the subjects already exists.

An application json object with full attributes are returned.

NameExampleDescription
name
string
"Person detector"(required) Name should be brief and descriptive
type
string
"classification"(required) Cogniac appliction type, see type string in valid application type below
description
string
"Find people walking
into the front door"
(optional) 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"]
(optional) 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"](optional) 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"(optional) 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}
(optional) Map between subject_uid's 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"]
(optional) 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"]
(optional) 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.
active
bool
true(optional) 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(optional) 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(optional) 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]"]_(optional)_List of user email address, the users are given the app_manager role that is authorized to manage application settings and maintain feedback control.

Create Application

POST /1/applications
Host: https://api.cogniac.io

Example: Create a New Application

curl -X POST https://api.cogniac.io/1/applications \
-H "Authorization: Bearer abcdefg.hijklmnop.qrstuvwxyz" \
-H "Content-Type: application/json" \
-d '{ 
"name": "Test App",
"type": "classification",
"description": "App For Testing",
"output_subjects": ["cat", "dog"],
"detection_post_urls": ["http://example.com/cogniac-post"]
}'
import cogniac

# connect to the tenant
cc = cogniac.CogniacConnection(username="[email protected]", 
                               password="myPassword", 
                               tenant_id="63QhzFLc9tg4")

# create the application with keyword arguments
cc.create_application(name='Test App',
                      application_type='classification,
                      description='App For Testing',
                      output_subjects=['cat', 'dog'],
                      detection_post_urls=['http://example.com/cogniac-post'])

🚧

Application Subjects

The input and output subjects must already exist in the system. Otherwise the above call will result in and error. One can always create applications without input and output subjects and add them later with an application update.

{
    "application_id": "di71rG94",
    "tenant_id": "abcdefghijk",
    "name": "Test App",
    "description": "App For Testing",
    "type": "classification",
    "release_metrics": "best_F1",
    "output_subjects": [
        "cat",
        "dog"
    ],
    "detection_thresholds": {
        "dog": 0.0,
        "cat": 0.0
    },
    "active": true,
    "refresh_feedback": false,
    "app_managers": [
        "[email protected]"
    ],
    "detection_post_urls": [
        "http://example.com/cogniac-post"
    ],
    "gateway_post_urls": [],
    "custom_fields": {},
    "hpo_credit": 0,
    "created_by": "[email protected]",
    "created_at": 1508537094.552487,
    "modified_at": 1508537094.552487,
    "system_feedback_per_hour": 0,
    "requested_feedback_per_hour": null,   
    "release_model_count": null,
    "best_model_ccp_filename": null,
    "candidate_model_count": null,
    "current_performance": null,
    "last_candidate_at": null,
    "last_released_at": null,
    "training_data_count": null,
    "validation_data_count": null,
    "replay": false,
}

Valid Application Types

NameType stringDescription
ClassificationclassificationClassify the full input image as exactly one subject to the mutual exclusion of the other subjects
Detection Full-framedetection_fullframeDetect the presence of one or more objects of interest in a full-frame image
Detectionbox_detectionDetection with bounding boxes
Optical Character Recognitionocrreads a limited set of characters against a noisy real-world (non-document) image background
Static Countstatic_countcount number of objects of interest in an image
Left Offsetoffset_xMeasure the pixel distances from the LEFT frame edge to the subjects of interest
Top Offsetoffset_yMeasure the pixel distances from the TOP frame edge to the subjects of interest
Point DetectionpointLocate a point coordinate for each object of interest
Motion DetectionmotionPerform motion detection based on background subtraction
Static Cropstatic_cropPerform a static crop at fixed coordinates. Negative numbers indicate the right-most or bottom pixel dimension of the image
Network Cameranetwork_cameraPull images from network cameras and capture to a subject.
TwittertwitterCapture images from twitter to the indicated subjects
Video Segmentationvideo_segmentationSegment video files into individual frames or smaller segments

Other application types available by special arrangement include:

NameType stringDescription
Line Crossingline_crossingCounts number of objects crossing lines set by users! A dynamic tracking app must be an immediate upstream app!
Dynamic Trackingdynamic_trackingTrack boxed objects in videos or real-time video streams! A detection app must be an immediate upstream app
DroneDeploy RetilerretilerRecombine DroneDeploy plan tiles into larger sub-plans of their original plan. Sub-plan size is given by configuration items 'max_height' and 'max_width'
Static Focusstatic_focusAdd the fixed focus on the media to indicate the area of interests to downstream apps. If a fixed coordinate is beyond the corresponding limit of the media, the focus at the coordinate will be set at the limit. If constant_focus_box_size is set to 1, the size of the focus box will be maintained at the time when a coordinate is beyond a media limit. If all the fixed coordinates are beyond the limits of media, no focus will be added.
NSFW DetectionnsfwDetect the presence of explicit (NSFW) content.