Events handler

Handler is a constructor for the user input images processing rules. Handler has five processing steps:

  1. Detect faces. User can set a list attributes for estimation and head angle thresholds.

  2. Extract attributes. User can define which attributes should be extracted (basic attributes, face or body descriptors or both).

  3. Match extracted descriptors by lists. User can define luna lists for matching and rules for matching.

  4. Create objects using the extracted data and store them. User can define rules for creating samples, attributes, faces or even events. Also, see link policy inside the face storage policy - linking created faces to lists.

For detail see spec_create_new_handler.

Handler for a certain handler.

class luna_api.app.handlers.handlers_proxy_handler.CountHandlerProxyHandler(request)[source]

Proxy handler replace handler. See spec_handlers_count.

Resource: “/{api_version}/handlers/count”

class luna_api.app.handlers.handlers_proxy_handler.DetectorProxyHandler(request)[source]

Proxy handler for detecting faces on images. See spec_detector.

Resource: “/{api_version}/detector”

async postProcessingPost(response)[source]

Post processing response from the service.

class luna_api.app.handlers.handlers_proxy_handler.EventHandlerProxyHandler(request)[source]

Proxy handler for SDK estimations. See spec_emit_events.

Resource: “/{api_version}/handlers/{handler_id}/events”

async postProcessingPost(response)[source]

Post processing response from the service.

class luna_api.app.handlers.handlers_proxy_handler.EventRawHandlerProxyHandler(request)[source]

Proxy handler for save raw event. See spec_save_event.

Resource: “/{api_version}/handlers/{handler_id}/events/raw”

async checkExistingObject(container, queryValue)[source]

Check existing object by account id.

Parameters:
  • container – container class with request client and possible error

  • queryValue – query value

Raises:

VLException(Error.ObjectNotFound, 404) if object not found

Return type:

None

async checkObjectsBelongToAccount()[source]

Check that event objects are associated with an account.

Returns:

Proxy request with raw event

Return type:

ProxyRequest

async postProcessingPost(response)[source]

Post processing response from the service.

async prepareRequestPost()[source]

Prepare proxy request for method post.

Returns:

Proxy request with raw event

Return type:

ProxyRequest

class luna_api.app.handlers.handlers_proxy_handler.ExtractorProxyHandler(request)[source]

Proxy handler for extracting attributes such as gender, age, ethnicity, descriptor from samples. See spec_extractor.

Resource: “/{api_version}/extractor”

async postProcessingPost(response)[source]

Post processing response from the service.

class luna_api.app.handlers.handlers_proxy_handler.HandlerProxyHandler(request)[source]

Proxy handler replace handler. See spec_handlers_handler.

Resource: “/{api_version}/handlers/{handlerId}”

async prepareRequestPut()[source]

Prepare proxy request for method put :returns: proxy request

Return type:

ProxyRequest

class luna_api.app.handlers.handlers_proxy_handler.HandlerVerifyRawProxy(request)[source]

Proxy handler for SDK estimations. See spec_verifiers.

Resource: “/{api_version}/verifiers/{verifier_id}/raw”

class luna_api.app.handlers.handlers_proxy_handler.HandlersProxyHandler(request)[source]

Proxy handler for create new handlers. See spec_handlers.

Resource: “/{api_version}/handlers”

async postProcessingPost(response)[source]

Default post processing response from the service :param response: response

Returns:

response in api format

Return type:

HTTPResponse

async prepareRequestPost()[source]

Prepare proxy request for method post :returns: proxy request

Return type:

ProxyRequest

class luna_api.app.handlers.handlers_proxy_handler.HandlersValidatorProxyHandler(request)[source]

Proxy handler for validate handler policies. See spec_validate_handler_policies.

Resource: “/{api_version}/handlers/validator”

async prepareRequestPost()[source]

Prepare proxy request for method post :returns: proxy request

Return type:

ProxyRequest

class luna_api.app.handlers.handlers_proxy_handler.ISOHandlerProxyHandler(request)[source]

Proxy handler for ISO estimations.See spec_iso.

Resource: “/{api_version}/iso”

class luna_api.app.handlers.handlers_proxy_handler.RawEventObjectContainer(globPathToObject, queryName, client, objectNotFoundError)[source]

Event object container for checking its existence in the service.

class luna_api.app.handlers.handlers_proxy_handler.SDKHandlerProxyHandler(request)[source]

Proxy handler for SDK estimations.See spec_sdk.

Resource: “/{api_version}/sdk”

class luna_api.app.handlers.handlers_proxy_handler.VerifierCountHandlerProxy(request)[source]

Proxy handler for SDK estimations. See spec_verifiers.

Resource: “/{api_version}/verifiers/count”

class luna_api.app.handlers.handlers_proxy_handler.VerifierHandlerProxy(request)[source]

Proxy handler for SDK estimations. See spec_verifiers.

Resource: “/{api_version}/verifiers/{verifier_id}”

async prepareRequestPut()[source]

Prepare proxy request for method put :returns: proxy request

Return type:

ProxyRequest

class luna_api.app.handlers.handlers_proxy_handler.VerifierVerificationsHandlerProxy(request)[source]

Proxy handler for SDK estimations. See spec_verifiers.

Resource: “/{api_version}/verifiers/{verifier_id}/verifications”

class luna_api.app.handlers.handlers_proxy_handler.VerifiersHandlerProxy(request)[source]

Proxy handler for verifiers. See spec_verifiers.

Resource: “/{api_version}/verifiers”

async postProcessingPost(response)[source]

Default post processing response from the service :param response: response

Returns:

response in api format

Return type:

HTTPResponse

async prepareRequestPost()[source]

Prepare proxy request for method post :returns: proxy request

Return type:

ProxyRequest