Python matcher Cross Matcher handler

Cross-matching handler.

class luna_python_matcher.app.handlers.cross_matcher_handler.BodyCrossMatcherHandler(request)[source]

Cross-matching handler to implement work with body descriptors.

Resource: “/{api_version}/crossmatcher/bodies”

property descriptorVersion: int

Default human descriptor version.

Return type:

int

class luna_python_matcher.app.handlers.cross_matcher_handler.CrossMatcherBaseHandler(request)[source]

Base cross-matching handler

property configLunaEventsUsage: bool

Get luna-events service usages :returns: True if luna-events service is used

Return type:

bool

abstract property descriptorType: DescriptorType

The tool descriptor type. Must be overridden.

Return type:

DescriptorType

abstract property descriptorVersion: int

The tool descriptor version. Must be overridden.

Return type:

int

getFiltersFromJson(inputJson, objectType)[source]

Check account ids from request and luna-events services usage and get filters :param inputJson: input json :param objectType: candidates or references

Returns:

candidate filters and reference filters

Return type:

Union[FaceFilters, EventFilters]

async getPreparedFiltersAndCheckListsExistence(filters)[source]

Get filters prepared for reply :param filters: filters

Returns:

dict with filters prepared for reply

Return type:

dict

async post()[source]

Search for faces/events by given filters and matching them with each other. To work with face descriptors, see crossmatch_faces or crossmatch_bodies for body descriptors.

Returns:

response with cross matching results

Return type:

HTTPResponse

validateCrossMatchJson(inputJson)[source]

Validate input json. If error in candidates schemas - validate it separately and raise error with updated detail :param inputJson: inputJson from request

Raises:

VLException(Error.BadInputJson, 400, False) if fail to validate input json

Return type:

None

class luna_python_matcher.app.handlers.cross_matcher_handler.FaceCrossMatcherHandler(request)[source]

Cross-matching handler to implement work with face descriptors.

Resource: “/{api_version}/crossmatcher/faces”

property descriptorVersion: int

Default face descriptor version.

Return type:

int

class luna_python_matcher.app.handlers.cross_matcher_handler.UnwantedCrossMatcherHandler(request)[source]

Unwanted handler for face cross-matching

Resource: “/{api_version}/crossmatcher” alias for “/{api_version}/crossmatcher/bodies”

async post()[source]

Print warning also.

Return type:

HTTPResponse