Luna services clients description
Here presented possibilities of luna-services clients.
Events client
The luna-events client which allows to create events, get events and get events statistics
Module contains luna-events client adapted for usage in lambda
- class luna_lambda_tools.public.clients.events.Events(eventsClient, accountId)[source]
- Luna-events client - checkGeneralEvent(eventId, **kwargs)[source]
- Check general event existence by id. - Parameters:
- eventId ( - str) – event id
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with events will be returned. 
- Return type:
- class 
 
 - deleteEvents(target=None, handlerId=None, createTimeGte=None, createTimeLt=None, insertTimeGte=None, insertTimeLt=None, raiseError=True, **kwargs)[source]
- Delete events by filters. - Parameters:
- target ( - list[- str] |- None) – event deletion info targets
- handlerId ( - str|- None) – event handler id
- createTimeGte ( - str|- None) – lower including create time boundary
- createTimeLt ( - str|- None) – upper excluding create time boundary
- insertTimeGte ( - str|- None) – lower including insert time boundary
- insertTimeLt ( - str|- None) – upper excluding insert time boundary
- raiseError ( - bool) – whether to raise LunaApiException in case of failure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with events will be returned. 
- Return type:
- class 
 
 - deleteGeneralEvents(eventType=None, eventCreateTimeGte=None, eventCreateTimeLt=None, insertTimeGte=None, insertTimeLt=None, **kwargs)[source]
- Delete general events by filters. - Parameters:
- eventType ( - list[- str] |- None) – general event types
- eventCreateTimeGte ( - str|- None) – lower including create time boundary
- eventCreateTimeLt ( - str|- None) – upper excluding create time boundary
- insertTimeGte ( - str|- None) – lower including insert time boundary
- insertTimeLt ( - str|- None) – upper excluding insert time boundary
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with events will be returned. 
- Return type:
- class 
 
 - getDeletedGeneralEvents(deletionTimeGte=None, deletionTimeLt=None, eventIds=None, eventIdGte=None, eventIdLt=None, *, page=1, pageSize=10, order='desc', **kwargs)[source]
- Get deleted general events. - Parameters:
- deletionTimeGte ( - str|- None) – lower including deletion time boundary
- deletionTimeLt ( - str|- None) – upper excluding end time boundary
- eventIds ( - list[- str] |- None) – event ids
- eventIdGte ( - str|- None) – event id lower including bound
- eventIdLt ( - str|- None) – event id upper excluding bound
- page ( - int|- None) – number of result page
- pageSize ( - int|- None) – count of results in page
- order ( - str|- None) – result sort order (ask or desc)
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with events will be returned. 
- Return type:
- class 
 
 - getEvent(eventId, target=None, raiseError=True, **kwargs)[source]
- Get event by id. - Parameters:
- eventId ( - str) – event id
- target ( - list[- Literal[- 'account_id',- 'create_time',- 'end_time',- 'event_id',- 'handler_id',- 'external_id',- 'source',- 'stream_id',- 'top_match',- 'match_result',- 'face_detections',- 'face_id',- 'attach_result',- 'gender',- 'age',- 'emotion',- 'ethnic_group',- 'liveness',- 'deepfake',- 'body_detections',- 'body_basic_attributes',- 'upper_body',- 'lower_body',- 'accessories',- 'tags',- 'user_data',- 'location',- 'mask',- 'track_id',- 'meta']] |- None) – list of events’ fields to receive instead of full events
- raiseError ( - bool) – whether to raise LunaApiException in case of failure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with events will be returned. 
- Return type:
- class 
 
 - getEventDescriptor(eventId=None, descriptorVersion=None, descriptorType=None, raiseError=True, **kwargs)[source]
- Get event descriptor by filters. - Parameters:
- eventId ( - str|- None) – event id
- descriptorVersion ( - int|- None) – descriptor version
- descriptorType ( - str|- None) – Kind of the descriptor (body or face)
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with event descriptor will be returned. 
- Return type:
- class 
 
 - getEvents(target=None, createTimeGte=None, createTimeLt=None, endTimeGte=None, endTimeLt=None, eventIds=None, eventIdGte=None, eventIdLt=None, handlerIds=None, externalIds=None, topMatchingCandidatesLabel=None, topSimilarObjectIds=None, topSimilarExternalIds=None, topSimilarObjectSimilarityGte=None, topSimilarObjectSimilarityLt=None, ageLt=None, ageGte=None, gender=None, emotions=None, masks=None, ethnicGroups=None, liveness=None, apparentAgeGte=None, apparentAgeLt=None, apparentGender=None, headwearStates=None, headwearApparentColors=None, sleeveLengths=None, upperClothingColors=None, lowerGarmentTypes=None, lowerGarmentColors=None, shoesApparentColors=None, backpackStates=None, faceIds=None, userData=None, page=1, pageSize=10, order='desc', sources=None, tags=None, cities=None, areas=None, districts=None, streets=None, houseNumbers=None, originLongitude=None, originLatitude=None, longitudeDelta=None, latitudeDelta=None, trackIds=None, meta=None, raiseError=True, **kwargs)[source]
- Get events by filters. - Parameters:
- target ( - list[- Literal[- 'account_id',- 'create_time',- 'end_time',- 'event_id',- 'handler_id',- 'external_id',- 'source',- 'stream_id',- 'top_match',- 'match_result',- 'face_detections',- 'face_id',- 'attach_result',- 'gender',- 'age',- 'emotion',- 'ethnic_group',- 'liveness',- 'deepfake',- 'body_detections',- 'body_basic_attributes',- 'upper_body',- 'lower_body',- 'accessories',- 'tags',- 'user_data',- 'location',- 'mask',- 'track_id',- 'meta']] |- None) – list of events’ fields to receive instead of full events
- createTimeGte ( - str|- None) – lower including create time boundary
- createTimeLt ( - str|- None) – upper excluding create time boundary
- endTimeGte ( - str|- None) – lower including end time boundary
- endTimeLt ( - str|- None) – upper excluding end time boundary
- faceIds ( - list[- str] |- None) – ids of faces linked with an event
- eventIds ( - list[- str] |- None) – event ids
- eventIdGte ( - str|- None) – event id lower including bound
- eventIdLt ( - str|- None) – event id upper excluding bound
- handlerIds ( - list[- str] |- None) – handler ids
- externalIds ( - list[- str] |- None) – external ids
- userData ( - str|- None) – event user data
- sources ( - list[- Union[- str,- Literal[- 'null']]] |- None) – list of source
- tags ( - list[- str] |- None) – users tags
- topMatchingCandidatesLabel ( - str|- None) – top matching candidates label
- topSimilarObjectIds ( - list[- str] |- None) – top similar object ids
- topSimilarExternalIds ( - list[- str] |- None) – top similar external ids
- topSimilarObjectSimilarityGte ( - float|- None) – lower including top similarity boundary
- topSimilarObjectSimilarityLt ( - float|- None) – upper excluding top similarity boundary
- ageLt ( - int|- None) – upper excluding age boundary
- ageGte ( - int|- None) – lower including age boundary
- gender ( - Union[- int,- Literal[- 'null'],- None]) – gender of event (0 or 1)
- emotions ( - list[- Union[- int,- Literal[- 'null']]] |- None) – dominant emotions in event (one of (1, 2, 3, 4, 5, 6, 7) - matches “anger”, “disgust”, “fear”, “happiness”, “neutral”, “sadness”, “surprise”)
- masks ( - list[- Union[- int,- Literal[- 'null']]] |- None) – dominant masks in event (one of (1, 2, 3) - matches “missing”, “medical_mask”, “occluded”)
- ethnicGroups ( - list[- Union[- int,- Literal[- 'null']]] |- None) – dominant ethnicity of the face ((1, 2, 3, 4) - means (indian, asian, african_american, caucasian)
- liveness ( - list[- Union[- int,- Literal[- 'null']]] |- None) – dominant liveness of the face ((0, 1, 2) - means (“spoof”, “real”, “unknown”))
- apparentAgeLt ( - int|- None) – apparent age upper excluding boundary
- apparentAgeGte ( - int|- None) – apparent age upper including boundary
- apparentGender ( - Union[- list[- Literal[- 0,- 1,- 2]],- Literal[- 'null']]) – apparent gender estimation values (0 - female, 1 - male, 2 - undefined)
- headwearStates ( - list[- Union[- Literal[- 0,- 1,- 2],- Literal[- 'null']]] |- None) – headwear states (0 - absent, 1 - present, 2 - undefined)
- headwearApparentColors ( - list[- Union[- Literal[- 'undefined',- 'black',- 'white',- 'other'],- Literal[- 'null']]] |- None) – headwear apparent colors
- sleeveLengths ( - list[- Literal[- 'short',- 'long',- 'undefined',- 'null']] |- None) – sleeve lengths
- upperClothingColors ( - list[- Union[- Literal[- 'black',- 'blue',- 'green',- 'gray',- 'orange',- 'purple',- 'red',- 'white',- 'yellow',- 'pink',- 'brown',- 'beige',- 'khaki',- 'multicolored',- 'undefined'],- Literal[- 'null']]] |- None) – upper clothing colors
- lowerGarmentTypes ( - list[- Literal[- 'undefined',- 'trousers',- 'shorts',- 'skirt',- 'null']] |- None) – lower garment types
- lowerGarmentColors ( - list[- Union[- Literal[- 'black',- 'blue',- 'green',- 'gray',- 'orange',- 'purple',- 'red',- 'white',- 'yellow',- 'pink',- 'brown',- 'beige',- 'khaki',- 'multicolored',- 'undefined'],- Literal[- 'null']]] |- None) – lower garment colors
- shoesApparentColors ( - list[- Union[- Literal[- 'undefined',- 'black',- 'white',- 'other'],- Literal[- 'null']]] |- None) – shoes apparent colors
- backpackStates ( - list[- Union[- Literal[- 0,- 1,- 2],- Literal[- 'null']]] |- None) – backpack states (0 - absent, 1 - present, 2 - undefined)
- areas ( - list[- Union[- str,- Literal[- 'null']]] |- None) – list of areas
- streets ( - list[- Union[- str,- Literal[- 'null']]] |- None) – list of streets
- districts ( - list[- Union[- str,- Literal[- 'null']]] |- None) – list of districts
- cities ( - list[- Union[- str,- Literal[- 'null']]] |- None) – list of cities
- houseNumbers ( - list[- Union[- str,- Literal[- 'null']]] |- None) – list of house numbers
- originLongitude ( - Union[- float,- Literal[- 'null'],- None]) – origin longitude in degrees
- originLatitude ( - Union[- float,- Literal[- 'null'],- None]) – origin latitude in degrees
- longitudeDelta ( - float|- None) – longitude delta in degrees
- latitudeDelta ( - float|- None) – latitude delta in degrees
- trackIds ( - list[- Union[- str,- Literal[- 'null']]] |- None) – list of track ids
- meta ( - dict|- None) – user-defined event meta’s filters in format {meta.<path.to.field>__<operator>:<type>: <value>}
- page ( - int|- None) – number of result page
- pageSize ( - int|- None) – count of results in page
- order ( - str|- None) – result sort order (ask or desc)
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with events will be returned. 
- Return type:
- class 
 
 - getEventsStats(query=<luna3.common.http_objs.StatQuery object>, raiseError=True, **kwargs)[source]
- Get events statistics by aggregation (<aggregator> and <groupBy> on <target>) and filters. - Parameters:
- query ( - StatQuery) – query object or query dict, contained in StatQuery object
- raiseError ( - bool) – whether to raise LunaApiException in case of failure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with event statistics will be returned. 
- Return type:
- class 
 
 - getGeneralEvent(eventId, **kwargs)[source]
- Get general event by id. - Parameters:
- eventId ( - str) – event id
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with events will be returned. 
- Return type:
- class 
 
 - getGeneralEvents(eventType=None, createTimeGte=None, createTimeLt=None, endTimeGte=None, endTimeLt=None, insertTimeGte=None, insertTimeLt=None, eventIds=None, eventIdGte=None, eventIdLt=None, sources=None, streamIds=None, trackIds=None, cities=None, areas=None, districts=None, streets=None, houseNumbers=None, originLongitude=None, originLatitude=None, longitudeDelta=None, latitudeDelta=None, eventContentFilters=None, *, page=1, pageSize=10, order='desc', **kwargs)[source]
- Get general events by filters. - Parameters:
- eventType ( - list[- str] |- None) – general event types
- createTimeGte ( - str|- None) – lower including create time boundary
- createTimeLt ( - str|- None) – upper excluding create time boundary
- endTimeGte ( - str|- None) – lower including end time boundary
- endTimeLt ( - str|- None) – upper excluding end time boundary
- insertTimeGte ( - str|- None) – lower including insert time boundary
- insertTimeLt ( - str|- None) – upper excluding insert time boundary
- eventIds ( - list[- str] |- None) – event ids
- eventIdGte ( - str|- None) – event id lower including bound
- eventIdLt ( - str|- None) – event id upper excluding bound
- sources ( - list[- Union[- str,- Literal[- 'null']]] |- None) – list of sources
- streamIds ( - list[- Union[- str,- Literal[- 'null']]] |- None) – list of stream ids
- trackIds ( - list[- Union[- str,- Literal[- 'null']]] |- None) – list of track ids
- cities ( - list[- Union[- str,- Literal[- 'null']]] |- None) – list of cities
- areas ( - list[- Union[- str,- Literal[- 'null']]] |- None) – list of areas
- districts ( - list[- Union[- str,- Literal[- 'null']]] |- None) – list of districts
- streets ( - list[- Union[- str,- Literal[- 'null']]] |- None) – list of streets
- houseNumbers ( - list[- Union[- str,- Literal[- 'null']]] |- None) – list of house numbers
- originLongitude ( - Union[- float,- Literal[- 'null'],- None]) – origin longitude in degrees
- originLatitude ( - Union[- float,- Literal[- 'null'],- None]) – origin latitude in degrees
- longitudeDelta ( - float|- None) – longitude delta in degrees
- latitudeDelta ( - float|- None) – latitude delta in degrees
- eventContentFilters ( - dict|- None) – event json content filters
- page ( - int|- None) – number of result page
- pageSize ( - int|- None) – count of results in page
- order ( - str|- None) – result sort order (ask or desc)
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with events will be returned. 
- Return type:
- class 
 
 - getGeneralEventsStats(query=<luna3.common.http_objs.GeneralStatQuery object>, **kwargs)[source]
- Get general events statistics by aggregation (<aggregator> and <groupBy> on <target>) and filters. - Parameters:
- query ( - StatQuery|- dict) – query object or query dict, contained in GeneralStatQuery object
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with event statistics will be returned. 
- Return type:
- class 
 
 - headEvent(eventId, raiseError=True, **kwargs)[source]
- Check event existence by id. - Parameters:
- eventId ( - str) – event id
- raiseError ( - bool) – whether to raise LunaApiException in case of failure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with events will be returned. 
- Return type:
- class 
 
 - saveEvents(events, waitEventsSaving=None, raiseError=True, **kwargs)[source]
- Save events to luna-events. - Parameters:
- events ( - list[- Event]) – list of events
- waitEventsSaving ( - bool|- None) – whether to wait events saving (response will be received only after events will be saved)
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 
 - saveGeneralEvents(events, waitEventsSaving=None, contentType='application/msgpack', **kwargs)[source]
- Save general events to luna-events. - Parameters:
- events ( - list[- GeneralEvent|- dict]) – list of events
- waitEventsSaving ( - bool|- None) – whether to wait events saving (response will be received only after events will be saved)
- contentType ( - str) – content type to use (supported now: “application/json”, “application/msgpack” (default))
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 
 
Faces client
The luna-faces client which allows to create/get/delete faces/attributes/lists
Module contains luna-faces client adapted for usage in lambda
- class luna_lambda_tools.public.clients.faces.Faces(facesClient, accountId)[source]
- Luna-faces client - createAttribute(basicAttributes=None, descriptors=None, descriptorSamples=None, basicAttributesSamples=None, xpk=None, ttl=None, raiseError=True, **kwargs)[source]
- Create new attributes. Notice that XPK argument overwrites basic attributes and descriptors above. - Parameters:
- descriptors ( - list[- bytes|- RawDescriptor] |- None) – list of descriptors different versions
- descriptorSamples ( - list[- str]) – list of warp image id from which the attribute was extracted.
- basicAttributes ( - dict|- None) – dict with basic attributes (age, gender, ethnicity)
- basicAttributesSamples ( - list[- str]) – list of warp image id from which the basic attribute was extracted.
- xpk ( - bytes) – SDKObject bytes to load attributes from
- ttl ( - int|- None) – temporary attribute ttl
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with attribute id. 
- Return type:
- class 
 
 - createFace(attributeId=None, basicAttributes=None, descriptors=None, descriptorSamples=None, basicAttributesSamples=None, eventId=None, userData='', externalId=None, avatar=None, listIds=None, raiseError=True, **kwargs)[source]
- Create new face in luna-faces - Parameters:
- attributeId ( - str|- None) – attribute id
- descriptors ( - list[- bytes|- RawDescriptor] |- None) – list of descriptors different versions
- descriptorSamples ( - list[- str]) – list of warp image id from which the attribute was extracted.
- basicAttributes ( - dict|- None) – dict with basic attributes (age, gender, ethnicity)
- basicAttributesSamples ( - list[- str]) – list of warp image id from which the basic attribute was extracted.
- eventId ( - str|- None) – reference to event which created face
- userData ( - str|- None) – face user data
- externalId ( - str|- None) – external id of the face, if it has its own mapping in the system
- avatar ( - str|- None) – face avatar url
- listIds ( - list[- str] |- None) – created face will be attach to these lists
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with created face id will be returned. 
- Return type:
- class 
 
 - createList(userData='', listId=None, raiseError=True, **kwargs)[source]
- Create list. - Parameters:
- userData ( - str) – user data
- listId ( - str|- None) – custom list id to create the list
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with created list id will be returned. 
- Return type:
- class 
 
 - deleteAttribute(attributeId, raiseError=True, **kwargs)[source]
- Delete attribute with specifeid id - Parameters:
- attributeId ( - str) – attribute id
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return response empty body. 
- Return type:
- class 
 
 - deleteFace(faceId, raiseError=True, **kwargs)[source]
- Delete face. Optional you can set, that face must belong to account. - Parameters:
- faceId ( - str) – face id
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 
 - deleteFaceAttributes(faceId, raiseError=True, **kwargs)[source]
- Delete face attributes. - Parameters:
- faceId ( - str) – face id
- raiseError ( - bool) – whether to raise LunaApiException in case of failure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse 
- Return type:
- class 
 
 - deleteFaces(faceIds, ignore=None, raiseError=True, **kwargs)[source]
- Delete faces. Optional you can set, that faces must belong to account. - Parameters:
- faceIds ( - list[- str]) – face id list
- ignore ( - int|- None) – ignore non-existing faces
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 
 - deleteList(listId, withFaces=0, raiseError=True, **kwargs)[source]
- Remove list. Optional you can set, that list must belong to account. - Parameters:
- listId ( - str) – list id
- withFaces ( - int) – remove lists and all faces witch is contained in the lists
- raiseError ( - bool) – whether to raise LunaApiException in case of failure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 
 - deleteLists(listIds, withFaces=None, raiseError=True, **kwargs)[source]
- Delete lists. Optional you can set, that lists must belong to account. - Parameters:
- listIds ( - list[- str]) – ids of lists
- withFaces ( - int) – remove lists and all the faces contained in the lists
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 
 - getAttribute(attributeId, descriptorVersion=None, targets=None, raiseError=True, **kwargs)[source]
- Retrieve a attribute by id. - Parameters:
- attributeId ( - str) – attribute id
- targets ( - list[- str] |- None) – Available targets: descriptor, basic_attributes, basic_attributes_samples, face_descriptors_samples, account_id, create_time
- descriptorVersion ( - int) – descriptor version to receive
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with attribute. 
- Return type:
- class 
 
 - getAttributeIds(listId=None, timeLt=None, timeGte=None, page=1, pageSize=1000, raiseError=True, **kwargs)[source]
- Get ids of attributes from list by period. - Parameters:
- listId ( - str|- None) – list id
- timeLt ( - str|- None) – upper bound of face update time
- timeGte ( - str|- None) – lower bound of face update time
- page ( - int|- None) – page, default 1
- pageSize ( - int|- None) – page size, default 1000, max 100000
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with attributes ids will be returned. 
- Return type:
- class 
 
 - getAttributeSamples(attributeId, raiseError=True, **kwargs)[source]
- Retrieve a attribute by id. - Parameters:
- attributeId ( - str) – attribute id
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with samples. 
- Return type:
- class 
 
 - getAttributes(attributeIds, descriptorVersion=None, targets=None, raiseError=True, **kwargs)[source]
- Get list of attributes - Parameters:
- attributeIds ( - list[- str]) – list of attributes of interest
- targets ( - list[- str] |- None) – Available targets: descriptor, basic_attributes, basic_attributes_samples, face_descriptors_samples, account_id, create_time
- descriptorVersion ( - int) – descriptor version to receive
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with version. 
- Return type:
- class 
 
 - getAttributesFromList(listId, linkKeyLt=None, linkKeyGte=None, limit=1000, parity=None, raiseError=True, **kwargs)[source]
- Get all attributes from list by period. - Parameters:
- listId ( - str) – list id
- linkKeyLt ( - str|- None) – upper including link key boundary
- linkKeyGte ( - str|- None) – lower including link key boundary
- limit ( - int|- None) – limit
- parity ( - int|- None) – if 1 - get with even and odd max link keys else max link key
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with attributes will be returned. 
- Return type:
- class 
 
 - getFace(faceId, targets=None, raiseError=True, **kwargs)[source]
- Get face by id. Optional you can set, that face must belong to account. - Parameters:
- faceId ( - str) – face id
- targets ( - list[- str] |- None) – targets to get face
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with face will be returned. 
- Return type:
- class 
 
 - getFaceAttributeSamples(faceId, raiseError=True, **kwargs)[source]
- Get face attribute samples. - Parameters:
- faceId ( - str) – face id
- raiseError ( - bool) – whether to raise LunaApiException in case of failure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with attribute samples will be returned. 
- Return type:
- class 
 
 - getFaceAttributes(faceId, targets=None, descriptorVersion=None, raiseError=True, **kwargs)[source]
- Get face attributes. - Parameters:
- faceId ( - str) – face id
- targets ( - list[- str] |- None) – targets to get face attributes. Available targets: create_time, face_descriptor, basic_attributes, face_descriptor_samples, basic_attributes_samples.
- descriptorVersion ( - int|- None) – descriptor version
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with attributes will be returned. 
- Return type:
- class 
 
 - getFaces(userData=None, eventId=None, listId=None, faceIds=None, timeLt=None, timeGte=None, page=1, pageSize=10, attributeIds=None, externalIds=None, faceIdGte=None, faceIdLt=None, targets=None, raiseError=True, **kwargs)[source]
- Get faces by filters. Optional you can set, that faces must belong to account. - Parameters:
- userData ( - str|- None) – user data, part of user data, case insensitive
- eventId ( - str|- None) – event id
- listId ( - str|- None) – list id
- faceIds ( - list[- str] |- None) – face ids
- timeLt ( - str|- None) – upper bound of face create time
- timeGte ( - str|- None) – lower bound of face create time
- page ( - int|- None) – page count, default 1
- pageSize ( - int|- None) – page size, default 10, unlimited if -1
- attributeIds ( - list[- str] |- None) – attributes ids
- externalIds ( - list[- str] |- None) – list of external identifiers of persons, if they have their own mapping in the system
- faceIdGte ( - str|- None) – lower face id including boundary
- faceIdLt ( - str|- None) – upper face id excluding boundary
- targets ( - list[- str] |- None) – targets to get faces
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with faces will be returned. 
- Return type:
- class 
 
 - getFacesAttributes(faceIds, raiseError=True, **kwargs)[source]
- Return attributeId of faces from faceIds list - Parameters:
- faceIds ( - list) – list of faceId for return their attributes
- raiseError ( - bool) – whether to raise LunaApiException in case of failure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with attributes ids will be returned. 
- Return type:
- class 
 
 - getFacesCount(userData=None, eventId=None, listId=None, faceIds=None, timeLt=None, timeGte=None, attributeIds=None, externalIds=None, faceIdGte=None, faceIdLt=None, raiseError=True, **kwargs)[source]
- Count faces by filters. Optional you can set, that faces must belong to account. - Parameters:
- userData ( - str|- None) – user data, part of user data, case insensitive
- eventId ( - str|- None) – event id
- listId ( - str|- None) – list id
- faceIds ( - list[- str] |- None) – face ids
- timeLt ( - str|- None) – upper bound of face create time
- timeGte ( - str|- None) – lower bound of face create time
- attributeIds ( - list[- str] |- None) – attributes ids
- externalIds ( - list[- str] |- None) – list of external identifiers of persons, if they have their own mapping in the system
- faceIdGte ( - str|- None) – lower face id including boundary
- faceIdLt ( - str|- None) – upper face id excluding boundary
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with number of faces will be returned. 
- Return type:
- class 
 
 - getList(listId, page=1, pageSize=10, raiseError=True, **kwargs)[source]
- Get list. Optional you can set, that list must belong to account. - Parameters:
- listId ( - str) – list id
- page ( - int|- None) – page count, default 1
- pageSize ( - int|- None) – page size, default 10
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with list will be returned. 
- Return type:
- class 
 
 - getLists(userData=None, userDataEq=None, createTimeLt=None, createTimeGte=None, lastUpdateTimeLt=None, lastUpdateTimeGte=None, listIds=None, listIdLt=None, listIdGte=None, page=1, pageSize=10, raiseError=True, **kwargs)[source]
- Get lists. Optional you can set, that lists must belong to account. - Parameters:
- userData ( - str|- None) – user data, part of user data, case sensitive
- userDataEq ( - str|- None) – user data, case sensitive
- createTimeLt ( - str|- None) – upper bound of list create time
- createTimeGte ( - str|- None) – lower bound of list create time including boundary
- lastUpdateTimeLt ( - str|- None) – upper bound of list last update time
- lastUpdateTimeGte ( - str|- None) – lower bound of list last update time including boundary
- listIdLt ( - str|- None) – upper bound of list id
- listIdGte ( - str|- None) – lower bound of list id including boundary
- listIds ( - list[- str] |- None) – list ids
- page ( - int|- None) – page, default 1
- pageSize ( - int|- None) – page size, default 10
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with lists will be returned. 
- Return type:
- class 
 
 - getListsCount(userData=None, userDataEq=None, createTimeLt=None, createTimeGte=None, lastUpdateTimeLt=None, lastUpdateTimeGte=None, listIds=None, listIdLt=None, listIdGte=None, raiseError=True, **kwargs)[source]
- Get number of lists. Optional you can set, that lists must belong to account. - Parameters:
- userData ( - str|- None) – user data, part of user data, case sensitive
- userDataEq ( - str|- None) – user data
- createTimeLt ( - str|- None) – upper bound of list create time
- createTimeGte ( - str|- None) – lower bound of list create time including boundary
- lastUpdateTimeLt ( - str|- None) – upper bound of list last update time
- lastUpdateTimeGte ( - str|- None) – lower bound of list last update time including boundary
- listIds ( - list[- str] |- None) – list ids
- listIdLt ( - str|- None) – upper bound of list id
- listIdGte ( - str|- None) – lower bound of list id including boundary
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with number of lists will be returned. 
- Return type:
- class 
 
 - headAttribute(attributeId, raiseError=True, **kwargs)[source]
- Check attributes with attribute id exists. - Parameters:
- attributeId ( - str) – attribute id
- raiseError ( - bool) – whether to raise LunaApiException in case of failure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with version. 
- Return type:
- class 
 
 - headFace(faceId, raiseError=True, **kwargs)[source]
- Check face existence by id. Optional you can set, that face must belong to account. - Parameters:
- faceId ( - str) – face id
- raiseError ( - bool) – whether to raise LunaApiException in case of failure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 
 - headList(listId, raiseError=True, **kwargs)[source]
- Check list existence. Optional you can set, that list must belong to account. - Parameters:
- listId ( - str) – list id
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 
 - linkFacesToList(listId, faceIds, raiseError=True, **kwargs)[source]
- Attach faces to list. - Parameters:
- listId ( - str) – list id
- faceIds ( - list[- str]) – face ids
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 
 - patchFace(faceId, eventId=None, userData=None, externalId=None, avatar=None, raiseError=True, **kwargs)[source]
- Update face. You can update event id, user data, attribute id. Optional you can set, that face must belong to account. - Parameters:
- faceId ( - str) – face id
- eventId ( - str|- None) – new event id
- externalId ( - str|- None) – external id of the face, if it has its own mapping in the system
- userData ( - str|- None) – new user data
- avatar ( - str|- None) – face avatar url
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 
 - patchList(listId, userData, raiseError=True, **kwargs)[source]
- Update user data of list. Optional you can set, that list must belong to account. - Parameters:
- listId ( - str) – list id
- userData ( - str) – new user data
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 
 - putAttribute(attributeId, basicAttributes=None, descriptors=None, descriptorSamples=None, basicAttributesSamples=None, xpk=None, ttl=None, force=None, raiseError=True, **kwargs)[source]
- Put attribute by id. Notice that XPK argument overwrites basic attributes and descriptors above. - Parameters:
- attributeId ( - str) – attribute id
- descriptors ( - list[- bytes|- RawDescriptor] |- None) – list of descriptors different versions
- descriptorSamples ( - list[- str]) – list of warp image id from which the attribute was extracted.
- basicAttributes ( - dict|- None) – dict with basic attributes (age, gender, ethnicity)
- basicAttributesSamples ( - list[- str]) – list of warp image id from which the basic attribute was extracted.
- xpk ( - bytes) – SDKObject bytes to load attributes from
- ttl ( - int|- None) – temporary attribute ttl
- force ( - int|- None) – replace or not existence attribute
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with version. 
- Return type:
- class 
 
 - putFace(faceId, externalId=None, attributeId=None, basicAttributes=None, descriptors=None, descriptorSamples=None, basicAttributesSamples=None, eventId=None, userData='', avatar=None, listIds=None, raiseError=True, **kwargs)[source]
- Put face in luna-faces - Parameters:
- faceId ( - str) – external face id
- externalId ( - str|- None) – external id of the face, if it has its own mapping in the system
- attributeId ( - str|- None) – attribute id
- descriptors ( - list[- bytes|- RawDescriptor] |- None) – list of descriptors different versions
- descriptorSamples ( - list[- str]) – list of warp image id from which the attribute was extracted.
- basicAttributes ( - dict|- None) – dict with basic attributes (age, gender, ethnicity)
- basicAttributesSamples ( - list[- str]) – list of warp image id from which the basic attribute was extracted.
- eventId ( - str|- None) – reference to event which created face
- userData ( - str|- None) – face user data
- avatar ( - str|- None) – face avatar url
- listIds ( - list[- str] |- None) – created face will be attach to these lists
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with face id will be returned. 
- Return type:
- class 
 
 - putFaceAttributes(faceId, attributeId=None, basicAttributes=None, descriptors=None, basicAttributesSamples=None, descriptorSamples=None, raiseError=True, **kwargs)[source]
- Put face attributes. - Parameters:
- faceId ( - str) – face id
- attributeId ( - str|- None) – attribute id
- descriptors ( - list[- bytes|- RawDescriptor] |- None) – list of descriptors different versions
- descriptorSamples ( - list[- str]) – list of warp image id from which the attribute was extracted.
- basicAttributes ( - dict|- None) – dict with basic attributes (age, gender, ethnicity)
- basicAttributesSamples ( - list[- str]) – list of warp image id from which the basic attribute was extracted.
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse 
- Return type:
- class 
 
 - unlinkFacesFromList(listId, faceIds, raiseError=True, **kwargs)[source]
- Detach faces to list. - Parameters:
- listId ( - str) – list id
- faceIds ( - list[- str]) – face ids
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 
 - updateFaceAttributes(faceId, attributeId=None, basicAttributes=None, descriptors=None, basicAttributesSamples=None, descriptorSamples=None, raiseError=True, **kwargs)[source]
- Update face attributes. - Parameters:
- faceId ( - str) – face id
- attributeId ( - str|- None) – attribute id
- descriptors ( - list[- bytes|- RawDescriptor] |- None) – list of descriptors different versions
- descriptorSamples ( - list[- str]) – list of warp image id from which the attribute was extracted.
- basicAttributes ( - dict|- None) – dict with basic attributes (age, gender, ethnicity)
- basicAttributesSamples ( - list[- str]) – list of warp image id from which the basic attribute was extracted.
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse 
- Return type:
- class 
 
 
Luna Image Store client
The luna-image-store client which allows to create/get/delete images and objects
Module contains luna-image-store client adapted for usage in lambda
- class luna_lambda_tools.public.clients.lis.LIS(lisClient, accountId, bucket)[source]
- Luna-image-store client - deleteImage(imageId, raiseError=True, **kwargs)[source]
- Delete image from bucket. - Parameters:
- imageId ( - str) – image id to delete
- raiseError ( - bool) – whether to raise LunaApiException in case of failure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with version. 
- Return type:
- class 
 
 - deleteImages(imageIds, raiseError=True, **kwargs)[source]
- Delete images from bucket. - Parameters:
- imageIds ( - list[- str]) – images ids to delete
- raiseError ( - bool) – whether to raise LunaApiException in case of failure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with version. 
- Return type:
- class 
 
 - deleteObject(objectId, raiseError=True, **kwargs)[source]
- Delete object from bucket. - Parameters:
- objectId ( - str) – object id
- raiseError ( - bool) – whether to raise LunaApiException in case of failure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with version. 
- Return type:
- class 
 
 - deleteObjects(objectIds, raiseError=True, **kwargs)[source]
- Delete objects from bucket. - Parameters:
- objectIds ( - list[- str]) – objects ids to delete
- raiseError ( - bool) – whether to raise LunaApiException in case of failure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with version. 
- Return type:
- class 
 
 - getImage(imageId, withMeta=None, raiseError=True, **kwargs)[source]
- Get image from bucket. - Parameters:
- imageId ( - str) – external image id
- withMeta ( - bool) – whether to retrieve user-defined image metadata
- raiseError ( - bool) – whether to raise LunaApiException in case of failure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with version. 
- Return type:
- class 
 
 - getObject(objectId, raiseError=True, **kwargs)[source]
- Get object from bucket. - Parameters:
- objectId ( - str) – object id
- raiseError ( - bool) – whether to raise LunaApiException in case of failure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with version. 
- Return type:
- class 
 
 - headImage(imageId, withMeta=None, raiseError=True, **kwargs)[source]
- Check image existence in bucket. - Parameters:
- imageId ( - str) – external image id
- withMeta ( - bool) – whether to retrieve user-defined image metadata
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with version. 
- Return type:
- class 
 
 - headObject(objectId, raiseError=True, **kwargs)[source]
- Check object existence in bucket. - Parameters:
- objectId ( - str) – object id
- raiseError ( - bool) – whether to raise LunaApiException in case of failure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with version. 
- Return type:
- class 
 
 - postImage(imageInBytes, contentType='image/jpeg', raiseError=True, **kwargs)[source]
- Post an image to bucket. - Parameters:
- imageInBytes ( - bytes|- bytearray) – byte’s array (image)
- contentType ( - str) – content-type of image or image/jpeg for default
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with version. 
- Return type:
- class 
 
 - postObject(objectBody, contentType='application/json', raiseError=True, **kwargs)[source]
- Post object to bucket. - Parameters:
- objectBody ( - str) – object, available: text, json
- contentType ( - str) – content-type of object or application/json for default
- raiseError ( - bool) – whether to raise LunaApiException in case of failure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with version. 
- Return type:
- class 
 
 - putImage(imageInBytes, imageId, contentType='image/jpeg', raiseError=True, **kwargs)[source]
- Put an image to bucket. - Parameters:
- imageInBytes ( - bytes|- bytearray) – byte’s array (image)
- imageId ( - str) – image id
- contentType ( - str) – content-type of image or image/jpeg for default
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with version. 
- Return type:
- class 
 
 - putObject(objectBody, objectId, contentType='application/json', raiseError=True, **kwargs)[source]
- Put object to bucket. - Parameters:
- objectBody ( - str) – object, available: text, json
- objectId ( - str) – object id
- contentType ( - str|- None) – content-type of object or application/json for default
- raiseError ( - bool) – whether to raise LunaApiException in case of failure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with version. 
- Return type:
- class 
 
 
Luna Python Matcher client
The luna-python-matcher client which allows to match/crossmatch faces/bodies
Module contains luna-python-matcher client adapted for usage in lambda
- class luna_lambda_tools.public.clients.lpm.LPM(lpmClient, accountId)[source]
- Luna-python-matcher client - crossmatchBodies(candidateFilters, referenceFilters, limit=None, threshold=None, sorting=None, raiseError=True, **kwargs)[source]
- Cross Matcher API allows to submit tasks to a service that searches for events by given filters and matches them with each other. Resource implements body descriptors matching. - Parameters:
- candidateFilters ( - EventFilters) – candidate events filters
- referenceFilters ( - EventFilters) – reference events filters
- limit ( - int|- None) – matching limit
- threshold ( - int|- None) – matching threshold
- sorting ( - int|- None) – whether to sort match results
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: results of matching (failed and succeeded matches) 
- Return type:
- class 
 
 - crossmatchFaces(candidateFilters, referenceFilters, limit=None, threshold=None, sorting=None, raiseError=True, **kwargs)[source]
- Cross Matcher API allows to submit tasks to a service that searches for faces/events by given filters and matches them with each other. Resource implements face descriptors matching. - Parameters:
- candidateFilters ( - FaceFilters|- EventFilters|- AttributeFilters) – candidate filters
- referenceFilters ( - FaceFilters|- EventFilters|- AttributeFilters) – reference filters
- limit ( - int|- None) – matching limit
- threshold ( - int|- None) – matching threshold
- sorting ( - int|- None) – whether to sort match results
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: results of matching (failed and succeeded matches) 
- Return type:
- class 
 
 - matchBodies(candidates, references, raiseError=True, **kwargs)[source]
- Matcher API allows to submit tasks to a service that searches for faces similar to a given reference(s) by matching them. An attribute descriptor should be extracted for reference(s) and candidate(s). A source for references are events, attributes and faces. A source for candidates are faces and lists. - Parameters:
- candidates ( - list[- Candidates]) – Candidates object with info about candidates (possible type variants: events)
- references ( - list[- Reference|- BinaryReference]) – list of Reference objects. Each object has entity id and it type (possible type variants: events, raw descriptors)
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: results of matching (failed and succeeded matches) 
- Return type:
- class 
 
 - matchFaces(candidates, references, raiseError=True, **kwargs)[source]
- Matcher API allows to submit tasks to a service that searches for faces similar to a given reference(s) by matching them. An attribute descriptor should be extracted for reference(s) and candidate(s). A source for references are events, attributes and faces. A source for candidates are faces and lists. - Parameters:
- candidates ( - list[- Candidates]) – Candidates object with info about candidates
- references ( - list[- Reference|- BinaryReference]) – list of Reference objects. Each object has entity id and it type (possible type variants: events, attributes, faces, raw descriptors)
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: results of matching (failed and succeeded matches) 
- Return type:
- class 
 
 - matchGeneralEvents(candidates, references, descriptorType, platCoef=None, descriptorVersion=None, accept='application/msgpack', **kwargs)[source]
- Matcher API allows to submit tasks to a service that searches for faces similar to a given reference(s) by matching them. An attribute descriptor should be extracted for reference(s) and candidate(s). A source for references are events, attributes and faces. A source for candidates are faces and lists. - Parameters:
- descriptorType ( - str) – base descriptor type for references and candidates
- descriptorVersion ( - int|- None) – descriptor version of matching
- platCoef ( - list[- dict|- PlatCoef] |- None) – plat coefs, for normalizing matching results
- candidates ( - list[- Candidates]) – Candidates object with info about candidates
- references ( - list[- Reference|- BinaryReference]) – list of Reference objects. Each object has entity id and it type (possible type variants: events, attributes, faces, raw descriptors)
- accept ( - str) – expected content type
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: results of matching (failed and succeeded matches) 
- Return type:
- class 
 
 - matchRaw(candidates, references, raiseError=True, **kwargs)[source]
- Matcher raw API allows to match each candidate with each reference descriptors. - Parameters:
- candidates ( - list[- BinaryReference]) – list of BinaryReference objects for candidates
- references ( - list[- BinaryReference]) – list of BinaryReference objects for references
- raiseError – whether to raise LunaApiException in case of failure 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: results of matching for each reference 
- Return type:
- class 
 
 
Luna Remote SDK client
The luna-remote-sdk client which allows to detect faces/bodies on images, extract descriptors and estimate several parameters
Module contains luna-remote-sdk client adapted for usage in lambda
- class luna_lambda_tools.public.clients.lrs.LRS(lrsClient, accountId)[source]
- Luna-remote-sdk client - sdk(inputData, multifacePolicy=1, detectFace=None, detectBody=None, estimateHeadPose=None, estimateLandmarks68=None, estimateLandmarks5=None, estimateQuality=None, estimateGaze=None, estimateEyesAttributes=None, estimateEmotions=None, estimateMouthAttributes=None, estimateMask=None, estimateGlasses=None, estimateLiveness=None, estimateFaceWarp=None, estimateBodyWarp=None, aggregateAttributes=None, estimateBasicAttributes=None, estimateBodyDescriptor=None, estimateFaceDescriptor=None, estimateUpperBody=None, estimateLowerBody=None, estimateBodyBasicAttributes=None, estimateAccessories=None, pitchThreshold=None, rollThreshold=None, yawThreshold=None, scoreThreshold=None, maskStates=None, livenessStates=None, imageType=None, useExifInfo=None, extractExif=None, raiseError=True, **kwargs)[source]
- Detect faces on input images. - Parameters:
- inputData ( - BinaryImage|- list[- BinaryImage] |- list[- UrlForDetection] |- list[- str]) – one of: - Single image or images list for extraction (supported formats “jpeg, png, tif, ppm, bmp”). - list of urls with images - list of images’ ids
- multifacePolicy ( - int) – multiple face detection policy: 0 - multiple face detection not allowed, 1 - multiple face detection allowed, 2 - get best detection from the image
- detectFace ( - int|- None) – detect faces
- detectBody ( - int|- None) – detect human bodies
- estimateHeadPose ( - int|- None) – Available values : 0, 1
- estimateLandmarks5 ( - int|- None) – Available values : 0, 1
- estimateLandmarks68 ( - int|- None) – Available values : 0, 1
- estimateQuality ( - int|- None) – Available values : 0, 1
- estimateGaze ( - int|- None) – Available values : 0, 1
- estimateEyesAttributes ( - int|- None) – Available values : 0, 1
- estimateMouthAttributes ( - int|- None) – Available values : 0, 1
- estimateEmotions ( - int|- None) – Available values : 0, 1
- estimateMask ( - int|- None) – Available values: 0, 1
- estimateGlasses ( - int|- None) – Available values: 0, 1
- estimateLiveness ( - int|- None) – Available values: 0, 1
- estimateFaceDescriptor ( - int|- None) – Available values : 0, 1
- estimateBodyDescriptor ( - int|- None) – Available values : 0, 1
- estimateBasicAttributes ( - int|- None) – Available values : 0, 1
- estimateBodyWarp ( - int|- None) – Available values : 0, 1
- estimateFaceWarp ( - int|- None) – Available values : 0, 1
- estimateUpperBody ( - int|- None) – Available values : 0, 1
- estimateLowerBody ( - int|- None) – Available values : 0, 1
- estimateBodyBasicAttributes ( - int|- None) – Available values : 0, 1
- estimateAccessories ( - int|- None) – Available values : 0, 1
- pitchThreshold ( - int|- None) – maximum deviation pitch angle from 0
- rollThreshold ( - int|- None) – maximum deviation roll angle from 0
- yawThreshold ( - int|- None) – maximum deviation yaw angle from 0
- scoreThreshold ( - float) – descriptor garbage score
- maskStates ( - list[- int] |- None) – Array of integer (filter by mask state) (Items Enum:1 2 3)
- livenessStates ( - list[- int] |- None) – Array of integer (filter by liveness state) (Items Enum:0 1 2)
- aggregateAttributes ( - int|- None) – Available values : 0, 1
- imageType ( - int|- None) – image type (0 - raw image, 1 - face warped image, 2 - body warped image)
- useExifInfo ( - int|- None) – whether to use exif info for auto orientation
- extractExif ( - int|- None) – extract EXIF meta information from images
- raiseError ( - bool) – whether to raise LunaApiException in case of failure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with samples, exif, filename for succeeded images and errors for failed images will be returned. 
- Return type:
- class 
 
 
Luna Sender client
The luna-sender client which allows to send custom events to luna-sender
Module contains luna-sender client adapted for usage in lambda
- class luna_lambda_tools.public.clients.sender.Sender(senderClient, accountId)[source]
- Luna-sender client - publish(events, *, handlerId, eventCreateTime, eventEndTime, raiseError=True, **kwargs)[source]
- Publish user generated events. :type events: - list[- dict] :param events: user generated events to be published :type handlerId:- str:param handlerId: event handler id :type eventCreateTime:- str:param eventCreateTime: event creation time :type eventEndTime:- str:param eventEndTime: event end time :type raiseError: :param raiseError: whether to raise LunaApiException in case of failure
 
Luna Handlers client
The luna-handlers client which allows to send custom events to luna-handlers
Module contains luna-handlers client adapted for usage in lambda
- class luna_lambda_tools.public.clients.handlers.Handlers(handlersClient, accountId)[source]
- Luna-handlers client - checkHandlerById(handlerId, **kwargs)[source]
- Check whether handler exists by its id - Parameters:
- handlerId ( - str) – handler id (uuid4)
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: no text returns 
- Return type:
- class 
 
 - checkVerifier(verifierId, **kwargs)[source]
- Check verifier existence - Parameters:
- verifierId ( - str) – verifier id
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: no text returns 
- Return type:
- class 
 
 - createHandler(policies=None, handlerType=None, lambdaId=None, description=None, **kwargs)[source]
- Create new handler. Handler determinate a list of rules for proccessing input images. You can set parameters for detecting faces, extracting attributes. You can set rules for matching attributes and creating faces from them. - Parameters:
- policies ( - Policies|- None) – object with policies information
- handlerType ( - int|- None) – handler type (0 - static, 1 - dynamic, 2 - lambda)
- lambdaId ( - str|- None) – lambda id
- description ( - str|- None) – user description
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json new handler id and url 
- Return type:
- class 
 
 - createVerifier(policies=None, description=None, **kwargs)[source]
- Create new verifier. Verifier determinate a list of rules for processing & verification of input images. You can set parameters for detecting faces, extracting attributes. You can set rules for matching attributes and creating faces from them. - Parameters:
- policies ( - VerifierPolicies|- None) – object with policies information
- description ( - str|- None) – user description
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json new verifier id and url 
- Return type:
- class 
 
 - deleteHandlerById(handlerId, **kwargs)[source]
- Remove handler by id - Parameters:
- handlerId ( - str) – handler id (uuid4)
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: no text returns 
- Return type:
- class 
 
 - deleteVerifier(verifierId, **kwargs)[source]
- Remove verifier :rtype: - Union[- Awaitable[- LunaResponse],- LunaResponse]- Args:
- verifierId: verifier id 
- Returns:
- class:~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: no text returns 
 
 - detectFaces(inputData, multifacePolicy=1, estimateHeadPose=0, detectLandmarks68=0, extractExif=0, estimateQuality=0, estimateGaze=0, estimateEyesAttributes=0, estimateEmotions=0, estimateMask=0, estimateMouthAttributes=0, pitchThreshold=None, rollThreshold=None, yawThreshold=None, warpedImage=0, useExifInfo=None, estimateFaceQuality=0, **kwargs)[source]
- Detect faces on input images. - Parameters:
- inputData ( - BinaryImage|- list[- BinaryImage] |- list[- UrlForDetection] |- list[- str]) – one of: - Single image or images list for extraction (supported formats “jpeg, png, tif, ppm, bmp”). - list of urls with images - list of images’ ids
- multifacePolicy ( - int) – multiple face detection policy: 0 - multiple face detection not allowed, 1 - multiple face detection allowed, 2 - get best detection from the image
- estimateHeadPose ( - int) – Available values : 0, 1
- detectLandmarks68 ( - int) – Available values : 0, 1
- extractExif ( - int) – Available values : 0, 1
- estimateQuality ( - int) – Available values : 0, 1
- estimateGaze ( - int) – Available values : 0, 1
- estimateEyesAttributes ( - int) – Available values : 0, 1
- estimateMouthAttributes ( - int) – Available values : 0, 1
- estimateEmotions ( - int) – Available values : 0, 1
- estimateMask ( - int) – Available values : 0, 1
- pitchThreshold ( - int|- None) – maximum deviation pitch angle from 0
- rollThreshold ( - int|- None) – maximum deviation roll angle from 0
- yawThreshold ( - int|- None) – maximum deviation yaw angle from 0
- warpedImage ( - int) – Whether input image is a warped or arbitrary image.
- useExifInfo ( - int|- None) – whether to use exif info for auto orientation
- estimateFaceQuality ( - int) – whether to estimate face quality
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with samples, exif, filename for succeeded images and errors for failed images will be returned. 
- Return type:
- class 
 
 - emitEvents(handlerId, inputData, policies=None, externalId=None, userData=None, aggregateAttributes=None, source=None, streamId=None, city=None, street=None, district=None, area=None, houseNumber=None, tags=None, latitude=None, longitude=None, imageType=None, lunaEventTime=None, lunaEventEndTime=None, trackId=None, useExifInfo=None, meta=None, **kwargs)[source]
- Emit input events. - Parameters:
- handlerId ( - str) – handler id
- inputData ( - BinaryImage|- list[- BinaryImage] |- list[- UrlForDetection] |- list[- str] |- list[- SampleForDetection]) – one of: - Single image or images list for extraction (supported formats “jpeg, png, tif, ppm, bmp”). - list of urls with images - list of images’ ids
- policies ( - Policies|- dict|- None) – object with policies information for dynamic handler
- externalId ( - str|- None) – external id
- userData ( - str|- None) – user data
- aggregateAttributes ( - int|- None) – aggregate all attributes (descriptot, age, gender) or not (0 or 1)
- source ( - str|- None) – source
- streamId ( - str|- None) – stream id
- city ( - str|- None) – event city
- street ( - str|- None) – event street
- area ( - str|- None) – event area
- district ( - str|- None) – event district
- houseNumber ( - str|- None) – event house number
- tags ( - str|- None) – tags
- latitude ( - float|- None) – event latitude in degrees
- longitude ( - float|- None) – event longitude in degrees
- imageType ( - int) – image type (0 - raw image, 1 - face warped image, 2 - body warped image)
- lunaEventTime ( - str|- None) – user defined event create time
- lunaEventEndTime ( - str|- None) – user defined event end time
- trackId ( - str|- None) – (str) event track id
- useExifInfo ( - int|- None) – whether to use exif info for auto orientation
- meta ( - dict|- None) – user-defined event metadata
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json new handler id and url 
- Return type:
- class 
 
 - emitStreamEvents(handlerId, inputData, **kwargs)[source]
- Emit stream events. - Parameters:
- handlerId ( - str) – handler id
- inputData ( - StreamEventsSource) – structure with stream event(s) source
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json new handler id and url 
- Return type:
- class 
 
 - extractAttrFromSample(sampleIds, scoreThreshold=0, extractDescriptor=1, extractBasicAttributes=0, aggregateAttributes=0, ttl=None, **kwargs)[source]
- Extract attributes from samples. - Parameters:
- sampleIds ( - list[- str]) – list of samples
- scoreThreshold ( - float) – number [ 0 .. 1 ]; example: 0.99; descriptor quality score threshold. All the attributes with quality score below the threshold will be ignored (and not stored in the DB). The function will proceed as usual with all the remaining descriptors (if left).
- extractDescriptor ( - int) – Available values : 0, 1; whether to extract face descriptor(s)
- extractBasicAttributes ( - int) – Available values : 0, 1; whether to extract basic attributes (gender, age, ethnicity)
- aggregateAttributes ( - int) – Available values : 0, 1; whether to aggregate face descriptor(s); If true, all extracted attributes will be aggregated and stored in as a single attribute. Otherwise, all attributes will be stored for every sample.
- ttl ( - int|- None) – temporary attribute ttl
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: json with attributes info 
- Return type:
- class 
 
 - getHandlerById(handlerId, **kwargs)[source]
- Get handler by its id - Parameters:
- handlerId ( - str) – handler id (uuid4)
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: json with handler info 
- Return type:
- class 
 
 - getHandlers(description=None, handlerType=None, page=1, pageSize=10, **kwargs)[source]
- Get handlers by filters - Parameters:
- description ( - str|- None) – Find all handlers with description which “like” of this parameter
- handlerType ( - int|- None) – handler type (0 - static, 1 - dynamic, 2 - lambda)
- page ( - int) – The number of page
- pageSize ( - int) – The numbers of items on page
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: json with handlers info 
- Return type:
- class 
 
 - getHandlersCount(description=None, handlerType=None, **kwargs)[source]
- Get handlers count by filters - Parameters:
- description ( - str|- None) – Find all handlers with description which “like” of this parameter
- handlerType ( - int|- None) – handler type (0 - static, 1 - dynamic, 2 - lambda)
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: handlers count 
- Return type:
- class 
 
 - getVerifier(verifierId, **kwargs)[source]
- Get verifier - Parameters:
- verifierId ( - str) – verifier id
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: json with verifier info 
- Return type:
- class 
 
 - getVerifiers(description=None, page=1, pageSize=10, **kwargs)[source]
- Get verifiers by filters - Parameters:
- description ( - str|- None) – verifier description (“like” parameter)
- page ( - int) – The number of page
- pageSize ( - int) – The numbers of items on page
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: json with verifiers info 
- Return type:
- class 
 
 - getVerifiersCount(description=None, **kwargs)[source]
- Count verifiers that satisfy the filters - Parameters:
- description ( - str|- None) – verifier description (“like” parameter)
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: verifier count 
- Return type:
- class 
 
 - putVerifier(verifierId, policies=None, description=None, **kwargs)[source]
- Replace verifier - Parameters:
- verifierId ( - str) – verifier id
- policies ( - VerifierPolicies|- None) – object with policies information
- description ( - str|- None) – user description
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: no text returns 
- Return type:
- class 
 
 - saveEvent(handlerId, event, waitSaving=None, **kwargs)[source]
- Save raw event. - Parameters:
- handlerId ( - str) – handler id
- event ( - RawEvent|- dict[- str,- Any]) – raw event
- waitSaving ( - int|- None) – whether to wait for event saving
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 
 - updateHandler(handlerId, policies=None, handlerType=None, lambdaId=None, description=None, **kwargs)[source]
- Update a handler. You can not update a part of handler. - Parameters:
- handlerId ( - str) – handler id
- policies ( - Policies|- None) – object with policies information
- handlerType ( - int|- None) – handler type (0 - static, 1 - dynamic, 2 - lambda)
- lambdaId ( - str|- None) – lambda id
- description ( - str|- None) – user description
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return nothing in text field 
- Return type:
- class 
 
 - upgradeObjectFromSample(data, **kwargs)[source]
- Upgrade basic attributes and/or descriptor in a object using samples. - Parameters:
- data ( - FaceAttributeUpgrade|- EventAttributeUpgrade) – face or attribute upgrade object
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: json with attributes info 
- Return type:
- class 
 
 - validateHandler(policies, **kwargs)[source]
- Validate handler policies. - Parameters:
- policies ( - Policies|- dict) – object with policies information
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 
 - verifyData(verifierId, inputData, eventIds=None, externalIds=None, faceIds=None, attributeIds=None, imageType=None, useExifInfo=None, **kwargs)[source]
- Perform data verification against specified objects. Only one objects set is allowed. - Parameters:
- verifierId ( - str) – verifier id
- inputData ( - BinaryImage|- BinaryDescriptorData|- list[- BinaryImage|- BinaryDescriptorData]) – one of: - Single image - Single descriptor - List of images and descriptors
- faceIds ( - list[- str] |- None) – faces ids to verify against
- eventIds ( - list[- str] |- None) – event ids to verify against
- externalIds ( - list[- str] |- None) – external ids to verify against
- attributeIds ( - list[- str] |- None) – temporary attribute ids to verify against
- imageType ( - int|- None) – image type (0 - raw image, 1 - face warped image)
- useExifInfo ( - int|- None) – whether to use exif info for auto orientation
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: json with verifications info 
- Return type:
- class 
 
 - verifyRaw(candidates, references, verifierId, **kwargs)[source]
- Verify raw API allows to match each candidate with each reference descriptors. - Parameters:
- verifierId ( - str) – verifier id
- candidates ( - list[- BinaryReference]) – list of BinaryReference objects for candidates
- references ( - list[- BinaryReference]) – list of BinaryReference objects for references verifierId: verifier id
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: results of matching 
- Return type:
- class 
 
 
Luna Api client
The luna-api client which implements complete REST API of luna-api service
*Available only for external lambda agent
- Bases: - LunaHttpClient- Luna Api client - Get luna-api address - Return type:
- str
 
 
- Bases: - BaseLunaHttpClient,- SamplesMixin,- AttributesMixin,- FacesMixin,- ListsMixin,- EventsMixin,- HandlersMixin,- MatcherMixin,- TasksMixin,- LivenessMixin,- ImagesMixin,- ObjectsMixin,- WSMixin,- AccountsMixin,- LRSMixin,- LambdasMixin,- VideoManagerMixin,- LVAMixin- Luna-api client - Property get base part of url. - >>> self.baseUri "http://127.0.0.1:5030/1" 
 - Calculate intervals using provided data - Parameters:
- toCalculate ( - IntervalCalculation) – structure for request with cron, duration and so on
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.video_manager.http_objs import IntervalCalculation >>> response = client.calculateIntervals( ... toCalculate=IntervalCalculation( ... startTime="2025-05-01T00:00:00.000000+00:00", ... endTime="2025-05-16T00:00:00.000000+00:00", ... cron="5 4 * * 4", ... duration=11, ... durationType="minute", ... ), ... raiseError=True, ... ) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "intervals": [ { "end_time": ..., "start_time": ... }, { "end_time": ..., "start_time": ... }, { "end_time": ..., "start_time": ... } ] } 
 - Cancel a task by the task id. Optional you can set, that task must belong to account. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/cancelTask - Parameters:
- taskId ( - int) – task id
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import EventFilters >>> >>> eventFilters = EventFilters(accountId=client.accountId) >>> taskId = client.createClusteringTask(filters=eventFilters, raiseError=True).json["task_id"] >>> response = client.cancelTask(taskId=taskId) >>> status = client.getTask(taskId).json["task_status"] >>> status in (2, 5) # task done or cancel True 
 - Check to exist an attributes with id=attribute_id - Parameters:
- attributeId ( - str) – attribute Id
- accountIdFilter ( - Optional[- str]) – account id to check attribute
 
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import FACE_WARP >>> >>> sampleId = client.saveFaceSample(FACE_WARP, raiseError=True).json["sample_id"] >>> attributeId = client.extractAttrFromSample(sampleIds=[sampleId], raiseError=True).json[0]["attribute_id"] >>> response = client.checkBasicAttributesById(attributeId=attributeId) >>> print(response.statusCode) 200 
 - Check to exist a body sample with id=sample_id - Parameters:
- sampleId ( - str) – sample Id
- accountIdFilter ( - Optional[- str]) – account id to check sample
 
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import BODY_WARP as image >>> >>> sampleId = client.saveBodySample(image=image, raiseError=True).json["sample_id"] >>> response = client.checkBodySample(sampleId=sampleId) >>> print(response.statusCode) 200 
 - Check event with id=eventId existence. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/checkEvent - Parameters:
- eventId ( - str) – event id
- accountIdFilter ( - Optional[- str]) – account id to check event
 
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.common.http_objs import Policies, DetectPolicy >>> from testData.resources import FACE_WARP >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> policies = Policies(detectPolicy=DetectPolicy(detectFace=1)) >>> handlerId = client.createHandler( ... description="test_handler_events", policies=policies, raiseError=True ... ).json["handler_id"] >>> eventId = client.emitEvents( ... handlerId=handlerId, ... inputData=[FACE_WARP], ... city="Kazan", ... street="Saban", ... houseNumber="5", ... imageType=1, ... useExifInfo=1, ... raiseError=True, ... ).json["events"][0]["event_id"] >>> response = client.checkEvent(eventId=eventId) >>> print(response.statusCode) 200 
 - Check a face with id=face_id existence - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/checkFace - Parameters:
- faceId ( - str) – face id
- accountIdFilter ( - Optional[- str]) – account id to check face
 
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> faceId = client.createFace(raiseError=True).json['face_id'] >>> response = client.checkFace(faceId=faceId) >>> print(response.statusCode) 200 
 - Check to exist a face sample with id=sample_id - Parameters:
- sampleId ( - str) – sample Id
- accountIdFilter ( - Optional[- str]) – account id to check sample
 
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import FACE_WARP as image >>> >>> sampleId = client.saveFaceSample(image=image, raiseError=True).json["sample_id"] >>> response = client.checkFaceSample(sampleId=sampleId) >>> print(response.statusCode) 200 
 - Check general event existence. - Parameters:
- eventId ( - str) – event id
- accountIdFilter ( - Optional[- str]) – event account id filter
 
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 
 - Check whether handler exists by its id - Parameters:
- handlerId ( - str) – handler id
- accountIdFilter ( - Optional[- str]) – account id to check handler
 
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> handlerId = client.createHandler(handlerType=1, description="dynamic", raiseError=True).json["handler_id"] >>> response = client.checkHandlerById(handlerId=handlerId) >>> print(response.statusCode) 200 
 - Check health of luna service - Parameters:
- includeLunaServices ( - Optional[- bool]) – whether to perform checks for dependencies of the service
- lunaRequestId ( - Optional[- str]) – External request id. Helps uniquely identifying messages, corresponding to particular requests, in system logs. Pattern: ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$
- asyncRequest ( - Optional[- bool]) – execution in asynchronous mode, disabled by default
- raiseError ( - Optional[- bool]) – if request fails, LunaApiException is raised
- totalTimeout ( - Optional[- Real]) – request processing timeout in seconds.
- connectTimeout ( - Optional[- Real]) – connection timeout seconds.
- sockReadTimeout ( - Optional[- Real]) – socket read timeout
- sockConnectTimeout ( - Optional[- Real]) – socket connect timeout
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with healthcheck result. 
- Return type:
- class 
 
 - Estimate and check input images by ISO. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#tag/iso - Parameters:
- inputData ( - Union[- BinaryImage,- List[- BinaryImage],- List[- UrlForDetection],- List[- str]]) – one of: - Single image or images list for extraction (supported formats “jpeg, png, tif, ppm, bmp”). - list of urls with images - list of images’ ids
- multifacePolicy ( - int) – multiple face detection policy: 0 - multiple face detection not allowed, 1 - multiple face detection allowed 2 - get best detection from the image
- extractExif ( - int) – Available values : 0, 1
- imageType ( - Optional[- int]) – image type (0 - raw image, 1 - face warped image)
- accept ( - str) – expected content type
 
- Returns:
- body contains json with filename, exif, error and estimations for images 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import BODY_IMAGE as image >>> >>> response = client.checkISO( ... inputData=image, multifacePolicy=1, extractExif=1, accept="application/json" ... ) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "images": [ { "error": { "desc": "Success", "detail": "Success", "error_code": 0, "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-0" }, "estimations": [ { "face": { "detection": { "iso": { "checks": [ { "name": "image_format", "object_value": "JPEG", "result": 1, "threshold_value": [ "JPEG", "JPEG2000", "PNG" ] }, { "name": "illumination_quality", "object_value": ..., "result": ..., "threshold_value": { "max": 1, "min": 0.3 } }, { "name": "specularity_quality", "object_value": ..., "result": ..., "threshold_value": { "max": 1, "min": 0.3 } }, { "name": "blurriness_quality", "object_value": ..., "result": ..., "threshold_value": { "max": 1, "min": 0.61 } }, { "name": "dark_quality", "object_value": ..., "result": ..., "threshold_value": { "max": 1, "min": 0.5 } }, { "name": "light_quality", "object_value": ..., "result": ..., "threshold_value": { "max": 1, "min": 0.57 } }, { "name": "head_yaw", "object_value": ..., "result": ..., "threshold_value": { "max": 5.0, "min": -5.0 } }, { "name": "head_pitch", "object_value": ..., "result": ..., "threshold_value": { "max": 5.0, "min": -5.0 } }, { "name": "head_roll", "object_value": ..., "result": ..., "threshold_value": { "max": 8.0, "min": -8.0 } }, { "name": "gaze_yaw", "object_value": ..., "result": ..., "threshold_value": { "max": 5.0, "min": -5.0 } }, { "name": "gaze_pitch", "object_value": ..., "result": ..., "threshold_value": { "max": 5.0, "min": -5.0 } }, { "name": "mouth_smiling", "object_value": ..., "result": ..., "threshold_value": { "max": 0.5, "min": 0 } }, { "name": "mouth_occluded", "object_value": ..., "result": ..., "threshold_value": { "max": 0.5, "min": 0 } }, { "name": "mouth_open", "object_value": ..., "result": ..., "threshold_value": { "max": 0.5, "min": 0 } }, { "name": "glasses", "object_value": "no_glasses", "result": 1, "threshold_value": [ "no_glasses", "eyeglasses" ] }, { "name": "left_eye", "object_value": "open", "result": 1, "threshold_value": [ "open" ] }, { "name": "right_eye", "object_value": "open", "result": 1, "threshold_value": [ "open" ] }, { "name": "head_horizontal_center", "object_value": ..., "result": ..., "threshold_value": { "max": 0.55, "min": 0.45 } }, { "name": "head_vertical_center", "object_value": ..., "result": ..., "threshold_value": { "max": 0.5, "min": 0.3 } }, { "name": "head_width", "object_value": ..., "result": ..., "threshold_value": { "max": 0.75, "min": 0.5 } }, { "name": "head_height", "object_value": ..., "result": ..., "threshold_value": { "max": 0.9, "min": 0.6 } }, { "name": "eye_distance", "object_value": ..., "result": ..., "threshold_value": { "max": null, "min": 90.0 } }, { "name": "eyebrows_state", "object_value": ..., "result": ..., "threshold_value": [ "neutral" ] }, { "name": "shoulders_position", "object_value": "parallel", "result": 1, "threshold_value": [ "parallel" ] }, { "name": "smile_properties", "object_value": ..., "result": ..., "threshold_value": [ "none" ] }, { "name": "headwear_type", "object_value": "none", "result": 1, "threshold_value": [ "none" ] }, { "name": "natural_light", "object_value": ..., "result": ..., "threshold_value": 1 }, { "name": "radial_distortion", "object_value": ..., "result": ..., "threshold_value": 0 }, { "name": "red_eyes", "object_value": 0, "result": 1, "threshold_value": 0 }, { "name": "face_color_type", "object_value": "color", "result": 1, "threshold_value": [ "grayscale", "color" ] }, { "name": "background_uniformity", "object_value": ..., "result": ..., "threshold_value": { "max": 1, "min": 0.5 } }, { "name": "background_lightness", "object_value": ..., "result": ..., "threshold_value": { "max": 1, "min": 0.2 } } ], "status": 0 }, "rect": { "height": ..., "width": ..., "x": ..., "y": ... } } } } ], "exif": {}, "filename": "raw image", "status": 1 } ] } 
 - Check to exist an image with id=image_id - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/checkImage - Parameters:
- imageId ( - str) – image id
- accountIdFilter ( - Optional[- str]) – account id to check image
- withMeta ( - bool) – whether to retrieve user-defined image metadata
 
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import FACE_WARP as image >>> >>> imageId = client.saveImage(image=image, raiseError=True).json["image_id"] >>> response = client.checkImage(imageId=imageId) >>> print(response.statusCode) 200 
 - Check lambda existence by id. - Parameters:
- lambdaId ( - str) – lambda id
- accountIdFilter ( - Optional[- str]) – account id filter for check lambda
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> from uuid import uuid4 >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import LAMBDA_ARCHIVE >>> >>> lambdaId = client.createLambda(archive=LAMBDA_ARCHIVE, lambdaName=str(uuid4())).json["lambda_id"] >>> response = client.checkLambda(lambdaId=lambdaId) >>> print(response.statusCode) 200 
 - Check list existence - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/checkList - Parameters:
- listId ( - str) – list id
- accountIdFilter ( - Optional[- str]) – account id to check face
 
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> listId = client.createList("strange_persons", raiseError=True).json["list_id"] >>> response = client.checkList(listId=listId) >>> print(response.statusCode) 200 
 - Check to exist an object with id=object_id - Parameters:
- objectId ( - str) – object id
- accountIdFilter ( - Optional[- str]) – account id to check object
 
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> objectBody = "1,2,3" >>> contentType = "text/plain" >>> objectId = client.saveObject(objectBody=objectBody, contentType=contentType, raiseError=True).json[ ... "object_id" ... ] >>> response = client.checkObject(objectId=objectId) >>> print(response.statusCode) 200 
 - Check stream by id. - Parameters:
- streamId ( - str) – stream id
- accountId ( - Optional[- str]) – account id
- targets ( - Optional[- str]) – targets to get streams
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with stream will be returned. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME >>> from luna3.video_manager.http_objs import StreamAnalytic >>> streamId = client.createStream( ... streamType="videofile", ... reference="http://reference", ... name="test_stream", ... description="test stream description", ... analytics=[StreamAnalytic(name=ANALYTIC_NAME)], ... raiseError=True, ... ).json["stream_id"] >>> response = client.checkStream(streamId=streamId) >>> print(response.statusCode) 200 
 - Check verifier existence - Parameters:
- verifierId ( - str) – verifier id
- accountIdFilter ( - Optional[- str]) – account id to check verifier
 
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.common.http_objs import VerifierPolicies, VerifierAttributePolicy, VerifierDetectPolicy >>> from luna3.common.http_objs import VerifierExtractPolicy, VerifierStoragePolicy, VerifierFaceSamplePolicy >>> >>> policies = VerifierPolicies( ... verificationThreshold=0.5, ... detectPolicy=VerifierDetectPolicy(estimateEmotions=1), ... extractPolicy=VerifierExtractPolicy(extractBasicAttributes=1), ... storagePolicy=VerifierStoragePolicy( ... faceSamplePolicy=VerifierFaceSamplePolicy(storeSample=1), ... attributePolicy=VerifierAttributePolicy(storeAttribute=1), ... ), ... ) >>> verifierId = client.createVerifier( ... description="Happy_persons", policies=policies, raiseError=True ... ).json["verifier_id"] >>> response = client.checkVerifier(verifierId=verifierId) >>> print(response.statusCode) 200 
 - Close current client. - Return type:
- None
 
 - Getting count of faces which satisfy filters - Parameters:
- timeLt ( - Optional[- str]) – Upper bound for object create_time
- timeGte ( - Optional[- str]) – Lower bound for object create_time
- faceIds ( - Optional[- List[- str]]) – list of coma separated faces ids
- externalIds ( - Optional[- List[- str]]) – external id of the face, if it has its own mapping in the system
- faceIdGte ( - Optional[- str]) – lower face id including boundary
- faceIdLt ( - Optional[- str]) – upper face id excluding boundary
- userData ( - Optional[- str]) – Find all objects with user_data which “like” of this parameter
- listId ( - Optional[- str]) – id of list that contains faces
- eventId ( - Optional[- str]) – event id
- accountIdFilter ( - Optional[- str]) – account id to count faces
 
- Returns:
- body contains json with number. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> response = client.countFaces(timeGte="2018-08-10", userData="fox1991") >>> print(response.statusCode) 200 >>> print(response.json) {'faces_count': ...} 
 - Get count of groups by filter. - Parameters:
- accountId ( - Optional[- str]) – account id
- groupNames ( - Optional[- List[- str]]) – group names
- groupIds ( - Optional[- List[- str]]) – group ids
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with count of groups will be returned. 
- Return type:
- class 
 - >>> import json >>> from uuid import uuid4 >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> groupIds = [] >>> for _ in range(3): ... groupId = client.createGroup( ... groupName=str(uuid4()), ... description="test group description", ... raiseError=True, ... ).json["group_id"] ... groupIds.append(groupId) >>> response = client.countGroups(groupIds=groupIds) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "groups_count": 3 } 
 - Get stream by filters. - Parameters:
- accountId ( - Optional[- str]) – account id
- streamIds ( - Optional[- List[- str]]) – stream ids
- streamNames ( - Optional[- List[- str]]) – stream names
- reference ( - Optional[- str]) – stream reference
- statuses ( - Optional[- List[- int]]) – stream current status values
- createTimeGte ( - Optional[- str]) – stream create time lower including bound
- createTimeLt ( - Optional[- str]) – stream create time upper excluding bound
- sources ( - Optional[- List[- str]]) – additional stream information
- splittable ( - Optional[- int]) – whether stream is splittable
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with streams will be returned. 
- Return type:
- class 
 - >>> import json >>> from uuid import uuid4 >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME >>> from luna3.video_manager.http_objs import StreamAnalytic >>> streamIds = [] >>> for _ in range(3): ... streamId = client.createStream( ... streamType="videofile", ... reference="http://reference", ... name=str(uuid4()), ... description="test stream description", ... analytics=[StreamAnalytic(name=ANALYTIC_NAME)], ... raiseError=True, ... ).json["stream_id"] ... streamIds.append(streamId) >>> response = client.countStreams( ... streamIds=streamIds, ... ) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "streams_count": 3 } 
 - Create new account - Parameters:
- login ( - str) – account login
- password ( - str) – account password
- accountType ( - Literal[- 'advanced_user',- 'user']) – account type
- description ( - Optional[- str]) – account description
- accountId ( - Optional[- str]) – account id
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with created account id will be returned. 
- Return type:
- class 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from uuid import uuid4 >>> >>> response = client.createAccount( ... accountId=str(uuid4()), login=f"{uuid4()}@visionlabs.ru", password="pwd", accountType="user" ... ) >>> print(response.statusCode) 201 >>> print(response.json) {'account_id': ..., 'url': ...} 
 - Create new agent. - Parameters:
- agent ( - Agent) – agent structure
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with created group name and id will be returned. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME, ANALYTIC_NAME >>> from luna3.video_manager.http_objs import Agent >>> agent = Agent( ... name="doctest_crate_agent", ... maxStreamCount=2, ... port=123, ... apiVersion=1, ... analyticNames=[ANALYTIC_NAME], ... description="Test agent" ... ) >>> response = client.createAgent( ... agent=agent ... ) >>> print(response.statusCode) 201 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "agent_id": ..., "alive_period": ..., "refresh_period": ... } 
 - Create new analytic. - Parameters:
- accountId – account id 
- analytic ( - Analytic) – analytic structure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with created group name and id will be returned. 
- Return type:
- class 
 - >>> import json >>> from time import sleep >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from uuid import uuid4 >>> response = client.createAnalytic( ... analytic=Analytic(analyticName=str(uuid4())), raiseError=True ... ) >>> >>> print(response.statusCode) 201 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "analytic_id": ... } 
 - Create new attributes. Notice that XPK argument overwrites basic attributes and descriptors above. - Parameters:
- descriptors ( - Optional[- list[- Union[- bytes,- RawDescriptor]]]) – list of descriptors different versions
- descriptorSamples ( - list[- str]) – list of warp image id from which the attribute was extracted.
- basicAttributes ( - Optional[- dict]) – dict with basic attributes (age, gender, ethnicity)
- basicAttributesSamples ( - list[- str]) – list of warp image id from which the basic attribute was extracted.
- xpk ( - bytes) – SDKObject bytes to load attributes from
- ttl ( - Optional[- int]) – temporary attribute ttl
 
- Returns:
- body contains json with sample_id and url. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import FACE_WARP, DESCRIPTOR >>> >>> sampleId = client.detectFaces( ... inputData=FACE_WARP, raiseError=True ... ).json["images"][0]["detections"]["samples"][0]["face"]["sample_id"] >>> basicAttributes = {'ethnicity': 3, 'age': 26, 'gender': 0} >>> response = client.createAttribute( ... basicAttributes = basicAttributes, basicAttributesSamples=[sampleId], descriptorSamples=[sampleId], ... descriptors=[DESCRIPTOR], ... ) >>> print(response.statusCode) 201 >>> print(json.dumps(response.json, sort_keys=True)) {"attribute_id": ..., "url": ...} 
 - Create and start clustering task - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/createClusteringTask # pylint: disable=line-too-long - Parameters:
- descriptorTypeFilter ( - Optional[- str]) – descriptor type filter, one of: face or body
- threshold ( - Optional[- float]) – threshold
- filters ( - Union[- FaceFilters,- EventFilters]) – Either FaceFilters or EventFilters
- useTrackInfo ( - Optional[- int]) – whether to use track info during the task
- description ( - Optional[- str]) – description
- limit ( - Optional[- int]) – candidate limit for each clutser
- notificationPolicy ( - Optional[- TaskNotificationPolicy]) – task notification policy
- resultStoragePolicy ( - Optional[- ResultStoragePolicy]) – task result storage policy
 
- Returns:
- body contains json with task id. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> from testData.resources import FACE_WARP >>> >>> sampleId = client.saveFaceSample(FACE_WARP, raiseError=True).json["sample_id"] >>> attributeId = client.extractAttrFromSample( ... sampleIds=[sampleId], extractBasicAttributes=1, raiseError=True ... ).json[0]["attribute_id"] >>> faceId = client.createFace(attributeId=attributeId, raiseError=True).json["face_id"] >>> faceFilters = FaceFilters(faceIds=[faceId]) >>> response = client.createClusteringTask(filters=faceFilters, descriptorTypeFilter="face") >>> print(response.statusCode) 202 >>> print(response.json) {'task_id': ...} 
 - Create and start clustering task - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/createCrossMatchTask # pylint: disable=line-too-long - Parameters:
- threshold ( - Optional[- float]) – threshold
- limit ( - Optional[- int]) – maximum candidates count per reference
- referenceFilters ( - Union[- FaceFilters,- EventFilters]) – filters for getting references from either faces or events
- candidateFilters ( - Union[- FaceFilters,- EventFilters]) – filters for getting candidates from either faces or events
- descriptorTypeFilter ( - Optional[- str]) – descriptor type filter, one of: face or body
- description ( - Optional[- str]) – description
- accountIdFilter ( - Optional[- str]) – account id filter
- notificationPolicy ( - Optional[- TaskNotificationPolicy]) – task notification policy
- resultStoragePolicy ( - Optional[- ResultStoragePolicy]) – task result storage policy
 
- Returns:
- body contains json with task id. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters, EventFilters >>> from luna3.common.http_objs import Policies, DetectPolicy, ExtractPolicy >>> from testData.resources import FACE_WARP as image >>> >>> sampleId = client.saveFaceSample(image=image, raiseError=True).json["sample_id"] >>> attributeId = client.extractAttrFromSample( ... sampleIds=[sampleId], extractBasicAttributes=1, raiseError=True ... ).json[0]["attribute_id"] >>> faceId = client.createFace(attributeId=attributeId, raiseError=True).json["face_id"] >>> faceFilters = FaceFilters(faceIds=[faceId]) >>> policies = Policies(detectPolicy=DetectPolicy(detectFace=1), extractPolicy=ExtractPolicy()) >>> handlerId = client.createHandler( ... description="test_handler_tasks", policies=policies, raiseError=True ... ).json["handler_id"] >>> eventId = client.emitEvents(handlerId, inputData=image, raiseError=True).json["events"][0]["event_id"] >>> eventFilters = EventFilters(eventIds=[eventId]) >>> response = client.createCrossMatchTask( ... referenceFilters=faceFilters, ... candidateFilters=eventFilters, ... descriptorTypeFilter="face", ... threshold=0.5, ... limit=1, ... description="matching_visitors" ... ) >>> print(response.statusCode) 202 >>> print(response.json) {'task_id': ...} 
 - Create and start estimator task - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/createEstimatorTask # pylint: disable=line-too-long - Parameters:
- source ( - Union[- EstimatorZipSource,- EstimatorS3Source,- EstimatorNetworkDiskSource,- EstimatorFTPSource,- EstimatorSambaSource]) – estimator task source
- description ( - Optional[- str]) – task description
- handler ( - Union[- EstimatorHandler,- EstimatorHandlerExtant,- str]) – handler for image processing, handler id or description + policies
- notificationPolicy ( - Optional[- TaskNotificationPolicy]) – task notification policy
- resultStoragePolicy ( - Optional[- ResultStoragePolicy]) – task result storage policy
 
- Returns:
- body contains json with task id. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.common.http_objs import Policies, DetectPolicy, ExtractPolicy, StoragePolicy, EventPolicy >>> from luna3.common.http_objs import NotificationPolicy, FacePolicy, LinkToListPolicy, EstimatorHandler >>> from luna3.tasks.http_objs import EstimatorZipSource >>> >>> listId = client.createList(raiseError=True).json["list_id"] >>> policies = Policies( ... detectPolicy=DetectPolicy(estimateEmotions=1, estimateMask=1), ... extractPolicy=ExtractPolicy(extractBasicAttributes=1, extractFaceDescriptor=1, fdScoreThreshold=0.0), ... storagePolicy=StoragePolicy( ... eventPolicy=EventPolicy(storeEvent=0), ... notificationPolicy=NotificationPolicy(sendNotification=0), ... facePolicy=FacePolicy(storeFace=1, linkToListsPolicy=[LinkToListPolicy(listId=listId)]), ... ), ... ) >>> response = client.createEstimatorTask( ... handler=EstimatorHandler(policies, "luna3_estimator_task_example"), ... source=EstimatorZipSource(url="http://127.0.0.1:5000/archive") ... ) >>> print(response.statusCode) 202 >>> print(response.json) {'task_id': ...} 
 - Create and start exporter task. - Parameters:
- filters ( - Union[- FaceFilters,- EventFilters]) – face/event filters
- columns ( - Optional[- List[- str]]) –- columns in csv report. For faces [“face_id”, “user_data”, “create_time”, “lists”, “external_id”, “attribute_id”, - ”avatar”, “event_id”] - For Events: [“event_id”, “create_time”, “end_time” “external_id”, “handler_id”, “attribute_id”,
- ”source”, “stream_id”, “top_match”, “match_result”, “extract_result”, “face_id”, “attach_result”, “gender”, “age”, “emotion”, “mask”, “ethnic_group”, “tags”, “user_data”] 
 
- csvDelimiter ( - str) – csv delimiter
- saveImages ( - Optional[- int]) – whether to save images in a report
- description ( - Optional[- str]) – description
- descriptorTypeFilter ( - Optional[- str]) – descriptor type filter, one of: face or body
- notificationPolicy ( - Optional[- TaskNotificationPolicy]) – task notification policy
- resultStoragePolicy ( - Optional[- ResultStoragePolicy]) – task result storage policy
 
- Returns:
- body contains json with task id. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> >>> response = client.createExporterTask( ... description="report_task_one", ... csvDelimiter="$", ... filters=FaceFilters(accountId=client.accountId), ... columns=["face_id", "user_data", "create_time", "external_id", "lists", "avatar", "event_id"] ... ) >>> print(response.statusCode) 202 >>> print(response.json) {'task_id': ...} 
 - Create new face tests! - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/createFace - Parameters:
- externalId ( - Optional[- str]) – user-defined external id for face
- attributeId ( - Optional[- str]) – an attribute id associated with the face
- descriptors ( - Optional[- List[- Union[- bytes,- RawDescriptor]]]) – list of descriptors different versions
- descriptorSamples ( - List[- str]) – list of warp image id from which the attribute was extracted.
- basicAttributes ( - Optional[- dict]) – dict with basic attributes (age, gender, ethnicity)
- basicAttributesSamples ( - List[- str]) – list of warp image id from which the basic attribute was extracted.
- userData ( - Optional[- str]) – user data
- avatar ( - Optional[- str]) – avatar for face, references to a sample or a user-defined reference
- lists ( - Optional[- List[- str]]) – luna lists for linking face with them
- eventId ( - Optional[- str]) – event id associated with creating the face
- contentType ( - str) – content type to use (supported now: “application/json” (default), “application/msgpack”)
 
- Returns:
- body contains json with info about created face. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> response = client.createFace( ... externalId="2xQ2gprbMePw1s9gw9fvA==", ... userData="test_data05", ... avatar="https://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/Abbey_Lee.jpg/400px-Abbey_Lee.jpg", ... raiseError=True, ... ) >>> print(response.statusCode) 201 >>> print(response.json) {'face_id': ..., 'url': ...} 
 - Create and start gc task - Parameters:
- target ( - str) – garbage collection target: “events” to delete events, “general_events” to delete general events
- handlerId ( - Optional[- str]) – handler id
- userData ( - Optional[- str]) – user data for faces filtering
- listId ( - Optional[- str]) – list id for faces filtering
- generalEventType ( - Optional[- List[- str]]) – general event type
- eventCreateTimeLt ( - Optional[- str]) – general event create time upper excluding bound
- createTimeLt ( - Optional[- str]) – event create time upper excluding bound
- createTimeGte ( - Optional[- str]) – face create time bottom excluding bound
- insertTimeLt ( - Optional[- str]) – event insert time upper excluding bound
- storeResults ( - Optional[- bool]) – whether to store task results
- removeSamples ( - Optional[- bool]) – whether to remove samples along with the event or face
- removeImageOrigins ( - Optional[- bool]) – whether to remove image origins along with the event
- description ( - Optional[- str]) – task description
- notificationPolicy ( - Optional[- TaskNotificationPolicy]) – task notification policy
- resultStoragePolicy ( - Optional[- ResultStoragePolicy]) – task result storage policy
 
- Returns:
- body contains json with task id. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> from luna3.common.http_objs import DetectPolicy, Policies, ExtractPolicy >>> from testData.resources import FACE_WARP as image >>> >>> sampleId = client.saveFaceSample(image=image, raiseError=True).json["sample_id"] >>> attributeId = client.extractAttrFromSample( ... sampleIds=[sampleId], extractBasicAttributes=1, raiseError=True ... ).json[0]["attribute_id"] >>> faceId = client.createFace(attributeId=attributeId, raiseError=True).json["face_id"] >>> faceFilters = FaceFilters(faceIds=[faceId]) >>> policies = Policies(detectPolicy=DetectPolicy(detectFace=1), extractPolicy=ExtractPolicy()) >>> handlerId = client.createHandler( ... description="create_Gc_task", policies=policies, raiseError=True ... ).json["handler_id"] >>> event = client.emitEvents(handlerId, inputData=image, raiseError=True) >>> response = client.createGcTask( ... target="events", ... handlerId=handlerId, ... storeResults=True, ... removeSamples=True, ... removeImageOrigins=True, ... description="my_GcTask" ... ) >>> print(response.statusCode) 202 >>> print(response.json) {'task_id': ...} 
 - Create new stream group. - Parameters:
- groupName ( - str) – group name
- description ( - Optional[- str]) – group description
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with created group name and id will be returned. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> response = client.createGroup( ... groupName="test_group", ... description="test group description", ... raiseError=True, ... ) >>> print(response.statusCode) 201 >>> groupId = response.json["group_id"] >>> response = client.getGroup(groupId=groupId, raiseError=True) >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "account_id": ..., "create_time": ..., "description": "test group description", "group_id": ..., "group_name": "test_group" } 
 - Create new handler. Handler determinate a list of rules for proccessing input images. You can set parameters for detecting faces, extracting attributes. You can set rules for matching attributes and creating faces from them. - Parameters:
- policies ( - Optional[- Policies]) – object with policies information
- handlerType ( - Optional[- int]) – handler type (0 - static, 1 - dynamic, 2 - lambda)
- description ( - Optional[- str]) – user description
 
- Returns:
- body contains json with new handler id and url. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.common.http_objs import DetectPolicy, ExtractPolicy, StoragePolicy, LinkToListPolicy >>> from luna3.common.http_objs import MatchPolicy, Filters, Policies, FacePolicy >>> from luna3.common.http_objs import MatchPolicyCandidates, ConditionalTagPolicy >>> >>> response = client.createHandler(handlerType=1, description="dynamic") >>> print(response.statusCode) 201 >>> print(json.dumps(response.json, sort_keys=True)) {"external_url": "http://127.0.0.1:5000/6/handlers/...", "handler_id": ..., "url": ...} >>> listId = client.createList("strange_persons", raiseError=True).json["list_id"] >>> policies = Policies( ... detectPolicy=DetectPolicy( ... estimateHeadPose=1, ... estimateEmotions=1, ... estimateGaze=1, ... extractExif=1, ... estimateLiveness=DetectPolicy.LivenessEstimationPolicy(1, 0.5, 0.5), ... estimateDeepfake=DetectPolicy.DeepfakeEstimationPolicy(1, 0.5, 2), ... rollThreshold=20, ... ), ... extractPolicy=ExtractPolicy(extractBasicAttributes=1, extractFaceDescriptor=1, fdScoreThreshold=0.7772), ... matchPolicy=[ ... MatchPolicy( ... candidates=MatchPolicyCandidates(origin="faces", listId=listId), ... label="test_faces", ... gender=1, ... ethnicities=[1, 2], ... limit=3, ... ) ... ], ... storagePolicy=StoragePolicy( ... facePolicy=FacePolicy( ... storeFace=1, ... filters=Filters(ageGte=18, ageLt=40), ... setSampleAsAvatar=1, ... linkToListsPolicy=[LinkToListPolicy(listId=listId)], ... ) ... ), ... conditionalTagsPolicy=[ConditionalTagPolicy(tag="test_tag")] ... ) >>> response = client.createHandler(description="persons", policies=policies) >>> print(response.statusCode) 201 >>> print(json.dumps(response.json, sort_keys=True)) {"external_url": "http://127.0.0.1:5000/6/handlers/...", "handler_id": ..., "url": ...} 
 - Create lambda - Parameters:
- archive ( - bytes) – archive file bytes
- lambdaName ( - str) – name of lambda
- description ( - Optional[- str]) – lambda description
- lambdaType ( - Optional[- Literal[- 'standalone',- 'handlers',- 'tasks',- 'agent']]) – lambda type
- imageBuilder ( - Optional[- Literal[- 'kaniko',- 'buildah']]) – image builder type
- additionalUserDockerCommands ( - Optional[- List[- str]]) – additional user docker commands
- baseImageName ( - Optional[- str]) – base lambda image name
- baseImageTag ( - Optional[- str]) – base lambda image tag (for custom image)
- archiveTtl ( - Optional[- Literal[- -1,- 1,- 2,- 3,- 4,- 5,- 6,- 7,- 14,- 30,- 60,- 90,- 180,- 365]]) – ttl for lambda archive
- workers ( - Optional[- int]) – count of lambda workers
- enableGPU ( - Optional[- bool]) – whether to enable GPU
- podCount ( - Optional[- int]) – count of lambda pods
- cpuLimit ( - Optional[- int]) – cpu limit for lambda in cpu units
- ramLimit ( - Optional[- int]) – ram limit for lambda in GB
- cpuRequest ( - Optional[- int]) – cpu request for lambda in cpu units
- ramRequest ( - Optional[- int]) – ram request for lambda in GB
- namespace ( - Optional[- str]) – k8s namespace
- selector ( - Optional[- dict]) – kubernetes pod node selector
- imageName ( - Optional[- str]) – lambda image
- imageTag ( - Optional[- str]) – lambda image tag
- agentParameters ( - Optional[- AgentParameters]) – lambda agent parameters
- userConfig ( - Optional[- dict]) – lambda custom config
- shared ( - Optional[- int]) – whether lambda is shared
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with lambda_id will be returned. 
- Return type:
- class 
 - >>> import json >>> from uuid import uuid4 >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import LAMBDA_ARCHIVE >>> >>> response = client.createLambda(archive=LAMBDA_ARCHIVE, lambdaName=str(uuid4())) >>> print(response.statusCode) 202 >>> print(json.dumps(response.json, sort_keys=True)) {"lambda_id": ...} >>> _ = client.deleteLambda(lambdaId=response.json["lambda_id"]) 
 - Create and start lambda task - Parameters:
- content ( - dict) – task content
- description ( - Optional[- str]) – task description
- notificationPolicy ( - Optional[- TaskNotificationPolicy]) – task notification policy
- resultStoragePolicy ( - Optional[- ResultStoragePolicy]) – task result storage policy
 
- Returns:
- body contains json with task id. 
- Return type:
- LunaResponse 
 
 - Create and start linker task - Parameters:
- filters ( - Union[- FaceFilters,- EventFilters]) – required one of: face or event filters
- listId ( - Optional[- str]) – list id to link faces to | WARNING required one of: listId or createList(1)
- createList ( - Optional[- int]) – if 1 create list to link faces to or 0 to link them to list with id equals listId | WARNING required one of: listId or createList(1)
- listUserData ( - Optional[- str]) – user data of list to be created when ‘createList’ is set to 1
- description ( - Optional[- str]) – description
- notificationPolicy ( - Optional[- TaskNotificationPolicy]) – task notification policy
- resultStoragePolicy ( - Optional[- ResultStoragePolicy]) – task result storage policy
 
- Returns:
- body contains json with task id. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> >>> listId = client.createList("happy_persons", raiseError=True).json["list_id"] >>> faceId = client.createFace(userData="link_faces", raiseError=True).json["face_id"] >>> faceFilters = FaceFilters(faceIds=[faceId], userData="link_faces") >>> response = client.createLinkerTask( ... listId=listId, ... filters=faceFilters, ... listUserData="my_awesome_list", ... description="my_LinkerTask" ... ) >>> print(response.statusCode) 202 >>> print(response.json) {'task_id': ...} 
 - Create new list - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/createList - Parameters:
- userData ( - Optional[- str]) – user data associated with the list (<= 128 characters)
- Returns:
- body contains json with information about created list. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> response = client.createList("strange_persons") >>> print(response.statusCode) 201 >>> print(json.dumps(response.json, sort_keys=True)) {"external_url": "http://127.0.0.1:5000/6/lists/...", "list_id":..., "url":...} 
 - Create and start ROC task - Parameters:
- markup ( - List[- dict]) – markup list of dicts with face id and label (group id)
- accountIdFilter ( - Optional[- str]) – account id filter
- thresholdHitTop ( - Optional[- float]) – similarity threshold to calculate hit into the top-N
- limit ( - Optional[- int]) – maximum candidates count per reference
- keyFPRs ( - Optional[- List[- float]]) – roc-curve key FRP value list
- description ( - Optional[- str]) – description
- notificationPolicy ( - Optional[- TaskNotificationPolicy]) – task notification policy
- resultStoragePolicy ( - Optional[- ResultStoragePolicy]) – task result storage policy
 
- Returns:
- body contains json with task id. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import FACE_WARP >>> >>> sampleId = client.saveFaceSample(FACE_WARP, raiseError=True).json["sample_id"] >>> attributeId = client.extractAttrFromSample( ... sampleIds=[sampleId], extractBasicAttributes=1, raiseError=True ... ).json[0]["attribute_id"] >>> faceId = client.createFace(attributeId=attributeId).json["face_id"] >>> faceId_2 = client.createFace(attributeId=attributeId).json["face_id"] >>> response = client.createROCTask( ... markup=[{"face_id": faceId, "label": 0}, {"face_id": faceId_2, "label": 1}], ... description="matching_people", ... thresholdHitTop=0.95, ... limit=2, ... keyFPRs=[0.000001, 0.001] ... ) >>> print(response.statusCode) 202 >>> print(response.json) {'task_id': ...} 
 - Create and start clustering task - Parameters:
- taskId ( - int) – source task id
- columns ( - Optional[- List[- str]]) –- columns in csv report. For faces [“user_data”, “create_time”, “lists”, “external_id”, “attribute_id”, - ”avatar”, “event_id”] - For Events: [“create_time”, “external_id”, “handler_id”, “attribute_id”, “source”, “stream_id,
- ”top_match”, “end_time”, “match_result”, “extract_result”, “face_id”, “attach_result”, “gender”, “age”, “emotion”, “mask”, “ethnic_group”, “tags”, “user_data”] 
 
- csvDelimiter ( - str) – csv delimiter
- saveImages ( - Optional[- int]) – whether to save images in a report
- description ( - Optional[- str]) – description
- notificationPolicy ( - Optional[- TaskNotificationPolicy]) – task notification policy
- resultStoragePolicy ( - Optional[- ResultStoragePolicy]) – task result storage policy
 
- Returns:
- body contains json with task id. 
- Return type:
- LunaResponse 
 - >>> import time >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> >>> faceFilters = FaceFilters(accountId=client.accountId, userData="task_clustering_faces") >>> taskId = client.createClusteringTask( ... filters=faceFilters, descriptorTypeFilter="face", raiseError=True ... ).json["task_id"] >>> time.sleep(1) >>> response = client.createReportTask( ... taskId=taskId, ... columns=["user_data", "create_time"], ... description="report_task", ... csvDelimiter="$" ... ) >>> print(response.statusCode) 202 >>> print(response.json) {'task_id': ...} 
 - Create schedule - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/createSchedule # pylint: disable=line-too-long - Parameters:
- taskType ( - Literal[- 1,- 2,- 3,- 4,- 6,- 7,- 8,- 9,- 10]) – type of task
- contentKwargs ( - dict) – kwargs for create content
- cron ( - str) – cron string
- cronTz ( - Optional[- str]) – cron timezone
- startImmediately ( - Optional[- bool]) – start task immediately
- createStopped ( - Optional[- bool]) – create task stopped schedule task
- taskNotificationPolicy ( - Optional[- TaskNotificationPolicy]) – task notification policy
- resultStoragePolicy ( - Optional[- ResultStoragePolicy]) – task result storage policy
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with schedule id. 
- Return type:
- class 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> >>> response = client.createSchedule( ... accountId=client.accountId, ... taskType=1, ... contentKwargs=dict( ... filters=FaceFilters(accountId=client.accountId), createList=1 ... ), ... cron="5 4 * * *", ... cronTz="utc", ... startImmediately=False, ... ) >>> print(response.statusCode) 201 >>> print(response.json) {'schedule_id': ...} 
 - Create schedule template - Parameters:
- scheduleTemplate ( - ScheduleTemplate) – schedule template object
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.video_manager.http_objs import ScheduleTemplate >>> response = client.createScheduleTemplate( ... scheduleTemplate=ScheduleTemplate( ... startTime="2025-05-01T00:00:00.000000+00:00", ... endTime="2025-05-16T00:00:00.000000+00:00", ... cron="5 4 * * 4", ... duration=11, ... durationType="minute", ... ), ... raiseError=True, ... ) >>> print(response.statusCode) 201 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "intervals": [ { "end_time": ..., "start_time": ... }, { "end_time": ..., "start_time": ... }, { "end_time": ..., "start_time": ... } ], "schedule_id": ... } 
 - Create new stream in luna-streams :type analytics: - List[- StreamAnalytic] :param analytics: stream analytics :type name:- Optional[- str] :param name: stream name :type description:- Optional[- str] :param description: stream description :type streamType:- Literal[- 'stream',- 'videofile'] :param streamType: stream type :type downloadable:- bool:param downloadable: whether reference is downloadable :type timestampSource:- Literal[- 'pts',- 'server',- 'frame_rate',- 'auto'] :param timestampSource: timestamp source where pts - video labels, server - server time, frame_rate - video file- auto logic described in openapi - Parameters:
- reference ( - str) – stream URL
- orientationStrategy ( - Literal[- 'static',- 'video_info']) – orientation strategy
- rotation ( - Optional[- Literal[- 0,- 90,- 180,- 270]]) – angle of camera frame rotation (0, 90, 180 or 270)
- pts ( - Optional[- VideoPTS]) – video pts settings
- fps ( - Optional[- Real]) – video decoder fps
- location ( - Optional[- Location]) – location that stream belongs
- source ( - Optional[- str]) – additional stream information
- restart ( - Optional[- Restart]) – auto-restart configuration
- groupName ( - Optional[- str]) – group name
- groupId ( - Optional[- str]) – group identifier
- timeout ( - Optional[- int]) – stream/videofile read timeout
- notificationPolicy ( - Optional[- StreamNotificationPolicy]) – stream notification policy
- splittable ( - Optional[- int]) – whether stream is splittable
- ffmpegKwargs ( - Optional[- dict]) – additional ffmpeg kwargs
- behaviorParameters ( - Optional[- BehaviorParameters]) – behavior parameters for stream
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with created stream id & version will be returned 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME >>> from luna3.video_manager.http_objs import StreamAnalytic >>> response = client.createStream( ... streamType="videofile", ... reference="http://reference", ... name="test_stream", ... description="test stream description", ... analytics=[StreamAnalytic(name=ANALYTIC_NAME)], ... raiseError=True, ... ) >>> print(response.statusCode) 201 >>> streamId = response.json["stream_id"] >>> response = client.getStream(streamId=streamId, raiseError=True) >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "account_id": ..., "analytics": [ { "analytic_name": "doctests_analytic", "autorestart": { "attempt_count": 10, "current_attempt": 0, "delay": 60, "last_attempt_time": null, "restart": 0, "status": "disabled" }, "parameters": {}, "status": ... } ], "create_time": ..., "data": { "behavior_parameters": ..., "downloadable": false, "ffmpeg_kwargs": ..., "fps": ..., "orientation_strategy": "static", "pts": { "start_time": 0.0 }, "reference": "http://reference", "rotation": 0, "timeout": ..., "timestamp_source": "auto", "type": "videofile" }, "description": "test stream description", "groups": [], "last_error": null, "location": { "area": null, "city": null, "district": null, "geo_position": null, "house_number": null, "street": null }, "name": "test_stream", "notification_policy": { "enable": 0, "stream_callbacks": [] }, "source": null, "splittable": 0, "status": 0, "stream_id": ..., "version": 1 } 
 - Create new token. - Parameters:
- grantAllPermissions ( - int) – grant all permissions to token
- tokenPermissions ( - Optional[- TokenPermissions]) – token permissions
- expirationTime ( - Optional[- str]) – token expiration time
- visibilityArea ( - Optional[- Literal[- 'all',- 'account']]) – token visibility area
- description ( - Optional[- str]) – account description
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with created token id and token will be returned. 
- Return type:
- class 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.accounts.http_objs import TokenPermissions >>> from uuid import uuid4 >>> >>> response = client.createToken(tokenPermissions=TokenPermissions()) >>> print(response.statusCode) 201 >>> print(response.json) {'token_id': ..., 'token': ..., 'url': ...} 
 - Create new verifier. Verifier determinate a list of rules for processing & verification of input images. You can set parameters for detecting faces, extracting attributes. You can set rules for matching attributes and creating faces from them. - Parameters:
- policies ( - Optional[- VerifierPolicies]) – object with policies information
- description ( - Optional[- str]) – user description
 
- Returns:
- body contains json with new verifier id and url 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.common.http_objs import VerifierPolicies, VerifierAttributePolicy, VerifierDetectPolicy >>> from luna3.common.http_objs import VerifierExtractPolicy, VerifierStoragePolicy, VerifierFaceSamplePolicy >>> >>> policies = VerifierPolicies( ... verificationThreshold=0.5, ... detectPolicy=VerifierDetectPolicy(estimateEmotions=1), ... extractPolicy=VerifierExtractPolicy(extractBasicAttributes=1), ... storagePolicy=VerifierStoragePolicy( ... faceSamplePolicy=VerifierFaceSamplePolicy(storeSample=1), ... attributePolicy=VerifierAttributePolicy(storeAttribute=1), ... ), ... ) >>> response = client.createVerifier(description="Happy_persons", policies=policies) >>> print(response.statusCode) 201 >>> print(json.dumps(response.json, sort_keys=True)) {"external_url": "http://127.0.0.1:5000/6/verifiers/...", "url": ..., "verifier_id": ...} 
 - Delete agent. - Parameters:
- agentId ( - str) – agent id
- accountId ( - Optional[- str]) – account_id
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME, ACCOUNT_ID, ANALYTIC_NAME >>> from luna3.video_manager.http_objs import Agent >>> agent = Agent( ... name="doctest_delete_agent", ... maxStreamCount=2, ... port=123, ... apiVersion=1, ... analyticNames=[ANALYTIC_NAME], ... description="Test agent" ... ) >>> agentId = client.createAgent(agent=agent).json["agent_id"] >>> >>> response = client.deleteAgent(agentId=agentId, accountId=ACCOUNT_ID) >>> print(response.statusCode) 204 
 - Delete analytics. - Parameters:
- analyticIds ( - list[- str]) – analytic ids
- accountId ( - Optional[- str]) – account_id
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> from time import sleep >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ACCOUNT_ID >>> from uuid import uuid4 >>> analyticId = client.createAnalytic( ... analytic=Analytic(analyticName=str(uuid4())), raiseError=True ... ).json["analytic_id"] >>> >>> response = client.deleteAnalytics( ... analyticIds=[analyticId], accountId=ACCOUNT_ID ... ) >>> >>> print(response.statusCode) 204 
 - Delete attributes by id. Associated face (if it exists) also will be deleted. - Parameters:
- attributeId ( - str) – attribute Id
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import FACE_WARP >>> >>> sampleId = client.saveFaceSample(FACE_WARP, raiseError=True).json["sample_id"] >>> attributeId = client.extractAttrFromSample(sampleIds=[sampleId], raiseError=True).json[0]["attribute_id"] >>> response = client.deleteAttributeById(attributeId=attributeId) >>> print(response.statusCode) 204 
 - Delete body sample with id=sample_id - Parameters:
- sampleId ( - str) – sample Id
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import BODY_WARP as image >>> >>> sampleId = client.saveBodySample(image=image, raiseError=True).json["sample_id"] >>> response = client.deleteBodySample(sampleId=sampleId) >>> print(response.statusCode) 204 
 - Delete event by event_id and optional account_id. - Parameters:
- eventId ( - str) – event id
- accountId (str | None) – optional account id 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 
 - Delete face by id - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/deleteFace - Parameters:
- faceId ( - str) – face id
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> faceId = client.createFace(raiseError=True).json['face_id'] >>> response = client.deleteFace(faceId=faceId) >>> print(response.statusCode) 204 
 - Delete face attributes. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/deleteFaceAttributes # pylint: disable=line-too-long - Parameters:
- faceId ( - str) – face id
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> faceId = client.createFace(raiseError=True).json['face_id'] >>> response = client.deleteFaceAttributes(faceId=faceId) >>> print(response.statusCode) 204 
 - Delete face sample with id=sample_id - Parameters:
- sampleId ( - str) – sample Id
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import FACE_WARP as image >>> >>> sampleId = client.saveFaceSample(image=image, raiseError=True).json["sample_id"] >>> response = client.deleteFaceSample(sampleId=sampleId) >>> print(response.statusCode) 204 
 - Delete faces. Optional you can set, that faces must belong to account. - Parameters:
- faceIds ( - List[- str]) – face id list
- ignore ( - Optional[- int]) – ignore non-existing faces
 
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> faceId = client.createFace(raiseError=True).json['face_id'] >>> response = client.deleteFaces(faceIds=[faceId]) >>> print(response.statusCode) 204 
 - Delete general event by event_id and optional account_id. - Parameters:
- eventId ( - str) – event id
- accountId (str | None) – optional account id 
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 
 - Delete group. - Parameters:
- groupId ( - str) – group id
- withStreams ( - Optional[- bool]) – whether to delete the group will all its streams
- accountId ( - Optional[- str]) – account_id
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> groupId = client.createGroup( ... groupName="delete_group", ... description="test group description", ... raiseError=True, ... ).json["group_id"] >>> response = client.deleteGroup(groupId=groupId, withStreams=True) >>> print(response.statusCode) 204 >>> response = client.getGroup(groupId=groupId) >>> print(response.statusCode) 404 
 - Remove all streams of a group. - Parameters:
- groupId ( - str) – group id
- accountId ( - Optional[- str]) – account id
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME >>> from luna3.video_manager.http_objs import StreamAnalytic >>> groupId = client.createGroup( ... groupName="delete_group", ... description="test group description", ... raiseError=True, ... ).json["group_id"] >>> streamId = client.createStream( ... streamType="videofile", ... reference="http://reference", ... name="test_stream", ... description="test stream description", ... analytics=[StreamAnalytic(name=ANALYTIC_NAME)], ... groupId=groupId, ... raiseError=True, ... ).json["stream_id"] >>> response = client.deleteGroupStreams(groupId=groupId) >>> print(response.statusCode) 204 >>> response = client.getStream(streamId=streamId) >>> print(response.statusCode) 404 
 - Remove handler by id :rtype: - Union[- Awaitable[- LunaResponse],- LunaResponse]- Args:
- handlerId: handler id 
- Returns:
- LunaResponse: not contains response body. 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> handlerId = client.createHandler(handlerType=1, description="dynamic", raiseError=True).json["handler_id"] >>> response = client.deleteHandlerById(handlerId=handlerId) >>> print(response.statusCode) 204 
 - Delete image with id=image_id - Parameters:
- imageId ( - str) – image id
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import FACE_WARP as image >>> >>> imageId = client.saveImage(image=image, raiseError=True).json["image_id"] >>> response = client.deleteImage(imageId=imageId) >>> print(response.statusCode) 204 
 - Delete lambda by id. - Parameters:
- lambdaId ( - str) – lambda id
- accountIdFilter ( - Optional[- str]) – account id filter for delete lambda
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> from uuid import uuid4 >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import LAMBDA_ARCHIVE >>> >>> lambdaId = client.createLambda(archive=LAMBDA_ARCHIVE, lambdaName=str(uuid4())).json["lambda_id"] >>> response = client.deleteLambda(lambdaId=lambdaId) >>> print(response.statusCode) 204 
 - Remove list by id - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/deleteList - Parameters:
- listId ( - str) – list id
- withFaces ( - int) – remove lists and all the faces contained in the lists
 
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> listId = client.createList("strange_persons", raiseError=True).json["list_id"] >>> response = client.deleteList(listId=listId) >>> print(response.statusCode) 204 >>> listId = client.createList("happy_persons", raiseError=True).json["list_id"] >>> response = client.deleteList(listId=listId, withFaces = 1) >>> print(response.statusCode) 202 
 - Delete lists. Optional you can set, that lists must belong to account. - Parameters:
- listIds ( - List[- str]) – list ids
- withFaces ( - int) – remove lists and all the faces contained in the lists
 
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> listId = client.createList("strange_persons", raiseError=True).json["list_id"] >>> response = client.deleteLists(listIds=[listId]) >>> print(response.statusCode) 204 >>> listId = client.createList("happy_persons", raiseError=True).json["list_id"] >>> response = client.deleteLists(listIds=[listId], withFaces = 1) >>> print(response.statusCode) 202 
 - Delete object with id=object_id - Parameters:
- objectId ( - str) – object id
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> objectBody = "1,2,3" >>> contentType = "text/plain" >>> objectId = client.saveObject( ... objectBody=objectBody, contentType=contentType, raiseError=True ... ).json["object_id"] >>> response = client.deleteObject(objectId=objectId) >>> print(response.statusCode) 204 
 - Delete schedule by id - Parameters:
- scheduleId ( - int) – schedule id
- accountIdFilter ( - Optional[- str]) – account id to delete schedules
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with response. 
- Return type:
- class 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> contentKwargs=dict( ... filters=FaceFilters(accountId=client.accountId), createList=1 ... ) >>> response = client.createSchedule( ... accountId=client.accountId, ... taskType=1, ... contentKwargs=contentKwargs, ... cron="5 4 * * *", ... cronTz="utc", ... startImmediately=False, ... raiseError=True ... ) >>> scheduleId = response.json["schedule_id"] >>> response = client.deleteSchedule( ... scheduleId=scheduleId ... ) >>> print(response.statusCode) 204 
 - Create schedule template - Parameters:
- accountId ( - Optional[- str]) – account id
- scheduleId ( - str) – schedule id
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.video_manager.http_objs import ScheduleTemplate >>> scheduleId = client.createScheduleTemplate( ... scheduleTemplate=ScheduleTemplate( ... startTime="2025-05-01T00:00:00.000000+00:00", ... endTime="2025-05-16T00:00:00.000000+00:00", ... cron="5 4 * * 4", ... duration=11, ... durationType="minute", ... ), ... raiseError=True, ... ).json["schedule_id"] >>> response = client.deleteScheduleTemplate(scheduleId=scheduleId) >>> print(response.statusCode) 204 
 - Delete stream by id. - Parameters:
- streamId ( - str) – stream id
- accountId ( - Optional[- str]) – account id
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME >>> from luna3.video_manager.http_objs import StreamAnalytic >>> streamId = client.createStream( ... streamType="videofile", ... reference="http://reference", ... name="test_stream", ... description="test stream description", ... analytics=[StreamAnalytic(name=ANALYTIC_NAME)], ... raiseError=True, ... ).json["stream_id"] >>> response = client.deleteStream(streamId=streamId) >>> print(response.statusCode) 204 >>> response = client.checkStream(streamId=streamId) >>> print(response.statusCode) 404 
 - Delete stream analytics working intervals - Parameters:
- accountId ( - Optional[- str]) – account id
- streamId ( - str) – stream id
- analyticIdx ( - int) – index of analytics of interest
- intervalsIdx ( - int) – index of intervals of interest
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME >>> from luna3.video_manager.http_objs import StreamAnalytic, Schedule, Interval >>> streamId = client.createStream( ... streamType="stream", ... reference="http://reference", ... name="test_stream", ... description="test stream description", ... analytics=[StreamAnalytic( ... name=ANALYTIC_NAME, ... schedules=[Schedule(intervals=[ ... Interval(startTime="2025-05-01T01:16:00Z", endTime="2026-05-01T01:16:00Z")]) ... ])], ... raiseError=True, ... ).json["stream_id"] >>> response = client.deleteStreamAnalyticsWorkingIntervals( ... streamId=streamId, analyticIdx=0, intervalsIdx=0, raiseError=True ... ) >>> print(response.statusCode) 204 
 - Delete streams by filters (OR). - Parameters:
- streamIds ( - List[- str]) – stream ids
- accountId ( - Optional[- str]) – account id
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME >>> from luna3.video_manager.http_objs import StreamAnalytic >>> streamId = client.createStream( ... streamType="videofile", ... reference="http://reference", ... name="test_stream", ... description="test stream description", ... analytics=[StreamAnalytic(name=ANALYTIC_NAME)], ... raiseError=True, ... ).json["stream_id"] >>> response = client.deleteStreams(streamIds=[streamId]) >>> print(response.statusCode) 204 >>> response = client.checkStream(streamId=streamId) >>> print(response.statusCode) 404 
 - Delete streams logs - Parameters:
- logTimeLt ( - Optional[- str]) – log time lower excluded boundary
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> response = client.deleteStreamsLogs() >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "deleted_count": ... } 
 - Delete a task by the task id. Optional you can set, that task must belong to account. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/deleteTask - Parameters:
- taskId ( - int) – task id
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> taskId = client.createGcTask(target="events", raiseError=True).json["task_id"] >>> response = client.deleteTask(taskId=taskId) >>> print(response.statusCode) 204 
 - Delete token. - Parameters:
- tokenId ( - str) – token id
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return nothing in text field 
- Return type:
- class 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.accounts.http_objs import TokenPermissions >>> from uuid import uuid4 >>> import json >>> >>> tokenId = client.createToken(tokenPermissions=TokenPermissions(), raiseError=True).json["token_id"] >>> response = client.deleteToken(tokenId=tokenId) >>> print(response.statusCode) 204 
 - Remove verifier - Parameters:
- verifierId ( - str) – verifier id
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.common.http_objs import VerifierPolicies, VerifierAttributePolicy, VerifierDetectPolicy >>> from luna3.common.http_objs import VerifierExtractPolicy, VerifierStoragePolicy, VerifierFaceSamplePolicy >>> >>> policies = VerifierPolicies( ... verificationThreshold=0.5, ... detectPolicy=VerifierDetectPolicy(estimateEmotions=1), ... extractPolicy=VerifierExtractPolicy(extractBasicAttributes=1), ... storagePolicy=VerifierStoragePolicy( ... faceSamplePolicy=VerifierFaceSamplePolicy(storeSample=1), ... attributePolicy=VerifierAttributePolicy(storeAttribute=1), ... ), ... ) >>> verifierId = client.createVerifier( ... description="Happy_persons", policies=policies, raiseError=True ... ).json["verifier_id"] >>> response = client.deleteVerifier(verifierId=verifierId) >>> print(response.statusCode) 204 
 - Detect faces on input images. - Parameters:
- inputData ( - Union[- BinaryImage,- List[- BinaryImage],- List[- UrlForDetection],- List[- str]]) – one of: - Single image or images list for extraction (supported formats “jpeg, png, tif, ppm, bmp”). - list of urls with images - list of images’ ids
- multifacePolicy ( - int) – multiple face detection policy: 0 - multiple face detection not allowed, 1 - multiple face detection allowed, 2 - get best detection from the image
- estimateHeadPose ( - int) – Available values : 0, 1
- detectLandmarks68 ( - int) – Available values : 0, 1
- estimateQuality ( - int) – Available values : 0, 1
- estimateGaze ( - int) – Available values : 0, 1
- estimateEyesAttributes ( - int) – Available values : 0, 1
- estimateMouthAttributes ( - int) – Available values : 0, 1
- estimateEmotions ( - int) – Available values : 0, 1
- estimateMask ( - int) – Available values : 0, 1
- pitchThreshold ( - Optional[- int]) – maximum deviation pitch angle from 0
- rollThreshold ( - Optional[- int]) – maximum deviation roll angle from 0
- yawThreshold ( - Optional[- int]) – maximum deviation yaw angle from 0
- warpedImage ( - int) – Whether input image is a warped or arbitrary image.
- extractExif ( - Optional[- int]) – Whether to extract exif from the image
- useExifInfo ( - Optional[- int]) – whether to use exif info for auto orientation
- estimateFaceQuality ( - int) – whether to estimate face quality
 
- Returns:
- body contains json with samples, exif, filename for succeeded images and errors for failed images. 
- Return type:
- LunaResponse 
- Raises:
- ValueError – if no images were found 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import FACE_IMAGE >>> >>> response = client.detectFaces( ... inputData=FACE_IMAGE, ... multifacePolicy=1, ... estimateHeadPose=1, ... estimateEmotions=1, ... estimateQuality=1, ... estimateGaze=1, ... estimateMask=1, ... extractExif=1, ... estimateEyesAttributes=1, ... estimateMouthAttributes=1, ... pitchThreshold=20, ... rollThreshold=20, ... yawThreshold=20, ... useExifInfo=1, ... estimateFaceQuality=1, ... ) >>> print(response.statusCode) 201 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "images": [ { "detections": { "filtered_detections": { "face_detections": [ { "detection": { "attributes": { "emotions": { "estimations": { "anger": ..., "disgust": ..., "fear": ..., "happiness": ..., "neutral": ..., "sadness": ..., "surprise": ... }, "predominant_emotion": "neutral" }, "eyes_attributes": { "left_eye": { "iris_landmarks": [...], "state": "open" }, "right_eye": { "iris_landmarks": [...], "state": "open" } }, "gaze": { "pitch": ..., "yaw": ... }, "head_pose": { "pitch": ..., "roll": ..., "yaw": ... }, "mask": { "estimations": { "medical_mask": ..., "missing": ..., "occluded": ... }, "face_occlusion": { "estimations": { "chin": ..., "clear": ..., "correct": ..., "full": ..., "mouth": ..., "partially": ... }, "predominant_occlusion": "clear" }, "predominant_mask": "missing" }, "mouth_attributes": { "occluded": ..., "opened": ..., "score": ..., "smile": ... } }, "face_quality": { "checks": [...], "status": 0 }, "landmarks5": [...], "quality": { "blurriness": ..., "dark": ..., "illumination": ..., "light": ..., "specularity": ... }, "rect": { "height": ..., "width": ..., "x": ..., "y": ... } }, "filter_reasons": [...] } ] }, "samples": [] }, "error": { "desc": "Success", "detail": "Success", "error_code": 0, "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-0" }, "exif": {}, "filename": "raw_image", "status": 1 } ] } 
 - Emit input events. - Parameters:
- handlerId ( - str) – handler id
- inputData ( - Union[- BinaryImage,- List[- BinaryImage],- List[- UrlForDetection],- List[- str],- List[- SampleForDetection]]) – one of: - Single image or images list for extraction (supported formats “jpeg, png, tif, ppm, bmp”). - list of urls with images - list of images’ ids
- policies ( - Optional[- Policies]) – object with policies information for dynamic handler
- externalId ( - Optional[- str]) – external id
- userData ( - Optional[- str]) – user data
- aggregateAttributes ( - Optional[- int]) – aggregate all attributes (descriptot, age, gender) or not (0 or 1)
- source ( - Optional[- str]) – source
- streamId ( - Optional[- str]) – stream id
- city ( - Optional[- str]) – event city
- street ( - Optional[- str]) – event street
- area ( - Optional[- str]) – event area
- district ( - Optional[- str]) – event district
- houseNumber ( - Optional[- str]) – event house number
- latitude ( - Optional[- float]) – event latitude in degrees
- longitude ( - Optional[- float]) – event longitude in degrees
- tags ( - Optional[- str]) – tags
- trackId ( - Optional[- str]) – event track id
- imageType ( - int) – Image type (0 - raw image, 1 - face warped image, 2 - body warped image).
- lunaEventTime ( - Optional[- str]) – user defined event create time
- lunaEventEndTime ( - Optional[- str]) – user defined event end time
- useExifInfo ( - Optional[- int]) – whether to use exif info for auto orientation
- meta ( - Optional[- dict]) – user-defined event json metadata
 
- Returns:
- body contains json with created event info. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.common.http_objs import DetectPolicy, ExtractPolicy >>> from luna3.common.http_objs import MatchPolicy, Policies >>> from luna3.common.http_objs import MatchPolicyCandidates >>> from testData.resources import FACE_WARP as image >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> listId = client.createList(userData="happy_persons", raiseError=True).json["list_id"] >>> policies = Policies( ... detectPolicy=DetectPolicy(estimateEmotions=1, estimateMask=1), ... extractPolicy=ExtractPolicy(extractBasicAttributes=1, extractFaceDescriptor=1, fdScoreThreshold=0.0,), ... matchPolicy=[ ... MatchPolicy( ... candidates=MatchPolicyCandidates(origin="faces", listId=listId), ... label="happy", ... limit=3, ... threshold=0.5, ... gender=0, ... ) ... ], ... ) >>> handlerId = client.createHandler( ... description="test_handler", policies=policies, raiseError=True ... ).json["handler_id"] >>> response = client.emitEvents( ... handlerId, ... inputData=[image], ... city="Kazan", ... street="Saban", ... houseNumber="5", ... tags="test_tag", ... imageType=1, ... useExifInfo=1, ... meta={"foo": "bar"}, ... ) >>> print(response.statusCode) 201 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "events": [ { "aggregate_estimations": { "body": { "attributes": {} }, "face": { "attributes": { "emotions": { "estimations": { "anger": ..., "disgust": ..., "fear": ..., "happiness": ..., "neutral": ..., "sadness": ..., "surprise": ... }, "predominant_emotion": "neutral" }, "mask": { "estimations": { "medical_mask": ..., "missing": ..., "occluded": ... }, "face_occlusion": { "estimations": { "chin": ..., "clear": ..., "correct": ..., "full": ..., "mouth": ..., "partially": ... }, "predominant_occlusion": "clear" }, "predominant_mask": "missing" } } } }, "body_attributes": null, "detections": [ { "detect_time": ..., "detect_ts": null, "filename": "Claudia_Schiffer_warp.jpg", "image_origin": null, "samples": { "body": null, "face": { "detection": { "attributes": { "emotions": { "estimations": { "anger": ..., "disgust": ..., "fear": ..., "happiness": ..., "neutral": ..., "sadness": ..., "surprise": ... }, "predominant_emotion": "neutral" }, "mask": { "estimations": { "medical_mask": ..., "missing": ..., "occluded": ... }, "face_occlusion": { "estimations": { "chin": ..., "clear": ..., "correct": ..., "full": ..., "mouth": ..., "partially": ... }, "predominant_occlusion": "clear" }, "predominant_mask": "missing" } } }, "sample_id": ..., "url": "/6/samples/faces/..." } } } ], "event_id": ..., "external_id": "", "face": null, "face_attributes": { "attribute_id": null, "basic_attributes": { "age": ..., "ethnicities": { "estimations": { "african_american": ..., "asian": ..., "caucasian": ..., "indian": ... }, "predominant_ethnicity": "caucasian" }, "gender": 0 }, "samples": [...], "score": ..., "url": null }, "location": { "city": "Kazan", "house_number": "5", "street": "Saban" }, "matches": [ { "candidates": [], "label": "happy" } ], "meta": { "foo": "bar" }, "source": null, "stream_id": null, "tags": [ "test_tag" ], "track_id": null, "url": "/6/events/...", "user_data": "" } ], "filtered_detections": { "face_detections": [] }, "images": [ { "error": { "desc": "Success", "detail": "Success", "error_code": 0, "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-0" }, "filename": "Claudia_Schiffer_warp.jpg", "image_estimations": {}, "status": 1 } ] } 
 - Emit beta events. - Parameters:
- handlerId ( - str) – handler id
- inputData ( - StreamEventsSource) – structure with stream event(s) source
 
- Returns:
- body contains json with created event info. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.common.http_objs import DetectPolicy, ExtractPolicy >>> from luna3.common.http_objs import MatchPolicy, Policies >>> from luna3.common.http_objs import MatchPolicyCandidates >>> from luna3.handlers.http_objs import ( ... NonAggregatedRawImage, ... StreamEventSourceNonAggregated, ... StreamEventsSource, ... StreamEventSourceData, ... ) >>> from testData.resources import FACE_IMAGE >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> listId = client.createList(userData="happy_persons", raiseError=True).json["list_id"] >>> policies = Policies( ... detectPolicy=DetectPolicy(estimateEmotions=1, estimateMask=1), ... extractPolicy=ExtractPolicy(extractBasicAttributes=1, extractFaceDescriptor=1, fdScoreThreshold=0.0,), ... matchPolicy=[ ... MatchPolicy( ... candidates=MatchPolicyCandidates(origin="faces", listId=listId), ... label="happy", ... limit=3, ... threshold=0.5, ... gender=0, ... ) ... ], ... ) >>> handlerId = client.createHandler( ... description="test_handler", policies=policies, raiseError=True ... ).json["handler_id"] >>> response = client.emitStreamEvents( ... handlerId, ... inputData=StreamEventsSource( ... aggregateAttributes=0, ... sources=[ ... StreamEventSourceNonAggregated( ... sourceType="raw_image", source=NonAggregatedRawImage(body=FACE_IMAGE.body) ... ) ... ], ... ) ... ) >>> print(response.statusCode) 201 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "events": [ { "aggregate_estimations": { "body": { "attributes": {} }, "face": { "attributes": { "emotions": { "estimations": { "anger": ..., "disgust": ..., "fear": ..., "happiness": ..., "neutral": ..., "sadness": ..., "surprise": ... }, "predominant_emotion": "neutral" }, "mask": { "estimations": { "medical_mask": ..., "missing": ..., "occluded": ... }, "face_occlusion": { "estimations": { "chin": ..., "clear": ..., "correct": ..., "full": ..., "mouth": ..., "partially": ... }, "predominant_occlusion": "clear" }, "predominant_mask": "missing" } } } }, "body_attributes": null, "detections": [ { "detect_time": ..., "detect_ts": null, "filename": "raw_image", "image_origin": null, "samples": { "body": null, "face": { "detection": { "attributes": { "emotions": { "estimations": { "anger": ..., "disgust": ..., "fear": ..., "happiness": ..., "neutral": ..., "sadness": ..., "surprise": ... }, "predominant_emotion": "neutral" }, "mask": { "estimations": { "medical_mask": ..., "missing": ..., "occluded": ... }, "face_occlusion": { "estimations": { "chin": ..., "clear": ..., "correct": ..., "full": ..., "mouth": ..., "partially": ... }, "predominant_occlusion": "clear" }, "predominant_mask": "missing" } }, "landmarks5": [ [ ..., ... ], [ ..., ... ], [ ..., ... ], [ ..., ... ], [ ..., ... ] ], "rect": { "height": ..., "width": ..., "x": ..., "y": ... } }, "sample_id": ..., "url": ... } } } ], "event_id": ..., "external_id": ..., "face": null, "face_attributes": { "attribute_id": null, "basic_attributes": { "age": ..., "ethnicities": { "estimations": { "african_american": ..., "asian": ..., "caucasian": ..., "indian": ... }, "predominant_ethnicity": "caucasian" }, "gender": ... }, "samples": [ ... ], "score": ..., "url": null }, "location": {}, "matches": [ { "candidates": [], "label": "happy" } ], "meta": null, "source": null, "stream_id": null, "tags": [], "track_id": null, "url": ..., "user_data": ... } ], "filtered_detections": { "face_detections": [] }, "images": [ { "error": { "desc": "Success", "detail": "Success", "error_code": 0, "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-0" }, "filename": "raw_image", "image_estimations": {}, "status": 1 } ] } 
 - Export lambda - Parameters:
- lambdaId ( - str) – lambda id
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with lambda_id will be returned. 
- Return type:
- class 
 - >>> import json >>> from uuid import uuid4 >>> from time import sleep >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import LAMBDA_ARCHIVE >>> >>> def wait4start(lambdaId_: str): ... for _ in range(150): ... reply = client.getLambdaStatus(lambdaId_).json ... if reply["status"] == "running": ... break ... if reply["status"] == "terminated": ... raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId_}") ... sleep(1) ... else: ... raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId_}") ... >>> lambdaId = client.createLambda(archive=LAMBDA_ARCHIVE, lambdaName=str(uuid4())).json["lambda_id"] >>> wait4start(lambdaId) >>> response = client.exportLambda(lambdaId=lambdaId) >>> >>> print(response.statusCode) 200 
 - Extract attributes from samples. - Parameters:
- sampleIds ( - list) – list of samples
- scoreThreshold ( - float) – number [ 0 .. 1 ]; example: 0.99; descriptor quality score threshold. All the attributes with quality score below the threshold will be ignored (and not stored in the DB). The function will proceed as usual with all the remaining descriptors (if left).
- extractDescriptor ( - int) – Available values : 0, 1; whether to extract face descriptor(s)
- extractBasicAttributes ( - int) – Available values : 0, 1; whether to extract basic attributes (gender, age, ethnicity)
- aggregateAttributes ( - int) – Available values : 0, 1; whether to aggregate face descriptor(s); If true, all extracted attributes will be aggregated and stored in as a single attribute. Otherwise, all attributes will be stored for every sample.
- ttl ( - Optional[- int]) – temporary attribute ttl
 
- Returns:
- body contains json with attributes info. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import FACE_WARP >>> >>> sampleId = client.saveFaceSample(FACE_WARP, raiseError=True).json["sample_id"] >>> response = client.extractAttrFromSample( ... sampleIds=[sampleId], extractBasicAttributes=1, extractDescriptor=1, ... ) >>> print(response.statusCode) 201 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) [ { "attribute_id": ..., "basic_attributes": { "age": 30, "ethnicities": { "estimations": { "african_american": ..., "asian": ..., "caucasian": ..., "indian": ... }, "predominant_ethnicity": "caucasian" }, "gender": 0 }, "external_url": "http://127.0.0.1:5000/6/attributes/...", "samples": [...], "score": ..., "url": "/6/attributes/..." } ] 
 - Create general ws-connection to luna-sender - Parameters:
- eventType ( - Optional[- List[- str]]) – list of general event types
- eventAccount ( - Optional[- str]) – general event account
- udFilters ( - Optional[- dict]) – user-defined general event filters
- accountId ( - Optional[- str]) – request account id
- login ( - Optional[- str]) – account login
- password ( - Optional[- str]) – account password
- token ( - Optional[- str]) – token
- asyncRequest ( - Optional[- bool]) – execution in asynchronous mode, disabled by default
- messageReceiveTimeout ( - Optional[- Real]) – message receive timeout (time between start waiting message and message appearance)
 
- Return type:
- Union[- _BaseRequestContextManager[- ClientWebSocketResponse],- contextmanager]
- Returns:
- context manager with connection to luna-sender 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> >>> with client.generalConnect(["event_type1", "event_type2"], messageReceiveTimeout=1) as ws: ... pass # receive event: ws.recv() >>> print(ws.status) 101 
 - Publish user generated event. :type event: - dict:param event: user generated single event to be published- >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> response = client.generalPublishOne( ... event={ ... "event": {"data":"value"}, ... "event_type": "crowd", ... "account_id": "string", ... "event_create_time": "string", ... "event_end_time": "string" ... } ... ) >>> print(response.statusCode) 204 
 - Get account. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/getAccount - Parameters:
- targets ( - Optional[- list[- str]]) – targets to get
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with account will be returned. 
- Return type:
- class 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from uuid import uuid4 >>> >>> response = client.getAccount() >>> print(response.statusCode) 200 >>> print(response.json) {'account_id': ..., 'login': ..., 'account_type': 'advanced_user', 'description': ..., 'create_time': ..., 'last_update_time': ...} 
 - Get account. - Parameters:
- page ( - int) – page, default 1
- pageSize ( - int) – page size, default 10
- login ( - Optional[- str]) – account login
- accountType ( - Optional[- Literal[- 'admin',- 'advanced_user',- 'user']]) – account type
- createTimeLt ( - Optional[- str]) – upper bound for account create_time
- createTimeGte ( - Optional[- str]) – lower bound for account create_time
- targets ( - Optional[- list[- str]]) – targets to get
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with account will be returned. 
- Return type:
- class 
 - >>> import json >>> from uuid import uuid4 >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> accountLogin = f"{uuid4()}@visionlabs.ru" >>> _ = client.createAccount( ... accountId=str(uuid4()), login=accountLogin, password="pwd", accountType="user" ... ) >>> response = client.getAccounts( ... login=accountLogin, targets=["account_id", "login"], raiseError=True ... ) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "accounts": [ { "account_id": ..., "login": ... } ], "total_count": ... } 
 - Get all stream analytics working intervals - Parameters:
- accountId ( - Optional[- str]) – account id
- streamId ( - str) – stream id
- analyticIdx ( - int) – index of analytics of interest
- merged ( - bool) – whether to return merged intervals or not
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME >>> from luna3.video_manager.http_objs import StreamAnalytic, Schedule, Interval >>> streamId = client.createStream( ... streamType="stream", ... reference="http://reference", ... name="test_stream", ... description="test stream description", ... analytics=[StreamAnalytic( ... name=ANALYTIC_NAME, ... schedules=[Schedule(intervals=[ ... Interval(startTime="2025-05-01T01:16:00Z", endTime="2026-05-01T01:16:00Z")]) ... ])], ... raiseError=True, ... ).json["stream_id"] >>> response = client.getAllStreamAnalyticsWorkingIntervals(streamId=streamId, analyticIdx=0, raiseError=True) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "intervals": [ { "intervals": [ { "end_time": ..., "start_time": ... } ], "intervals_idx": 0 } ] } 
 - Get analytic. - Parameters:
- analyticId ( - str) – analytic id
- accountId ( - Optional[- str]) – account_id
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with group will be returned. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_ID >>> response = client.getAnalytic(analyticId=ANALYTIC_ID) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "account_id": ..., "analytic_id": ...", "analytic_name": "doctests_analytic", "analytic_version": 1, "create_time": ..., "default_parameters": {}, "description": "", "last_update_time": ..., "validation_schema": {} } 
 - Get analytic’s documentation. - Parameters:
- analyticId ( - str) – analytic id
- accountId ( - Optional[- str]) – account_id
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with group will be returned. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_ID >>> response = client.getAnalyticDocumentation(analyticId=ANALYTIC_ID) >>> print(response.statusCode) 200 
 - Get analytics by filters. - Parameters:
- accountId ( - Optional[- str]) – account id
- analyticNames ( - Optional[- List[- str]]) – analytic names
- analyticIds ( - Optional[- List[- str]]) – analytic ids
- order ( - Optional[- Literal[- 'asc',- 'desc']]) – order
- analyticIdGte ( - Optional[- str]) – analytic id upper included boundary
- analyticIdLt ( - Optional[- str]) – analytic id lower excluded boundary
- createTimeGte ( - Optional[- str]) – agent create time upper included boundary
- createTimeLt ( - Optional[- str]) – agent create time lower excluded boundary
- page ( - Optional[- int]) – page number
- pageSize ( - Optional[- int]) – page size
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with groups will be returned. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME >>> response = client.getAnalytics(analyticNames=[ANALYTIC_NAME]) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "analytics": [ { "account_id": ..., "analytic_id": ..., "analytic_name": "doctests_analytic", "analytic_version": 1, "create_time": ..., "default_parameters": {}, "description": "", "last_update_time": ..., "validation_schema": {} } ] } 
 - Get final async mode. - Parameters:
- asyncRequest ( - Optional[- bool]) – async mode as function argument.
- Return type:
- bool
- Returns:
- If async is None, return self.asyncRequest else async 
 
 - Retrieve a attribute by id. - Parameters:
- attributeId ( - str) – attribute id
- accountIdFilter ( - Optional[- str]) – account id to get attribute samples
 
- Returns:
- body contains json with samples. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import FACE_WARP >>> >>> sampleId = client.saveFaceSample(FACE_WARP, raiseError=True).json["sample_id"] >>> attributeId = client.extractAttrFromSample(sampleIds=[sampleId], raiseError=True).json[0]["attribute_id"] >>> response = client.getAttributeSamples(attributeId=attributeId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True)) {"samples": [...]} 
 - Get attributes ids by filters - Parameters:
- attributeIds ( - list[- str]) – list of attributes of interest
- targets ( - Optional[- list[- str]]) – Available targets: descriptor, basic_attributes, basic_attributes_samples, face_descriptors_samples, account_id, create_time
- descriptorVersion ( - int) – descriptor version to receive
- accountIdFilter ( - Optional[- str]) – account id to get attributes
 
- Returns:
- body contains json with attributes info. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import FACE_WARP, DESCRIPTOR >>> >>> sampleId = client.detectFaces( ... inputData=FACE_WARP, raiseError=True ... ).json["images"][0]["detections"]["samples"][0]["face"]["sample_id"] >>> basicAttributes = {'ethnicity': 3, 'age': 26, 'gender': 0} >>> attributeId = client.createAttribute( ... basicAttributes = basicAttributes, basicAttributesSamples=[sampleId], descriptorSamples=[sampleId], ... descriptors=[DESCRIPTOR], raiseError=True ... ).json["attribute_id"] >>> response = client.getAttributes( ... attributeIds=[attributeId], targets=["basic_attributes_samples", "account_id"] ... ) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True)) {"attributes": [{"account_id": ..., "basic_attributes_samples": [...]}]} 
 - Get authorization header by token or login and password - Parameters:
- login ( - Optional[- str]) – login
- password ( - Optional[- str]) – password
- token ( - Optional[- str]) – token
- accountId ( - Optional[- str]) – account id
 
- Return type:
- dict
- Returns:
- dict with Authorization header if applicable or empty dict 
 
 - Get basic attributes (gender, age, ethnicity) by attrribute id. - Parameters:
- attributeId ( - str) – attribute Id
- descriptorVersion ( - int) – descriptor version to receive
- targets ( - Optional[- list[- str]]) – Available targets: descriptor, basic_attributes, basic_attributes_samples, face_descriptors_samples, account_id, create_time
- accountIdFilter ( - Optional[- str]) – account id to get attribute
 
- Returns:
- body contains json with basic attributes. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import FACE_WARP >>> >>> sampleId = client.saveFaceSample(FACE_WARP, raiseError=True).json["sample_id"] >>> attributeId = client.extractAttrFromSample( ... sampleIds=[sampleId], extractBasicAttributes=1, extractDescriptor=1, raiseError=True, ... ).json[0]["attribute_id"] >>> response = client.getBasicAttributesById( ... attributeId, targets=["create_time", "attribute_id", "account_id", "face_descriptor_samples", ... "basic_attributes_samples", "face_descriptor", "basic_attributes"] ... ) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "account_id": ..., "attribute_id": ..., "basic_attributes": { "age": ..., "ethnicity": ..., "gender": ... }, "basic_attributes_samples": [...], "create_time": ..., "face_descriptor": ..., "face_descriptor_samples": [...] } 
 - Return aiohttp request body or body_producer. - Parameters:
- images ( - Union[- BinaryImage,- Iterable[- BinaryImage]]) – image or list of images
- Return type:
- Union[- MultipartWriter,- bytes]
- Returns:
- request body 
 
 - Function prepare body and content type for request, depends on incoming image(s). - Parameters:
- headers ( - dict) – request’s headers to update
- images ( - Union[- BinaryImage,- List[- BinaryImage]]) – Single image or images list for extraction or None
 
- Return type:
- Union[- MultipartWriter,- bytes,- None]
- Returns:
- list of image(s) and list of url(s) 
 
 - Get body sample by id - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/getSample - Parameters:
- sampleId ( - str) – sample Id
- accountIdFilter ( - Optional[- str]) – account id to get sample
 
- Returns:
- body contains image as bytes. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import BODY_WARP as image >>> >>> sampleId = client.saveBodySample(image=image, raiseError=True).json["sample_id"] >>> response = client.getBodySample(sampleId=sampleId) >>> print(response.statusCode) 200 >>> print(response.contentType) image/jpeg >>> assert image.body == response.body 
 - Get config of luna service - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/getConfig - Parameters:
- acceptHeaders ( - Optional[- dict]) – Accept request header. By default Accept-Type is application/json.
- lunaRequestId ( - Optional[- str]) – External request id. Helps uniquely identifying messages, corresponding to particular requests, in system logs. Pattern: ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$
- asyncRequest ( - Optional[- bool]) – execution in asynchronous mode, disabled by default
- raiseError ( - Optional[- bool]) – if request fails, LunaApiException is raised
- totalTimeout ( - Optional[- Real]) – request processing timeout in seconds.
- connectTimeout ( - Optional[- Real]) – connection timeout seconds.
- sockReadTimeout ( - Optional[- Real]) – socket read timeout
- sockConnectTimeout ( - Optional[- Real]) – socket connect timeout
 
- Returns:
- body contains json with HTML or YAML as bytes. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> response= client.getConfig() >>> print(response.statusCode) 200 >>> print(json.dumps(response.json["LUNA_MONITORING"], sort_keys=True, indent=4)) { "BUCKET": "luna_monitoring", "FLUSHING_PERIOD": 1, "HOST": ..., "ORGANIZATION": "luna", "PORT": 8086, "SEND_DATA_FOR_MONITORING": 1, "STORAGE_TYPE": "influx", "TOKEN": "********", "USE_SSL": 0 } 
 - Get deleted events. - Parameters:
- deletionTimeGte ( - Optional[- str]) – lower including deletion time boundary
- deletionTimeLt ( - Optional[- str]) – upper excluding end time boundary
- eventIds ( - Optional[- list[- str]]) – event ids
- eventIdGte ( - Optional[- str]) – event id lower including bound
- eventIdLt ( - Optional[- str]) – event id upper excluding bound
- page ( - Optional[- int]) – number of result page
- pageSize ( - Optional[- int]) – count of results in page
- order ( - Optional[- str]) – result sort order (ask or desc)
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with events will be returned. 
- Return type:
- class 
 
 - Get deleted general events. - Parameters:
- deletionTimeGte ( - Optional[- str]) – lower including deletion time boundary
- deletionTimeLt ( - Optional[- str]) – upper excluding end time boundary
- eventIds ( - Optional[- list[- str]]) – event ids
- eventIdGte ( - Optional[- str]) – event id lower including bound
- eventIdLt ( - Optional[- str]) – event id upper excluding bound
- page ( - Optional[- int]) – number of result page
- pageSize ( - Optional[- int]) – count of results in page
- order ( - Optional[- str]) – result sort order (ask or desc)
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with events will be returned. 
- Return type:
- class 
 
 - Get Development Manual of luna service - Parameters:
- lunaRequestId ( - Optional[- str]) – External request id. Helps uniquely identifying messages, corresponding to particular requests, in system logs. Pattern: ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$
- asyncRequest ( - Optional[- bool]) – execution in asynchronous mode, disabled by default
- raiseError ( - Optional[- bool]) – if request fails, LunaApiException is raised
- totalTimeout ( - Optional[- Real]) – request processing timeout in seconds.
- connectTimeout ( - Optional[- Real]) – connection timeout seconds.
- sockReadTimeout ( - Optional[- Real]) – socket read timeout
- sockConnectTimeout ( - Optional[- Real]) – socket connect timeout
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return HTML as bytes. 
- Return type:
- class 
 
 - Get error by id. - Parameters:
- errorId ( - int) – error id
- accountIdFilter ( - Optional[- str]) – account id to get error
 
- Returns:
- body contains json with info about errors of a task. 
- Return type:
- LunaResponse 
 - >>> import json >>> import time >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> >>> unknownFaceId = "668ea250-9341-484f-a103-8dda6994a654" >>> faceFilters = FaceFilters(faceIds=[unknownFaceId]) >>> taskId = client.createClusteringTask( ... filters=faceFilters, descriptorTypeFilter="face", raiseError=True ... ).json["task_id"] >>> time.sleep(1) >>> errorId = client.getTaskErrors(taskId=taskId, raiseError=True).json["errors"][0]["error_id"] >>> response = client.getError(errorId=errorId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "additional_info": ..., "description": "Objects not found", "detail": "Objects for clustering not found (empty set)", "error_code": 28010, "error_id": ..., "error_time": ..., "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28010", "subtask_id": ..., "task_id": ... } 
 - Get errors with filters. - Parameters:
- errorIds ( - Optional[- List[- int]]) – error ids
- taskIds ( - Optional[- List[- int]]) – task ids
- errorTimeLt ( - Optional[- str]) – error time upper excluding bound
- errorTimeGte ( - Optional[- str]) – error time lower including bound
- taskType ( - Optional[- int]) – task type filter
- errorCode ( - Optional[- int]) – task status filter
- page ( - Optional[- int]) – page
- pageSize ( - Optional[- int]) – page size
- accountIdFilter ( - Optional[- str]) – account id to get errors
 
- Returns:
- body contains json with info about errors of a task. 
- Return type:
- LunaResponse 
 - >>> import json >>> import time >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> >>> unknownFaceId = "668ea250-9341-484f-a103-8dda6994a654" >>> faceFilters = FaceFilters(faceIds=[unknownFaceId]) >>> taskId = client.createClusteringTask( ... filters=faceFilters, descriptorTypeFilter="face", raiseError=True ... ).json["task_id"] >>> time.sleep(1) >>> errorCode = client.getTaskErrors(taskId=taskId, raiseError=True).json["errors"][0]["error_code"] >>> response = client.getErrors(errorCode=errorCode) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json["errors"][0], sort_keys=True, indent=4)) { "additional_info": ..., "description": "Objects not found", "detail": "Objects for clustering not found (empty set)", "error_code": 28010, "error_id": ..., "error_time": ..., "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28010", "subtask_id": ..., "task_id": ... } 
 - Get errors count with filters. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/getTasksErrorsCount # pylint: disable=line-too-long - Parameters:
- errorIds ( - Optional[- List[- int]]) – error ids
- taskIds ( - Optional[- List[- int]]) – task ids
- errorTimeLt ( - Optional[- str]) – error time upper excluding bound
- errorTimeGte ( - Optional[- str]) – error time lower including bound
- taskType ( - Optional[- int]) – task type filter
- errorCode ( - Optional[- int]) – task status filter
- accountIdFilter ( - Optional[- str]) – account id to get errors count
 
- Returns:
- body contains json with errors count. 
- Return type:
- LunaResponse 
 - >>> import json >>> import time >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> >>> unknownFaceId = "668ea250-9341-484f-a103-8dda6994a654" >>> faceFilters = FaceFilters(faceIds=[unknownFaceId]) >>> taskId = client.createClusteringTask( ... filters=faceFilters, descriptorTypeFilter="face", raiseError=True ... ).json["task_id"] >>> time.sleep(1) >>> errorCode = client.getTaskErrors(taskId=taskId, raiseError=True).json["errors"][0]["error_code"] >>> response = client.getErrorsCount(errorCode=errorCode) >>> print(response.statusCode) 200 >>> print(response.json) {'count': ...} 
 - Get event by id. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/getEvent - Parameters:
- eventId ( - str) – event id
- target ( - Optional[- List[- Literal[- 'account_id',- 'create_time',- 'end_time',- 'event_id',- 'handler_id',- 'external_id',- 'source',- 'stream_id',- 'top_match',- 'match_result',- 'face_detections',- 'face_id',- 'attach_result',- 'gender',- 'age',- 'emotion',- 'ethnic_group',- 'liveness',- 'deepfake',- 'body_detections',- 'body_basic_attributes',- 'upper_body',- 'lower_body',- 'accessories',- 'tags',- 'user_data',- 'location',- 'mask',- 'track_id',- 'meta']]]) – list of events’ fields to receive instead of full events
- accountIdFilter ( - Optional[- str]) – account id to get event
 
- Returns:
- body contains json with event info. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.common.http_objs import Policies, DetectPolicy >>> from testData.resources import FACE_WARP >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> policies = Policies(detectPolicy=DetectPolicy(detectFace=1)) >>> handlerId = client.createHandler( ... description="test_handler_events", policies=policies, raiseError=True ... ).json["handler_id"] >>> eventId = client.emitEvents( ... handlerId=handlerId, ... inputData=[FACE_WARP], ... city="Kazan", ... street="Saban", ... houseNumber="5", ... imageType=1, ... useExifInfo=1, ... meta={"foo": "bar"}, ... raiseError=True, ... ).json["events"][0]["event_id"] >>> response = client.getEvent(eventId=eventId) >>> print(response.statusCode) 200 - >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "accessories": null, "account_id": ..., "age": null, "attach_result": [], "body_basic_attributes": null, "body_detections": null, "create_time": ..., "deepfake": null, "emotion": null, "end_time": ..., "ethnic_group": null, "event_id": ..., "external_id": "", "face_detections": [ { "detect_time": ..., "detect_ts": null, "image_origin": null, "sample_id": ... } ], "face_id": null, "gender": null, "handler_id": ..., "liveness": null, "location": { "area": null, "city": "Kazan", "district": null, "geo_position": null, "house_number": "5", "street": "Saban" }, "lower_body": null, "mask": null, "match_result": null, "meta": { "foo": "bar" }, "source": null, "stream_id": null, "tags": null, "top_match": null, "track_id": null, "upper_body": null, "user_data": "" } 
 - Get events by filters. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/getEvents - Parameters:
- target ( - Optional[- List[- Literal[- 'account_id',- 'create_time',- 'end_time',- 'event_id',- 'handler_id',- 'external_id',- 'source',- 'stream_id',- 'top_match',- 'match_result',- 'face_detections',- 'face_id',- 'attach_result',- 'gender',- 'age',- 'emotion',- 'ethnic_group',- 'liveness',- 'deepfake',- 'body_detections',- 'body_basic_attributes',- 'upper_body',- 'lower_body',- 'accessories',- 'tags',- 'user_data',- 'location',- 'mask',- 'track_id',- 'meta']]]) – list of events’ fields to receive instead of full events
- createTimeGte ( - Optional[- str]) – lower including create time boundary
- createTimeLt ( - Optional[- str]) – upper excluding create time boundary
- endTimeGte ( - Optional[- str]) – lower including end time boundary
- endTimeLt ( - Optional[- str]) – upper excluding end time boundary
- insertTimeGte ( - Optional[- str]) – lower including insert time boundary
- insertTimeLt ( - Optional[- str]) – upper excluding insert time boundary
- faceIds ( - Optional[- List[- str]]) – ids of faces linked with an event
- eventIds ( - Optional[- List[- str]]) – event ids
- eventIdGte ( - Optional[- str]) – event id lower including bound
- eventIdLt ( - Optional[- str]) – event id upper excluding bound
- handlerIds ( - Optional[- List[- str]]) – handler ids
- externalIds ( - Optional[- List[- str]]) – external ids
- userData ( - Optional[- str]) – event user data
- sources ( - Optional[- List[- Union[- str,- Literal[- 'null']]]]) – list of source
- streamIds ( - Optional[- List[- Union[- str,- Literal[- 'null']]]]) – list of stream ids
- areas ( - Optional[- List[- Union[- str,- Literal[- 'null']]]]) – list of areas
- streets ( - Optional[- List[- Union[- str,- Literal[- 'null']]]]) – list of streets
- districts ( - Optional[- List[- Union[- str,- Literal[- 'null']]]]) – list of districts
- cities ( - Optional[- List[- Union[- str,- Literal[- 'null']]]]) – list of cities
- houseNumbers ( - Optional[- List[- Union[- str,- Literal[- 'null']]]]) – list of house numbers
- originLongitude ( - Union[- float,- Literal[- 'null'],- None]) – origin longitude in degrees
- originLatitude ( - Union[- float,- Literal[- 'null'],- None]) – origin latitude in degrees
- longitudeDelta ( - Optional[- float]) – longitude delta in degrees
- latitudeDelta ( - Optional[- float]) – latitude delta in degrees
- tags ( - Optional[- List[- str]]) – users tags
- topMatchingCandidatesLabel ( - Optional[- List[- str]]) – top matching candidate label
- topSimilarObjectIds ( - Optional[- List[- str]]) – top similar object ids
- topSimilarExternalIds ( - Optional[- List[- str]]) – top similar external ids
- topSimilarObjectSimilarityGte ( - Optional[- float]) – lower including top similarity boundary
- topSimilarObjectSimilarityLt ( - Optional[- float]) – upper excluding top similarity boundary
- ageLt ( - Optional[- int]) – upper excluding age boundary
- ageGte ( - Optional[- int]) – lower including age boundary
- gender ( - Union[- int,- Literal[- 'null'],- None]) – gender of event (0 or 1)
- emotions ( - Optional[- List[- Union[- int,- Literal[- 'null']]]]) – dominant emotions in event (one of (1, 2, 3, 4, 5, 6, 7) - matches “anger”, “disgust”, “fear”, “happiness”, “neutral”, “sadness”, “surprise”)
- masks ( - Optional[- List[- Union[- int,- Literal[- 'null']]]]) – dominant masks in event (one of (1, 2, 3)) - matches “missing”, “medical mask”, “occluded”)
- ethnicGroups ( - Union[- List[- int],- Literal[- 'null'],- None]) – dominant ethnicity of the face ((1, 2, 3, 4) - means (indian, asian, african_american, caucasian)
- trackIds ( - Optional[- List[- Union[- str,- Literal[- 'null']]]]) – list of event track ids
- liveness ( - Union[- List[- int],- Literal[- 'null'],- None]) – liveness in event (0 - spoof, 1 - real, 2 - unknown)
- deepfake ( - Union[- List[- int],- Literal[- 'null'],- None]) – deepfake in event (0 - fake, 1 - real)
- apparentAgeLt ( - Optional[- int]) – apparent age upper excluding boundary
- apparentAgeGte ( - Optional[- int]) – apparent age upper including boundary
- apparentGender ( - Optional[- List[- Union[- Literal[- 0,- 1,- 2],- Literal[- 'null']]]]) – apparent gender estimation values (0 - female, 1 - male, 2 - undefined)
- headwearStates ( - Optional[- List[- Union[- Literal[- 0,- 1,- 2],- Literal[- 'null']]]]) – headwear states (0 - absent, 1 - present, 2 - undefined)
- sleeveLengths ( - Optional[- List[- Union[- Literal[- 'short',- 'long',- 'undefined'],- Literal[- 'null']]]]) – sleeve lengths
- upperClothingColors ( - Optional[- List[- Union[- Literal[- 'black',- 'blue',- 'green',- 'gray',- 'orange',- 'purple',- 'red',- 'white',- 'yellow',- 'pink',- 'brown',- 'beige',- 'khaki',- 'multicolored',- 'undefined'],- Literal[- 'null']]]]) – upper clothing color set
- backpackStates ( - Optional[- List[- Union[- Literal[- 0,- 1,- 2],- Literal[- 'null']]]]) – backpack states (0 - absent, 1 - present, 2 - undefined)
- meta ( - Optional[- dict]) – user-defined event meta’s filters in format {meta.<path.to.field>__<operator>:<type>: <value>}
- page ( - Optional[- int]) – number of result page
- pageSize ( - Optional[- int]) – count of results in page
- order ( - Optional[- str]) – result sort order (ask or desc)
- accountIdFilter ( - Optional[- str]) – account id to get events
 
- Returns:
- body contains json with info about events. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.common.http_objs import Policies, DetectPolicy >>> from testData.resources import FACE_WARP >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> policies = Policies(detectPolicy=DetectPolicy(detectFace=1)) >>> handlerId = client.createHandler( ... description="test_handler_events", policies=policies, raiseError=True ... ).json["handler_id"] >>> eventId = client.emitEvents( ... handlerId=handlerId, ... inputData=[FACE_WARP], ... city="Kazan", ... street="Saban", ... houseNumber="5", ... imageType=1, ... useExifInfo=1, ... meta={"foo": "bar"}, ... raiseError=True, ... ).json["events"][0]["event_id"] >>> response = client.getEvents(handlerIds=[handlerId], meta={"meta.foo__in:string": ["bar", "baz"]}) >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "events": [ { "accessories": null, "account_id": ..., "age": null, "attach_result": [], "body_basic_attributes": null, "body_detections": null, "create_time": ..., "deepfake": null, "emotion": null, "end_time": ..., "ethnic_group": null, "event_id": ..., "external_id": "", "face_detections": [ { "detect_time": ..., "detect_ts": null, "image_origin": null, "sample_id": ... } ], "face_id": null, "gender": null, "handler_id": ...", "liveness": null, "location": { "area": null, "city": "Kazan", "district": null, "geo_position": null, "house_number": "5", "street": "Saban" }, "lower_body": null, "mask": null, "match_result": null, "meta": { "foo": "bar" }, "source": null, "stream_id": null, "tags": null, "top_match": null, "track_id": null, "upper_body": null, "user_data": "" } ] } >>> print(response.statusCode) 200 
 - Get events statistics by aggregation (<aggregator> and <groupBy> on <target>) and filters. - Parameters:
- query ( - Union[- StatQuery,- dict]) – query object or query dict, contained in StatQuery object
- Returns:
- body contains json with event stats. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.common.http_objs import StatQuery >>> >>> statQuery = StatQuery().addGroupBy("dayOfWeek").addTarget(column="city") >>> response = client.getEventsStats(query=statQuery) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "fields": [ "Group by time: dayOfWeek", "city, aggregator 'count'" ], "stats": [ [...] ] } 
 - Get face by id - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/getFace - Parameters:
- faceId ( - str) – face id
- targets ( - Optional[- List[- str]]) – list of face fields to receive instead of full face
- accountIdFilter ( - Optional[- str]) – account id to get face
 
- Returns:
- body contains json with face information. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> faceId = client.createFace(raiseError=True).json["face_id"] >>> response = client.getFace(faceId=faceId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "account_id": ..., "avatar": "", "create_time": ..., "event_id": null, "external_id": "", "face_id": ..., "lists": [], "user_data": "" } 
 - Get face attributes - Parameters:
- faceId ( - str) – face id
- targets ( - Optional[- List[- str]]) – targets to get face attributes. Available targets: create_time, face_descriptor, basic_attributes, face_descriptor_samples, basic_attributes_samples.
- descriptorVersion ( - Optional[- int]) – descriptor version
- accountIdFilter ( - Optional[- str]) – account id to get face attributes
 
- Returns:
- body contains json with face information. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> faceId = client.createFace(raiseError=True).json["face_id"] >>> response = client.getFaceAttributes(faceId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "attributes": { "basic_attributes": null, "basic_attributes_samples": [], "create_time": null, "face_descriptor": null, "face_descriptor_samples": [] } } 
 - Get face sample by id - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/getSample - Parameters:
- sampleId ( - str) – sample Id
- accountIdFilter ( - Optional[- str]) – account id to get sample
 
- Returns:
- body contains image as bytes. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import FACE_WARP as image >>> >>> sampleId = client.saveFaceSample(image=image, raiseError=True).json["sample_id"] >>> response = client.getFaceSample(sampleId=sampleId) >>> print(response.statusCode) 200 >>> print(response.contentType) image/jpeg >>> assert image.body == response.body 
 - Get samples which are associated with the face attributes (gender, age, ethnicity, descriptor). - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/getFaceAttributeSamples # pylint: disable=line-too-long - Parameters:
- faceId ( - str) – face Id
- accountIdFilter ( - Optional[- str]) – account id to get face samples
 
- Returns:
- body contains json with basic attributes. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> faceId = client.createFace(raiseError=True).json['face_id'] >>> response = client.getFaceSamples(faceId=faceId) >>> print(response.statusCode) 200 >>> print(response.json) {'samples': [...]} 
 - Getting faces which satisfy filters - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/getFaces - Parameters:
- userData ( - Optional[- str]) – user data, part of user data, case insensitive
- eventId ( - Optional[- str]) – event id
- listId ( - Optional[- str]) – list id
- faceIds ( - Optional[- List[- str]]) – face ids
- timeLt ( - Optional[- str]) – upper bound of face create time
- timeGte ( - Optional[- str]) – lower bound of face create time
- page ( - Optional[- int]) – page count, default 1
- pageSize ( - Optional[- int]) – page size, default 10, unlimited if -1
- externalIds ( - Optional[- List[- str]]) – list of external identifiers of persons, if they have their own mapping in the system
- faceIdGte ( - Optional[- str]) – upper bound of face id
- faceIdLt ( - Optional[- str]) – lower bound of face id
- targets ( - Optional[- List[- str]]) – targets to get faces
- accountIdFilter ( - Optional[- str]) – account id to get faces
 
- Returns:
- body contains json with faces info. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> faceId = client.createFace( ... externalId="2xQ2gprbMePw1s9gw9fvA==", userData="test_data05", ... avatar="https://st.kp.yandex.net/images/actor_iphone/iphone360_460188.jpg", raiseError=True ... ).json["face_id"] >>> response = client.getFaces( ... faceIds=[faceId], targets=["external_id", "user_data", "avatar"], raiseError=True ... ) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "faces": [ { "avatar": "https://st.kp.yandex.net/images/actor_iphone/iphone360_460188.jpg", "external_id": "2xQ2gprbMePw1s9gw9fvA==", "user_data": "test_data05" } ] } 
 - Count faces with attributes. Optional you can set, that faces must belong to account. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/getFaceAttributeCount # pylint: disable=line-too-long - Parameters:
- accountIdFilter ( - Optional[- str]) – account id to count faces with attributes
- Returns:
- body contains json with number of faces. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> response = client.getFacesAttributesCount() >>> print(response.statusCode) 200 >>> print(response.json) {'faces_count': ...} 
 - Get platform features - Parameters:
- lunaRequestId ( - Optional[- str]) – External request id. Helps uniquely identifying messages, corresponding to particular requests, in system logs. Pattern: ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$
- asyncRequest ( - Optional[- bool]) – execution in asynchronous mode, disabled by default
- raiseError ( - Optional[- bool]) – if request fails, LunaApiException is raised
- totalTimeout ( - Optional[- Real]) – request processing timeout in seconds.
- connectTimeout ( - Optional[- Real]) – connection timeout seconds.
- sockReadTimeout ( - Optional[- Real]) – socket read timeout
- sockConnectTimeout ( - Optional[- Real]) – socket connect timeout
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with platform features. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client - >>> response = client.getFeatures() >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, indent=4)) { "license": ..., "estimations": { "people_counter": ..., "face_quality": ..., "body_attributes": ..., "liveness": ..., "deepfake": ... }, "components": { "faces": ..., "events": ..., "tasks": ..., "sender": ..., "image_store": ..., "handlers": ... } } 
 - Get general event by id. - Parameters:
- eventId ( - str) – event id
- accountIdFilter ( - Optional[- str]) – event account id filter
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with events will be returned. 
- Return type:
- class 
 
 - Get general event descriptors by filters. - Parameters:
- eventIds ( - Optional[- list[- str]]) – event ids
- accountIdFilter ( - Optional[- str]) – event account id
- page ( - Optional[- int]) – number of result page
- pageSize ( - Optional[- int]) – count of results in page
- order ( - Optional[- str]) – result sort order (ask or desc)
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with events will be returned. 
- Return type:
- class 
 
 - Get general events by filters. - Parameters:
- eventType ( - Optional[- list[- str]]) – general event types
- createTimeGte ( - Optional[- str]) – lower including create time boundary
- createTimeLt ( - Optional[- str]) – upper excluding create time boundary
- endTimeGte ( - Optional[- str]) – lower including end time boundary
- endTimeLt ( - Optional[- str]) – upper excluding end time boundary
- insertTimeGte ( - Optional[- str]) – lower including insert time boundary
- insertTimeLt ( - Optional[- str]) – upper excluding insert time boundary
- accountIdFilter ( - Optional[- str]) – event account id
- eventIds ( - Optional[- list[- str]]) – event ids
- eventIdGte ( - Optional[- str]) – event id lower including bound
- eventIdLt ( - Optional[- str]) – event id upper excluding bound
- sources ( - Optional[- List[- Union[- str,- Literal[- 'null']]]]) – list of source
- streamIds ( - Optional[- list[- Union[- str,- Literal[- 'null']]]]) – list of stream ids
- trackIds ( - Optional[- list[- Union[- str,- Literal[- 'null']]]]) – list of track ids
- cities ( - Optional[- list[- Union[- str,- Literal[- 'null']]]]) – list of cities
- areas ( - Optional[- list[- Union[- str,- Literal[- 'null']]]]) – list of areas
- districts ( - Optional[- list[- Union[- str,- Literal[- 'null']]]]) – list of districts
- streets ( - Optional[- list[- Union[- str,- Literal[- 'null']]]]) – list of streets
- houseNumbers ( - Optional[- list[- Union[- str,- Literal[- 'null']]]]) – list of house numbers
- originLongitude ( - Union[- float,- Literal[- 'null'],- None]) – origin longitude in degrees
- originLatitude ( - Union[- float,- Literal[- 'null'],- None]) – origin latitude in degrees
- longitudeDelta ( - Optional[- float]) – longitude delta in degrees
- latitudeDelta ( - Optional[- float]) – latitude delta in degrees
- eventContentFilters ( - Optional[- dict]) – event json content filters
- page ( - Optional[- int]) – number of result page
- pageSize ( - Optional[- int]) – count of results in page
- order ( - Optional[- str]) – result sort order (ask or desc)
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with events will be returned. 
- Return type:
- class 
 
 - Get general events statistics by aggregation (<aggregator> and <groupBy> on <target>) and filters. - Parameters:
- query ( - Union[- StatQuery,- dict]) – query object or query dict, contained in GeneralStatQuery object
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with event statistics will be returned. 
- Return type:
- class 
 
 - Get group. - Parameters:
- groupId ( - str) – group id
- accountId ( - Optional[- str]) – account_id
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with group will be returned. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> groupId = client.createGroup( ... groupName="get_group", ... description="test group description", ... raiseError=True, ... ).json["group_id"] >>> response = client.getGroup(groupId=groupId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "account_id": ..., "create_time": ..., "description": "test group description", "group_id": ..., "group_name": "get_group" } 
 - Get groups by filters. - Parameters:
- accountId ( - Optional[- str]) – account id
- groupNames ( - Optional[- List[- str]]) – group names
- groupIds ( - Optional[- List[- str]]) – group ids
- page ( - Optional[- int]) – page number
- pageSize ( - Optional[- int]) – page size
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with groups will be returned. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> groupId = client.createGroup( ... groupName="get_groups", ... description="test groups description", ... raiseError=True, ... ).json["group_id"] >>> response = client.getGroups(groupIds=[groupId]) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "groups": [ { "account_id": ..., "create_time": ..., "description": "test groups description", "group_id": ..., "group_name": "get_groups" } ] } 
 - Get handler by its id - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/getHandler - Parameters:
- handlerId ( - str) – handler id
- accountIdFilter ( - Optional[- str]) – account id to get handler
 
- Returns:
- body contains json with handler info. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> handlerId = client.createHandler(handlerType=1, description="dynamic", raiseError=True).json["handler_id"] >>> response = client.getHandlerById(handlerId=handlerId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "account_id": ..., "create_time": ..., "description": "dynamic", "handler_id": ..., "handler_type": 1, "is_dynamic": ..., "last_update_time": ..., "policies": null } 
 - Get handlers by filters - Parameters:
- description ( - Optional[- str]) – Find all handlers with description which “like” of this parameter
- handlerType ( - Optional[- int]) – handler type (0 - static, 1 - dynamic, 2 - lambda)
- page ( - int) – The number of page
- pageSize ( - int) – The numbers of items on page
- accountIdFilter ( - Optional[- str]) – account id to get handlers
 
- Returns:
- body contains json with handlers info. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.common.http_objs import DetectPolicy, ExtractPolicy, StoragePolicy, LinkToListPolicy >>> from luna3.common.http_objs import MatchPolicy, Filters, Policies, FacePolicy >>> from luna3.common.http_objs import MatchPolicyCandidates, ConditionalTagPolicy >>> >>> _ = client.createHandler(handlerType=1, description="dynamic", raiseError=True) >>> response = client.getHandlers(description="dynamic", handlerType=1) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json[0], sort_keys=True, indent=4)) { "account_id": ..., "create_time": ..., "description": "dynamic", "handler_id": ..., "handler_type": 1, "is_dynamic": ..., "last_update_time": ..., "policies": null } >>> listId = client.createList("strange_persons", raiseError=True).json["list_id"] >>> policies = Policies( ... detectPolicy=DetectPolicy( ... estimateHeadPose=1, ... estimateEmotions=1, ... estimateGaze=1, ... extractExif=1, ... estimateLiveness=DetectPolicy.LivenessEstimationPolicy(1, 0.5, 0.5), ... estimateDeepfake=DetectPolicy.DeepfakeEstimationPolicy(1, 0.5, 2), ... rollThreshold=20, ... ), ... extractPolicy=ExtractPolicy(extractBasicAttributes=1, extractFaceDescriptor=1, fdScoreThreshold=0.7772), ... matchPolicy=[ ... MatchPolicy( ... candidates=MatchPolicyCandidates(origin="faces", listId=listId), ... label="test_faces", ... gender=1, ... ethnicities=[1, 2], ... limit=3, ... ) ... ], ... storagePolicy=StoragePolicy( ... facePolicy=FacePolicy( ... storeFace=1, ... filters=Filters(ageGte=18, ageLt=40), ... setSampleAsAvatar=1, ... linkToListsPolicy=[LinkToListPolicy(listId=listId)], ... ) ... ), ... conditionalTagsPolicy=[ConditionalTagPolicy(tag="test_tag")], ... ) >>> response = client.createHandler(description="test_persons", policies=policies, raiseError=True) >>> response = client.getHandlers(description="test_persons", handlerType=0) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json[0], sort_keys=True, indent=4)) { "account_id": ..., "create_time": ..., "description": "test_persons", "handler_id": ..., "handler_type": 0, "is_dynamic": ..., "last_update_time": ..., "policies": { "conditional_tags_policy": [ { "filters": {}, "tag": "test_tag" } ], "detect_policy": { "body_attributes": { "estimate_accessories": 0, "estimate_basic_attributes": 0, "estimate_lower_body": 0, "estimate_upper_body": 0 }, "deepfake_states": null, "detect_body": 0, "detect_face": 1, "detect_landmarks68": 0, "estimate_deepfake": { "estimate": 1, "mode": 2, "real_threshold": 0.5 }, "estimate_emotions": 1, "estimate_eyes_attributes": 0, "estimate_face_occlusion": { "estimate": 0, "eye_threshold": 0.15, "forehead_threshold": 0.2, "hair_occlusion_threshold": 0.15, "lower_face_threshold": 0.2, "mouth_threshold": 0.15, "nose_threshold": 0.2, "occlusion_threshold": 0.07 }, "estimate_gaze": 1, "estimate_glasses": 0, "estimate_head_pose": 1, "estimate_liveness": { "estimate": 1, "liveness_threshold": 0.5, "quality_threshold": 0.5 }, "estimate_mask": 0, "estimate_mouth_attributes": 0, "estimate_people_count": { "estimate": 0, "people_coordinates": 1 }, "estimate_quality": 0, "extract_exif": 1, "face_occlusion_states": null, "face_quality": { "checks": {...}, "estimate": 0, "filter": 0 }, "liveness_states": null, "mask_states": null, "multiface_policy": 1, "pitch_threshold": null, "roll_threshold": 20, "yaw_threshold": null }, "extract_policy": { "extract_basic_attributes": 1, "extract_body_descriptor": 0, "extract_face_descriptor": 1, "fd_score_threshold": 0.7772 }, "match_policy": [ { "candidates": { "list_id": ..., "origin": "faces" }, "descriptor": { "descriptor_type": "face" }, "filters": { "ethnicities": [ 1, 2 ], "gender": 1 }, "label": "test_faces", "limit": 3 } ], "storage_policy": { "attribute_policy": { "filters": {}, "store_attribute": 0, "ttl": 300 }, "body_sample_policy": { "filters": {}, "store_sample": 1, "ttl": null }, "callbacks": [], "event_policy": { "filters": {}, "store_event": 1, "wait_saving": 1 }, "face_policy": { "filters": { "age__gte": 18, "age__lt": 40 }, "link_to_lists_policy": [ { "filters": {}, "list_id": ... } ], "set_sample_as_avatar": 1, "store_face": 1 }, "face_sample_policy": { "filters": {}, "store_sample": 1, "ttl": null }, "image_origin_policy": { "filters": {}, "store_image": 0, "ttl": null, "use_external_references": 1 }, "notification_policy": { "filters": {}, "send_notification": 1 } } } } 
 - Get handlers count by filters - Parameters:
- description ( - Optional[- str]) – Find all handlers with description which “like” of this parameter
- handlerType ( - Optional[- int]) – handler type (0 - static, 1 - dynamic, 2 - lambda)
- accountIdFilter ( - Optional[- str]) – account id to get handlers count
 
- Returns:
- body contains json with handlers count 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> response = client.createHandler(handlerType=1, description="dynamic", raiseError=True) >>> response = client.getHandlersCount(description="dynamic", handlerType=1) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True)) {"handlers_count": ...} 
 - Get image by id - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/getImage - Parameters:
- imageId ( - str) – image id
- accountIdFilter ( - Optional[- str]) – account id to get image
- withMeta ( - bool) – whether to retrieve user-defined image metadata
 
- Returns:
- body contains image as bytes. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import FACE_WARP as image >>> >>> imageId = client.saveImage(image=image, raiseError=True).json["image_id"] >>> response = client.getImage(imageId=imageId) >>> print(response.statusCode) 200 >>> print(response.contentType) image/jpeg >>> assert image.body == response.body 
 - Get lambda by id. - Parameters:
- lambdaId ( - str) – lambda id
- accountIdFilter ( - Optional[- str]) – account id filter for get lambda
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with lambda_id will be returned. 
- Return type:
- class 
 - >>> import json >>> from uuid import uuid4 >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import LAMBDA_ARCHIVE >>> >>> lambdaId = client.createLambda(archive=LAMBDA_ARCHIVE, lambdaName=str(uuid4())).json["lambda_id"] >>> response = client.getLambda(lambdaId=lambdaId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "account_id": ..., "additional_user_docker_commands": [], "archive_ttl": null, "base_image": { "name": "lpa-lambda-base", "tag": ... }, "create_time": ..., "deploy_parameters": { "gpu_enabled": ..., "namespace": "default", "pod_count": ..., "resources": { "cpu_limit": ..., "cpu_request": ..., "ram_limit": ..., "ram_request": ... }, "selector": {} }, "description": "", "imported_image": { "name": null, "tag": ... }, "info": { "status": ... }, "lambda_id": ..., "lambda_name": ..., "lambda_type": "standalone", "last_update_time": ..., "shared": ..., "version": 1, "workers": 1 } 
 - Get lambda by id. - Parameters:
- lambdaId ( - str) – lambda id
- accountId ( - Optional[- str]) – account id
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with lambda_id will be returned. 
- Return type:
- class 
 - >>> import json >>> from uuid import uuid4 >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import LAMBDA_ARCHIVE >>> from time import sleep >>> >>> def wait4start(lambdaId_: str): ... for _ in range(150): ... reply = client.getLambdaStatus(lambdaId_).json ... if reply["status"] == "running": ... break ... if reply["status"] == "terminated": ... raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId_}") ... sleep(1) ... else: ... raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId_}") >>> lambdaId = client.createLambda(archive=LAMBDA_ARCHIVE, lambdaName=str(uuid4())).json["lambda_id"] >>> wait4start(lambdaId) >>> response = client.getLambdaImage(lambdaId=lambdaId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True)) {"exported_image": {"image": ...}} 
 - Get lambda image creation logs - Parameters:
- lambdaId ( - str) – lambda id
- tailLines ( - Optional[- int]) – number of last string from lambda logs
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with lambda status will be returned. 
- Return type:
- class 
 - >>> import json >>> from uuid import uuid4 >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import LAMBDA_ARCHIVE >>> >>> lambdaId = client.createLambda(archive=LAMBDA_ARCHIVE, lambdaName=str(uuid4())).json["lambda_id"] >>> response = client.getLambdaImageCreationLogs(lambdaId=lambdaId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True)) {"logs": [...]} 
 - Check lambda image creation status by id. - Parameters:
- lambdaId ( - str) – lambda id
- accountIdFilter ( - Optional[- str]) – account id filter for get lambda image status
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with lambda status will be returned. 
- Return type:
- class 
 - >>> import json >>> from uuid import uuid4 >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import LAMBDA_ARCHIVE >>> >>> lambdaId = client.createLambda(archive=LAMBDA_ARCHIVE, lambdaName=str(uuid4())).json["lambda_id"] >>> response = client.getLambdaImageCreationStatus(lambdaId=lambdaId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True)) {"status": ...} 
 - Get lambda logs - Parameters:
- lambdaId ( - str) – lambda id
- tailLines ( - Optional[- int]) – number of last string from lambda logs
- accountIdFilter ( - Optional[- str]) – account id filter for lambda logs
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with lambda status will be returned. 
- Return type:
- class 
 - >>> import json >>> from uuid import uuid4 >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import LAMBDA_ARCHIVE >>> >>> lambdaId = client.createLambda(archive=LAMBDA_ARCHIVE, lambdaName=str(uuid4())).json["lambda_id"] >>> response = client.getLambdaLogs(lambdaId=lambdaId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True)) {"logs": {...}} 
 - Get lambda spec - Parameters:
- lambdaId ( - str) – lambda id
- accept ( - str) – accept header
- accountIdFilter ( - Optional[- str]) – account id filter for get lambda docs
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with lambda_id will be returned. 
- Return type:
- class 
 
 - Check lambda status by id. - Parameters:
- lambdaId ( - str) – lambda id
- accountIdFilter ( - Optional[- str]) – account id filter for get lambda status
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with lambda status will be returned. 
- Return type:
- class 
 - >>> import json >>> from uuid import uuid4 >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import LAMBDA_ARCHIVE >>> >>> lambdaId = client.createLambda(archive=LAMBDA_ARCHIVE, lambdaName=str(uuid4())).json["lambda_id"] >>> response = client.getLambdaStatus(lambdaId=lambdaId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True)) {"status": ...} 
 - Get lambda by id. - Parameters:
- lambdaId ( - str) – lambda id
- accountId ( - Optional[- str]) – account id
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with lambda config. 
- Return type:
- class 
 - >>> import json >>> from uuid import uuid4 >>> from time import sleep >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import LAMBDA_ARCHIVE >>> >>> def wait4start(lambdaId_: str): ... for _ in range(150): ... reply = client.getLambdaStatus(lambdaId_).json ... if reply["status"] == "running": ... break ... if reply["status"] == "terminated": ... raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId_}") ... sleep(1) ... else: ... raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId_}") ... >>> lambdaId = client.createLambda( ... archive=LAMBDA_ARCHIVE, userConfig={"LAMBDA_SETTING": "value"}, lambdaName=str(uuid4())).json["lambda_id"] >>> wait4start(lambdaId) >>> response = client.getLambdaUserConfig(lambdaId=lambdaId) >>> >>> print(response.statusCode) 200 >>> print(response.json) {'config': {'LAMBDA_SETTING': 'value'}, 'version': 1} 
 - Get lambdas by filters. - Parameters:
- accountIdFilter ( - Optional[- str]) – account id filter for get lambdas
- createTimeLt ( - Optional[- str]) – upper bound of face create time
- createTimeGte ( - Optional[- str]) – lower bound of face create time
- lambdaType ( - Optional[- Literal[- 'standalone',- 'handlers',- 'tasks',- 'agent']]) – lambda type
- namespace ( - Optional[- list]) – k8s namespaces
- page ( - int) – pagination page value
- pageSize ( - int) – pagination page size value
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with lambdas will be returned. 
- Return type:
- class 
 - >>> import json >>> from uuid import uuid4 >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import LAMBDA_ARCHIVE >>> >>> _ = client.createLambda(archive=LAMBDA_ARCHIVE, lambdaName=str(uuid4())) >>> response = client.getLambdas() >>> print(response.statusCode) 200 >>> print(json.dumps(response.json["lambdas"][0], sort_keys=True, indent=4)) { "account_id": ..., "additional_user_docker_commands": [], "archive_ttl": null, "base_image": { "name": "lpa-lambda-base", "tag": ... }, "create_time": ..., "deploy_parameters": { "gpu_enabled": ..., "namespace": "default", "pod_count": ..., "resources": { "cpu_limit": ..., "cpu_request": ..., "ram_limit": ..., "ram_request": ... }, "selector": {} }, "description": "", "imported_image": { "name": null, "tag": ... }, "info": { "status": ... }, "lambda_id": ..., "lambda_name": ..., "lambda_type": "standalone", "last_update_time": ..., "shared": ... "version": 1, "workers": 1 } 
 - Get list by id - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/getList - Parameters:
- listId ( - str) – list id
- accountIdFilter ( - Optional[- str]) – account id to get list
 
- Returns:
- body contains json with info about list. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> listId = client.createList("strange_persons", raiseError=True).json["list_id"] >>> response = client.getList(listId=listId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "account_id": ..., "create_time": ..., "last_update_time": ..., "list_id": ..., "user_data": "strange_persons" } 
 - Get lists by filters - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/getLists - Parameters:
- userData ( - Optional[- str]) – Find all objects with user_data which is “like” this parameter
- userDataEq ( - Optional[- str]) – user data, case sensitive
- listIds ( - Optional[- List[- str]]) – list ids
- listIdLt ( - Optional[- str]) – upper bound of list id
- listIdGte ( - Optional[- str]) – lower bound of list id
- createTimeLt ( - Optional[- str]) – upper bound of list create time
- createTimeGte ( - Optional[- str]) – lower bound of list create time
- lastUpdateTimeLt ( - Optional[- str]) – upper bound of list last update time
- lastUpdateTimeGte ( - Optional[- str]) – lower bound of list last update time
- page ( - int) – The number of page (>= 1)
- pageSize ( - int) – The numbers of items on page [ 1 .. 100 ]
- accountIdFilter ( - Optional[- str]) – account id to get lists
 
- Returns:
- body contains json with lists that were found 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> listId = client.createList("strange_persons", raiseError=True).json["list_id"] >>> response = client.getLists(listIds=[listId]) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "lists": [ { "account_id": ..., "create_time": ..., "last_update_time": ..., "list_id": ..., "user_data": "strange_persons" } ] } 
 - Get lists count by filters - Parameters:
- userData ( - Optional[- str]) – Find all objects with user_data which is “like” this parameter
- listIds ( - Optional[- List[- str]]) – list ids
- listIdLt ( - Optional[- str]) – upper bound of list id
- listIdGte ( - Optional[- str]) – lower bound of list id
- userDataEq ( - Optional[- str]) – user data
- createTimeLt ( - Optional[- str]) – upper bound of list create time
- createTimeGte ( - Optional[- str]) – lower bound of list create time
- lastUpdateTimeLt ( - Optional[- str]) – upper bound of list last update time
- lastUpdateTimeGte ( - Optional[- str]) – lower bound of list last update time
- accountIdFilter ( - Optional[- str]) – account id to count lists
 
- Returns:
- body contains json with count of lists that were found 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> listId = client.createList("strange_persons", raiseError=True).json["list_id"] >>> response = client.getListsCount(createTimeGte="2022-03-21T09:11:41.674Z") >>> print(response.statusCode) 200 >>> print(response.json) {'lists_count': ...} 
 - Get an object by id - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/getObject - Parameters:
- objectId ( - str) – object id
- accountIdFilter ( - Optional[- str]) – account id to get object
 
- Returns:
- body contains object or string. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> objectBody = "1,2,3" >>> contentType = "text/plain" >>> objectId = client.saveObject(objectBody=objectBody, contentType=contentType, raiseError=True).json[ ... "object_id" ... ] >>> response = client.getObject(objectId=objectId) >>> print(response.statusCode) 200 >>> print(response.text) 1,2,3 
 - Get plugins of luna service - Parameters:
- lunaRequestId ( - Optional[- str]) – External request id. Helps uniquely identifying messages, corresponding to particular requests, in system logs. Pattern: ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$
- asyncRequest ( - Optional[- bool]) – execution in asynchronous mode, disabled by default
- raiseError ( - Optional[- bool]) – if request fails, LunaApiException is raised
- totalTimeout ( - Optional[- Real]) – request processing timeout in seconds.
- connectTimeout ( - Optional[- Real]) – connection timeout seconds.
- sockReadTimeout ( - Optional[- Real]) – socket read timeout
- sockConnectTimeout ( - Optional[- Real]) – socket connect timeout
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with list of plugins. 
- Return type:
- class 
 
 - Get final request id. - Parameters:
- lunaRequestId ( - Optional[- str]) – Luna-Request-Id as function argument. Pattern: ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$
- Return type:
- Optional[- str]
- Returns:
- None if both lunaRequestId and self.lunaRequestId are None or
- lunaRequestId or self.lunaRequestId 
 
 
 - Get final request id. - Parameters:
- lunaRequestId ( - Optional[- str]) – Luna-Request-Id as function argument. Pattern: ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$
- Return type:
- Dict[- str,- str]
- Returns:
- empty dict if both lunaRequestId and self.lunaRequestId are None or
- return dict with lunaRequestId or self.lunaRequestId 
 
 
 - Get restream - Parameters:
- streamId ( - str) – stream id
- restreamType ( - Literal[- 'hls']) – restream type
- restreamQuality ( - Optional[- int]) – restream quality
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with stream will be returned. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME >>> from luna3.video_manager.http_objs import StreamAnalytic >>> streamId = client.createStream( ... streamType="stream", ... reference="rtsp://dev02:5554/tenvision_1", ... name="test_stream", ... description="test stream description", ... analytics=[StreamAnalytic(name=ANALYTIC_NAME)], ... raiseError=True, ... ).json["stream_id"] >>> response = client.getRestream(streamId=streamId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "quality": ..., "token": ..., "type": ..., "url": ... } 
 - Get schedule by id - Parameters:
- scheduleId ( - int) – schedule id
- accountIdFilter ( - Optional[- str]) – account id to get schedules
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with response. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> contentKwargs=dict( ... filters=FaceFilters(accountId=client.accountId), createList=1 ... ) >>> response = client.createSchedule( ... accountId=client.accountId, ... taskType=1, ... contentKwargs=contentKwargs, ... cron="5 4 * * *", ... cronTz="utc", ... startImmediately=False, ... raiseError=True ... ) >>> scheduleId = response.json["schedule_id"] >>> response = client.getSchedule( ... scheduleId=scheduleId ... ) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "account_id": ..., "create_time": ..., "last_update_time": ..., "next_run_time": ..., "schedule_id": ..., "status": "running", "task": { "content": { "create_list": 1, "filters": { "account_id": ... }, "objects_type": "faces" }, "notification_policy": { "enable": 0, "subtask_callbacks": [], "task_callbacks": [] }, "result_storage_policy": {}, "task_type": 1 }, "task_ids": [], "trigger": { "cron": "5 4 * * *", "cron_timezone": "utc" } } 
 - Create schedule template - Parameters:
- accountId ( - Optional[- str]) – account id
- scheduleId ( - str) – schedule id
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.video_manager.http_objs import ScheduleTemplate >>> scheduleId = client.createScheduleTemplate( ... scheduleTemplate=ScheduleTemplate( ... startTime="2025-05-01T00:00:00.000000+00:00", ... endTime="2025-05-16T00:00:00.000000+00:00", ... cron="5 4 * * 4", ... duration=11, ... durationType="minute", ... ), ... raiseError=True, ... ).json["schedule_id"] >>> response = client.getScheduleTemplate(scheduleId=scheduleId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "account_id": ..., "create_time": ..., "cron": "5 4 * * 4", "cron_timezone": "local", "description": null, "duration": 11, "duration_type": "minute", "end_time": "2025-05-16T03:00:00.000000+03:00", "intervals": [ { "end_time": ..., "start_time": ... }, { "end_time": ... "start_time": ... }, { "end_time": ..., "start_time": ... } ], "schedule_id": ..., "start_time": "2025-05-01T03:00:00.000000+03:00" } 
 - Create schedule template - Parameters:
- accountId ( - Optional[- str]) – account id
- scheduleId ( - str) – schedule id
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.video_manager.http_objs import ScheduleTemplate >>> scheduleId = client.createScheduleTemplate( ... scheduleTemplate=ScheduleTemplate( ... startTime="2025-05-01T00:00:00.000000+00:00", ... endTime="2025-05-16T00:00:00.000000+00:00", ... cron="5 4 * * 4", ... duration=11, ... durationType="minute", ... ), ... raiseError=True, ... ).json["schedule_id"] >>> response = client.getScheduleTemplateIntervals(scheduleId=scheduleId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "intervals": [ { "end_time": ..., "start_time": ... }, { "end_time": ..., "start_time": ... }, { "end_time": ..., "start_time": ... } ] } 
 - Get schedule templates - Parameters:
- accountId ( - Optional[- str]) – account id
- scheduleIds ( - Optional[- List[- str]]) – schedule ids
- page ( - int) – page
- pageSize ( - int) – page size
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.video_manager.http_objs import ScheduleTemplate >>> scheduleId = client.createScheduleTemplate( ... scheduleTemplate=ScheduleTemplate( ... startTime="2025-05-01T00:00:00.000000+00:00", ... endTime="2025-05-16T00:00:00.000000+00:00", ... cron="5 4 * * 4", ... duration=11, ... durationType="minute", ... ), ... raiseError=True, ... ).json["schedule_id"] >>> response = client.getScheduleTemplates(scheduleIds=[scheduleId]) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "schedules": [ { "account_id": ..., "create_time": ..., "cron": "5 4 * * 4", "cron_timezone": "local", "description": null, "duration": 11, "duration_type": "minute", "end_time": "2025-05-16T03:00:00.000000+03:00", "intervals": [ { "end_time": ..., "start_time": ... }, { "end_time": ... "start_time": ... }, { "end_time": ..., "start_time": ... } ], "schedule_id": ..., "start_time": "2025-05-01T03:00:00.000000+03:00" } ] } 
 - Get schedules with filters - Parameters:
- createTimeLt ( - Optional[- str]) – schedule create time upper excluding bound
- createTimeGte ( - Optional[- str]) – schedule create time lower including bound
- taskType ( - Optional[- int]) – task type filter
- accountIdFilter ( - Optional[- str]) – account id to get schedules
- page ( - Optional[- int]) – page
- pageSize ( - Optional[- int]) – page size
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with response. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> contentKwargs=dict( ... filters=FaceFilters(accountId=client.accountId), createList=1 ... ) >>> response = client.createSchedule( ... accountId=client.accountId, ... taskType=1, ... contentKwargs=contentKwargs, ... cron="5 4 * * *", ... cronTz="utc", ... startImmediately=False, ... raiseError=True ... ) >>> scheduleId = response.json["schedule_id"] >>> response = client.getSchedules( ... accountIdFilter=client.accountId ... ) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) [ { "account_id": ..., "create_time": ..., "last_update_time": ..., "next_run_time": ..., "schedule_id": ..., "status": "running", "task": { "content": { "create_list": 1, "filters": { "account_id": ... }, "objects_type": "faces" }, "notification_policy": { "enable": 0, "subtask_callbacks": [], "task_callbacks": [] }, "result_storage_policy": {}, "task_type": 1 }, "task_ids": [], "trigger": { "cron": "5 4 * * *", "cron_timezone": "utc" } } ] 
 - Get OpenApi documentation of luna service - Parameters:
- acceptHeaders ( - Optional[- dict]) – Accept request header. By default Accept-Type is text/html.
- lunaRequestId ( - Optional[- str]) – External request id. Helps uniquely identifying messages, corresponding to particular requests, in system logs. Pattern: ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$
- asyncRequest ( - Optional[- bool]) – execution in asynchronous mode, disabled by default
- raiseError ( - Optional[- bool]) – if request fails, LunaApiException is raised
- totalTimeout ( - Optional[- Real]) – request processing timeout in seconds.
- connectTimeout ( - Optional[- Real]) – connection timeout seconds.
- sockReadTimeout ( - Optional[- Real]) – socket read timeout
- sockConnectTimeout ( - Optional[- Real]) – socket connect timeout
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return HTML or YAML as bytes. 
- Return type:
- class 
 
 - Get standard headers (“LUNA-Account-Id”, “LUNA-Request-Id”) for request. :type lunaRequestId: - Optional[- str] :param lunaRequestId: Luna request Id . Pattern:- ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$ - Parameters:
- accountId ( - Optional[- str]) – account id. Pattern: ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$
- login ( - Optional[- str]) – login
- password ( - Optional[- str]) – password
- token ( - Optional[- str]) – token
 
- Return type:
- Dict[- str,- str]
- Returns:
- dict with corresponding headers if values are not None 
 
 - Get stream by id. - Parameters:
- streamId ( - str) – stream id
- accountId ( - Optional[- str]) – account id
- targets ( - Optional[- str]) – targets to get streams
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with stream will be returned. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME >>> from luna3.video_manager.http_objs import StreamAnalytic >>> streamId = client.createStream( ... streamType="videofile", ... reference="http://reference", ... name="test_stream", ... description="test stream description", ... analytics=[StreamAnalytic(name=ANALYTIC_NAME)], ... raiseError=True, ... ).json["stream_id"] >>> response = client.getStream(streamId=streamId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "account_id": ..., "analytics": [ { "analytic_name": "doctests_analytic", "autorestart": { "attempt_count": 10, "current_attempt": 0, "delay": 60, "last_attempt_time": null, "restart": 0, "status": "disabled" }, "parameters": {}, "status": ... } ], "create_time": ..., "data": { "behavior_parameters": ..., "downloadable": false, "ffmpeg_kwargs": ..., "fps": ..., "orientation_strategy": "static", "pts": { "start_time": 0.0 }, "reference": "http://reference", "rotation": 0, "timeout": ..., "timestamp_source": "auto", "type": "videofile" }, "description": "test stream description", "groups": [], "last_error": null, "location": { "area": null, "city": null, "district": null, "geo_position": null, "house_number": null, "street": null }, "name": "test_stream", "notification_policy": { "enable": 0, "stream_callbacks": [] }, "source": null, "splittable": 0, "status": 0, "stream_id": ..., "version": 1 } 
 - Get stream analytics working intervals - Parameters:
- accountId ( - Optional[- str]) – account id
- streamId ( - str) – stream id
- analyticIdx ( - int) – index of analytics of interest
- intervalsIdx ( - int) – index of intervals of interest
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME >>> from luna3.video_manager.http_objs import StreamAnalytic, Schedule, Interval >>> streamId = client.createStream( ... streamType="stream", ... reference="http://reference", ... name="test_stream", ... description="test stream description", ... analytics=[StreamAnalytic( ... name=ANALYTIC_NAME, ... schedules=[Schedule(intervals=[ ... Interval(startTime="2025-05-01T01:16:00Z", endTime="2026-05-01T01:16:00Z")]) ... ])], ... raiseError=True, ... ).json["stream_id"] >>> response = client.getStreamAnalyticsWorkingIntervals( ... streamId=streamId, analyticIdx=0, intervalsIdx=0, raiseError=True ... ) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "intervals": [ { "end_time": ..., "start_time": ... } ] } 
 - Get stream by filters. - Parameters:
- accountId ( - Optional[- str]) – account id
- streamIds ( - Optional[- List[- str]]) – stream ids
- streamIdGte ( - Optional[- str]) – stream id lower included bound
- streamIdLt ( - Optional[- str]) – stream id upper excluded bound
- streamNames ( - Optional[- List[- str]]) – stream names
- reference ( - Optional[- str]) – stream reference
- statuses ( - Optional[- List[- int]]) – stream current status values
- createTimeGte ( - Optional[- str]) – stream create time lower including bound
- createTimeLt ( - Optional[- str]) – stream create time upper excluding bound
- groupName ( - Optional[- str]) – group name
- groupId ( - Optional[- str]) – group id
- sources ( - Optional[- List[- str]]) – additional stream information
- splittable ( - Optional[- int]) – whether stream is splittable
- order ( - Optional[- Literal[- 'asc',- 'desc']]) – sorting order
- page ( - Optional[- int]) – page number
- pageSize ( - Optional[- int]) – page size
- targets ( - Optional[- str]) – targets to get streams
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with streams will be returned. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME >>> from luna3.video_manager.http_objs import StreamAnalytic >>> streamId = client.createStream( ... streamType="videofile", ... reference="http://reference", ... name="test_stream", ... description="test stream description", ... analytics=[StreamAnalytic(name=ANALYTIC_NAME)], ... raiseError=True, ... ).json["stream_id"] >>> response = client.getStreams( ... streamIds=[streamId], ... ) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "streams": [ { "account_id": ..., "analytics": [ { "analytic_name": "doctests_analytic", "autorestart": { "attempt_count": 10, "current_attempt": 0, "delay": 60, "last_attempt_time": null, "restart": 0, "status": "disabled" }, "parameters": {}, "status": ... } ], "create_time": ..., "data": { "behavior_parameters": ..., "downloadable": false, "ffmpeg_kwargs": ..., "fps": ..., "orientation_strategy": "static", "pts": { "start_time": 0.0 }, "reference": "http://reference", "rotation": 0, "timeout": ..., "timestamp_source": "auto", "type": "videofile" }, "description": "test stream description", "groups": [], "last_error": null, "location": { "area": null, "city": null, "district": null, "geo_position": null, "house_number": null, "street": null }, "name": "test_stream", "notification_policy": { "enable": 0, "stream_callbacks": [] }, "source": null, "splittable": 0, "status": 0, "stream_id": ..., "version": 1 } ] } 
 - Get streams logs - Parameters:
- accountId ( - Optional[- str]) – account_id
- streamIds ( - Optional[- List[- str]]) – stream ids
- statuses ( - Optional[- List[- int]]) – streams statuses
- targets ( - Optional[- List[- str]]) – log targets
- logTimeLt ( - Optional[- str]) – log time lower excluded boundary
- logTimeGte ( - Optional[- str]) – log time upper included boundary
- analyticIndexes ( - Optional[- List[- int]]) – list of analytics indexes of interest
- page ( - Optional[- int]) – page
- pageSize ( - Optional[- int]) – page size
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME >>> from luna3.video_manager.http_objs import StreamAnalytic >>> streamId = client.createStream( ... streamType="videofile", ... reference="http://reference", ... name="test_stream", ... description="test stream description", ... analytics=[StreamAnalytic(name=ANALYTIC_NAME)], ... raiseError=True, ... ).json["stream_id"] >>> response = client.getStreamsLogs( ... streamIds=[streamId], ... ) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "logs": [] } 
 - Get task by id. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/getTask - Parameters:
- taskId ( - int) – task id
- accountIdFilter ( - Optional[- str]) – account id to get task
 
- Returns:
- body contains json with task info. 
- Return type:
- LunaResponse 
 - >>> import json >>> import time >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> >>> listId = client.createList("happy_persons", raiseError=True).json["list_id"] >>> faceId = client.createFace( ... externalId="14159261415926", lists=[listId], userData="clustering_faces", raiseError=True ... ).json["face_id"] >>> faceFilters = FaceFilters( ... externalIds=["14159261415926"], ... listId=listId, ... faceIds=[faceId], ... userData="clustering_faces", ... ) >>> taskId = client.createClusteringTask(filters=faceFilters, raiseError=True).json["task_id"] >>> time.sleep(1) >>> response = client.getTask(taskId=taskId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "account_id": ..., "content": { "descriptor": { "type": "face" }, "filters": { "external_ids": [ "14159261415926" ], "face_ids": [...], "list_id": ..., "user_data": "clustering_faces" }, "limit": ..., "objects_type": "faces", "threshold": ... }, "count_task_parts_all": 1, "count_task_parts_done": 1, "create_time": ..., "description": "", "end_time": ..., "last_update_time": ..., "notification_policy": { "enable": 0, "subtask_callbacks": [], "task_callbacks": [] }, "result_id": ..., "result_storage_policy": {}, "task_id": ..., "task_status": 5, "task_type": 2 } 
 - Get task errors by task id. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/getErrors - Parameters:
- taskId ( - int) – task id
- page ( - Optional[- int]) – page
- pageSize ( - Optional[- int]) – page size
- accountIdFilter ( - Optional[- str]) – account id to get task errors
 
- Returns:
- body contains json with info about errors of a task by the task ID. 
- Return type:
- LunaResponse 
 - >>> import json >>> import time >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> >>> unknownFaceId = "668ea250-9341-484f-a103-8dda6994a654" >>> faceFilters = FaceFilters(faceIds=[unknownFaceId]) >>> taskId = client.createClusteringTask( ... filters=faceFilters, descriptorTypeFilter="face", raiseError=True ... ).json["task_id"] >>> time.sleep(1) >>> response = client.getTaskErrors(taskId=taskId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "errors": [ { "additional_info": ..., "description": "Objects not found", "detail": "Objects for clustering not found (empty set)", "error_code": 28010, "error_id": ..., "error_time": ..., "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28010", "subtask_id": ..., "task_id": ... } ] } 
 - Get task notification policy by task id. - Parameters:
- taskId ( - int) – task id
- accountIdFilter ( - Optional[- str]) – account id
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with response. 
- Return type:
- class 
 - >>> import json >>> import time >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> >>> listId = client.createList("happy_persons", raiseError=True).json["list_id"] >>> faceId = client.createFace( ... externalId="14159261415927", lists=[listId], userData="clustering_faces", raiseError=True ... ).json["face_id"] >>> faceFilters = FaceFilters( ... externalIds=["14159261415927"], ... listId=listId, ... faceIds=[faceId], ... userData="clustering_faces", ... ) >>> taskId = client.createClusteringTask(filters=faceFilters, raiseError=True).json["task_id"] >>> time.sleep(1) >>> response = client.getTaskNotificationPolicy(taskId=taskId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "enable": 0, "subtask_callbacks": [], "task_callbacks": [] } 
 - Get task result by task id. Optional you can set, that task must belong to account. - Parameters:
- taskId ( - int) – task id
- accountIdFilter ( - Optional[- str]) – account id to get task result
 
- Returns:
- body contains json with task result. 
- Return type:
- LunaResponse 
 - >>> import json >>> import time >>> from testData.resources import FACE_WARP >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> >>> sampleId = client.saveFaceSample(FACE_WARP, raiseError=True).json["sample_id"] >>> attributeId = client.extractAttrFromSample( ... sampleIds=[sampleId], extractBasicAttributes=1, raiseError=True ... ).json[0]["attribute_id"] >>> faceId = client.createFace(attributeId=attributeId, raiseError=True).json["face_id"] >>> faceFilters = FaceFilters(faceIds=[faceId]) >>> taskId = client.createClusteringTask( ... filters=faceFilters, descriptorTypeFilter="face", raiseError=True ... ).json["task_id"] >>> time.sleep(1) >>> response = client.getTaskResult(taskId=taskId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True)) {"errors": [...], "result": {"clusters": [[...]], "total_clusters": 1, "total_objects": 1}} 
 - Get task’s sub tasks. - Parameters:
- taskId ( - int) – task id
- accountIdFilter ( - Optional[- str]) – account id to get subtasks
 
- Returns:
- body contains json with subtasks info. 
- Return type:
- LunaResponse 
 - >>> import json >>> import time >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> >>> listId = client.createList("happy_persons", raiseError=True).json["list_id"] >>> faceId = client.createFace( ... externalId="14159261415926", lists=[listId], userData="clustering_faces", raiseError=True ... ).json["face_id"] >>> faceFilters = FaceFilters( ... externalIds=["14159261415926"], ... listId=listId, ... faceIds=[faceId], ... userData="clustering_faces", ... ) >>> taskId = client.createClusteringTask(filters=faceFilters, raiseError=True).json["task_id"] >>> time.sleep(1) >>> response = client.getTaskSubTasks(taskId=taskId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json["subtasks"], sort_keys=True, indent=4)) [ { "content": { "descriptor": { "type": "face" }, "filters": { "external_ids": [ "14159261415926" ], "face_ids": [...], "list_id": ..., "user_data": "clustering_faces" }, "limit": ..., "objects_type": "faces", "threshold": ... }, "create_time": ..., "end_time": ..., "result_id": ..., "subtask_id": ..., "subtask_status": 4, "task_id": ... } ] 
 - Get tasks with filters. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/getTask - Parameters:
- taskIds ( - Optional[- List[- int]]) – task ids
- createTimeLt ( - Optional[- str]) – task create time upper excluding bound
- createTimeGte ( - Optional[- str]) – task create time lower including bound
- endTimeLt ( - Optional[- str]) – task end time upper excluding bound
- endTimeGte ( - Optional[- str]) – task end time lower including bound
- taskType ( - Optional[- int]) – task type filter
- taskStatus ( - Optional[- int]) – task status filter
- page ( - Optional[- int]) – page
- pageSize ( - Optional[- int]) – page size
- accountIdFilter ( - Optional[- str]) – account id to get tasks
- scheduleId ( - Optional[- int]) – schedule id filter
 
- Returns:
- body contains json with tasks info. 
- Return type:
- LunaResponse 
 - >>> import json >>> import time >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> >>> listId = client.createList("happy_persons", raiseError=True).json["list_id"] >>> faceId = client.createFace( ... externalId="14159261415926", lists=[listId], userData="clustering_faces", raiseError=True ... ).json["face_id"] >>> faceFilters = FaceFilters( ... externalIds=["14159261415926"], ... listId=listId, ... faceIds=[faceId], ... userData="clustering_faces", ... ) >>> taskId = client.createClusteringTask( ... threshold=0.5, filters=faceFilters, raiseError=True ... ).json["task_id"] >>> time.sleep(1) >>> response = client.getTasks(taskType=2, taskStatus=5, taskIds=[taskId]) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json["tasks"], sort_keys=True, indent=4)) [ { "account_id": ..., "content": { "descriptor": { "type": "face" }, "filters": { "external_ids": [ "14159261415926" ], "face_ids": [...], "list_id": ..., "user_data": "clustering_faces" }, "limit": ..., "objects_type": "faces", "threshold": 0.5 }, "count_task_parts_all": 1, "count_task_parts_done": 1, "create_time": ..., "description": "", "end_time": ..., "last_update_time": ..., "notification_policy": { "enable": 0, "subtask_callbacks": [], "task_callbacks": [] }, "result_id": ..., "result_storage_policy": {}, "task_id": ..., "task_status": 5, "task_type": 2 } ] 
 - Get tasks count with filters. - Parameters:
- taskIds ( - Optional[- List[- int]]) – task ids
- createTimeLt ( - Optional[- str]) – task create time upper excluding bound
- createTimeGte ( - Optional[- str]) – task create time lower including bound
- endTimeLt ( - Optional[- str]) – task end time upper excluding bound
- endTimeGte ( - Optional[- str]) – task end time lower including bound
- taskType ( - Optional[- int]) – task type filter
- taskStatus ( - Optional[- int]) – task status filter
- accountIdFilter ( - Optional[- str]) – account id to get tasks count
- scheduleId ( - Optional[- str]) – schedule id filter
 
- Returns:
- body contains json with tasks count. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> >>> listId = client.createList("happy_persons", raiseError=True).json["list_id"] >>> faceId = client.createFace( ... externalId="14159261415926", lists=[listId], userData="clustering_faces", raiseError=True ... ).json["face_id"] >>> faceFilters = FaceFilters( ... externalIds=["14159261415926"], ... listId=listId, ... faceIds=[faceId], ... userData="clustering_faces", ... ) >>> taskId = client.createClusteringTask(filters=faceFilters, raiseError=True).json["task_id"] >>> response = client.getTasksCount(taskStatus=5) >>> print(response.statusCode) 200 >>> print(response.json) {'count': ...} >>> response = client.getTasksCount(taskIds=[taskId]) >>> print(response.json) {'count': 1} 
 - Get token. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/getToken - Parameters:
- tokenId ( - str) – token id
- accountIdFilter ( - Optional[- str]) – account id to get token
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with token will be returned. 
- Return type:
- class 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.accounts.http_objs import TokenPermissions >>> from uuid import uuid4 >>> import json >>> >>> tokenId = client.createToken(tokenPermissions=TokenPermissions(), raiseError=True).json["token_id"] >>> response = client.getToken(tokenId=tokenId) >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "account_id": ..., "create_time": ..., "description": "", "expiration_time": null, "last_update_time": ..., "permissions": { "account": [], "attribute": [], "body_sample": [], "emit_events": { "allowed": 1, "black_list": null, "white_list": null }, "event": [], "face": [], "face_sample": [], "handler": [], "image": [], "lambdas": [], "list": [], "object": [], "resources": [], "task": [], "token": [], "verifier": [], "verify": { "allowed": 1, "black_list": null, "white_list": null }, "video_agent": [], "video_analytic": [], "video_group": [], "video_stream": [] }, "token": ..., "token_id": ..., "visibility_area": "all" } 
 - Get tokens. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/getTokens - Parameters:
- page ( - int) – page, default 1
- pageSize ( - int) – page size, default 10
- accountIdFilter ( - Optional[- str]) – account id to get tokens
- createTimeLt ( - Optional[- str]) – upper bound for token create_time
- createTimeGte ( - Optional[- str]) – lower bound for token create_time
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with tokens will be returned. 
- Return type:
- class 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.accounts.http_objs import TokenPermissions >>> from uuid import uuid4 >>> import json >>> >>> _ = client.createToken(tokenPermissions=TokenPermissions(), raiseError=True) >>> response = client.getTokens(pageSize=1) >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "tokens": [ { "account_id": ..., "create_time": ..., "description": "", "expiration_time": null, "last_update_time": ..., "permissions": { "account": [], "attribute": [], "body_sample": [], "emit_events": { "allowed": 1, "black_list": null, "white_list": null }, "event": [], "face": [], "face_sample": [], "handler": [], "image": [], "lambdas": [], "list": [], "object": [], "resources": [], "task": [], "token": [], "verifier": [], "verify": { "allowed": 1, "black_list": null, "white_list": null }, "video_agent": [], "video_analytic": [], "video_group": [], "video_stream": [] }, "token": ..., "token_id": ..., "visibility_area": "all" } ] } 
 - Get final totalTimeout. - Parameters:
- totalTimeout ( - Optional[- Real]) – request’s processing timeout in seconds.
- Return type:
- Real
- Returns:
- request timeout seconds. 
 
 - Get verifier - Parameters:
- verifierId ( - str) – verifier id
- accountIdFilter ( - Optional[- str]) – account id to get verifier
 
- Returns:
- body contains json with verifier info. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.common.http_objs import VerifierPolicies, VerifierAttributePolicy, VerifierDetectPolicy >>> from luna3.common.http_objs import VerifierExtractPolicy, VerifierStoragePolicy, VerifierFaceSamplePolicy >>> >>> policies = VerifierPolicies( ... verificationThreshold=0.5, ... detectPolicy=VerifierDetectPolicy(estimateEmotions=1), ... extractPolicy=VerifierExtractPolicy(extractBasicAttributes=1), ... storagePolicy=VerifierStoragePolicy( ... faceSamplePolicy=VerifierFaceSamplePolicy(storeSample=1), ... attributePolicy=VerifierAttributePolicy(storeAttribute=1), ... ), ... ) >>> verifierId = client.createVerifier( ... description="Happy_persons", policies=policies, raiseError=True ... ).json["verifier_id"] >>> response = client.getVerifier(verifierId=verifierId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "account_id": ..., "create_time": ..., "description": "Happy_persons", "last_update_time": ..., "policies": { "detect_policy": { "deepfake_states": null, "detect_landmarks68": 0, "estimate_deepfake": { "estimate": 0, "mode": 2, "real_threshold": 0.5 }, "estimate_emotions": 1, "estimate_eyes_attributes": 0, "estimate_face_occlusion": { "estimate": 0, "eye_threshold": 0.15, "forehead_threshold": 0.2, "hair_occlusion_threshold": 0.15, "lower_face_threshold": 0.2, "mouth_threshold": 0.15, "nose_threshold": 0.2, "occlusion_threshold": 0.07 }, "estimate_gaze": 0, "estimate_glasses": 0, "estimate_head_pose": 0, "estimate_liveness": { "estimate": 0, "liveness_threshold": 0.5, "quality_threshold": 0.5 }, "estimate_mask": 0, "estimate_mouth_attributes": 0, "estimate_quality": 0, "extract_exif": 0, "face_occlusion_states": null, "face_quality": { "checks": { "aspect_ratio": { "estimate": 1, "threshold": { "max": 0.8, "min": 0.74 } }, "background_lightness": { "estimate": 1, "threshold": { "max": 1.0, "min": 0.2 } }, "background_uniformity": { "estimate": 1, "threshold": { "max": 1.0, "min": 0.5 } }, "blurriness_quality": { "estimate": 1, "threshold": { "max": 1.0, "min": 0.61 } }, "dark_quality": { "estimate": 1, "threshold": { "max": 1.0, "min": 0.5 } }, "dynamic_range": { "estimate": 1, "threshold": { "max": 1.0, "min": 0.5 } }, "eye_distance": { "estimate": 1, "threshold": { "min": 90.0 } }, "eyebrows_state": { "estimate": 1, "threshold": [ "neutral" ] }, "face_color_type": { "estimate": 1, "threshold": [ "color" ] }, "face_height": { "estimate": 1, "threshold": { "min": 180 } }, "face_occlusion": { "estimate": 1, "threshold": 0 }, "face_width": { "estimate": 1, "threshold": { "min": 180 } }, "forehead_occlusion": { "estimate": 1, "threshold": 0 }, "gaze_pitch": { "estimate": 1, "threshold": { "max": 5.0, "min": -5.0 } }, "gaze_yaw": { "estimate": 1, "threshold": { "max": 5.0, "min": -5.0 } }, "glasses": { "estimate": 1, "threshold": [ "no_glasses", "eyeglasses" ] }, "head_height": { "estimate": 1, "threshold": { "max": 0.9, "min": 0.6 } }, "head_horizontal_center": { "estimate": 1, "threshold": { "max": 0.55, "min": 0.45 } }, "head_pitch": { "estimate": 1, "threshold": { "max": 5.0, "min": -5.0 } }, "head_roll": { "estimate": 1, "threshold": { "max": 8.0, "min": -8.0 } }, "head_vertical_center": { "estimate": 1, "threshold": { "max": 0.5, "min": 0.3 } }, "head_width": { "estimate": 1, "threshold": { "max": 0.75, "min": 0.5 } }, "head_yaw": { "estimate": 1, "threshold": { "max": 5.0, "min": -5.0 } }, "headwear_type": { "estimate": 1, "threshold": [ "none" ] }, "illumination_quality": { "estimate": 1, "threshold": { "max": 1.0, "min": 0.3 } }, "illumination_uniformity": { "estimate": 1, "threshold": { "max": 1.0, "min": 0.5 } }, "image_format": { "estimate": 1, "threshold": [ "JPEG", "JPEG2000", "PNG" ] }, "image_height": { "estimate": 1, "threshold": { "max": 1080, "min": 180 } }, "image_modification": { "estimate": 1, "threshold": 0 }, "image_size": { "estimate": 1, "threshold": { "max": 2097152, "min": 5120 } }, "image_width": { "estimate": 1, "threshold": { "max": 1920, "min": 180 } }, "indent_left": { "estimate": 1, "threshold": { "min": 20 } }, "indent_lower": { "estimate": 1, "threshold": { "min": 20 } }, "indent_right": { "estimate": 1, "threshold": { "min": 20 } }, "indent_upper": { "estimate": 1, "threshold": { "min": 20 } }, "left_eye": { "estimate": 1, "threshold": [ "open" ] }, "light_quality": { "estimate": 1, "threshold": { "max": 1.0, "min": 0.57 } }, "lower_face_occlusion": { "estimate": 1, "threshold": 0 }, "mouth_occluded": { "estimate": 1, "threshold": { "max": 0.5, "min": 0.0 } }, "mouth_open": { "estimate": 1, "threshold": { "max": 0.5, "min": 0.0 } }, "mouth_smiling": { "estimate": 1, "threshold": { "max": 0.5, "min": 0.0 } }, "natural_light": { "estimate": 1, "threshold": 1 }, "nose_occlusion": { "estimate": 1, "threshold": 0 }, "radial_distortion": { "estimate": 1, "threshold": 0 }, "red_eyes": { "estimate": 1, "threshold": 0 }, "right_eye": { "estimate": 1, "threshold": [ "open" ] }, "shoulders_position": { "estimate": 1, "threshold": [ "parallel" ] }, "smile_properties": { "estimate": 1, "threshold": [ "none" ] }, "specularity_quality": { "estimate": 1, "threshold": { "max": 1.0, "min": 0.3 } } }, "estimate": 0, "filter": 0 }, "liveness_states": null, "mask_states": null, "multiface_policy": 1, "pitch_threshold": null, "roll_threshold": null, "yaw_threshold": null }, "extract_policy": { "extract_basic_attributes": 1, "fd_score_threshold": 0.0 }, "storage_policy": { "attribute_policy": { "store_attribute": 1 }, "face_sample_policy": { "store_sample": 1, "ttl": null } }, "verification_threshold": 0.5 }, "verifier_id": ..., "version": 0 } 
 - Get verifiers by filters - Parameters:
- description ( - Optional[- str]) – verifier description (“like” parameter)
- page ( - int) – The number of page
- pageSize ( - int) – The numbers of items on page
- accountIdFilter ( - Optional[- str]) – account id to get verifiers
 
- Returns:
- body contains json with verifiers info 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.common.http_objs import VerifierPolicies, VerifierAttributePolicy, VerifierDetectPolicy >>> from luna3.common.http_objs import VerifierExtractPolicy, VerifierStoragePolicy, VerifierFaceSamplePolicy >>> >>> policies = VerifierPolicies( ... verificationThreshold=0.5, ... detectPolicy=VerifierDetectPolicy(estimateEmotions=1), ... extractPolicy=VerifierExtractPolicy(extractBasicAttributes=1), ... storagePolicy=VerifierStoragePolicy( ... faceSamplePolicy=VerifierFaceSamplePolicy(storeSample=1), ... attributePolicy=VerifierAttributePolicy(storeAttribute=1), ... ), ... ) >>> response = client.createVerifier(description="Happy_persons", policies=policies, raiseError=True) >>> response = client.getVerifiers(description="Happy_persons", pageSize=1) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) [ { "account_id": ..., "create_time": ..., "description": "Happy_persons", "last_update_time": ..., "policies": { "detect_policy": { "deepfake_states": null, "detect_landmarks68": 0, "estimate_deepfake": { "estimate": 0, "mode": 2, "real_threshold": 0.5 }, "estimate_emotions": 1, "estimate_eyes_attributes": 0, "estimate_face_occlusion": { "estimate": 0, "eye_threshold": 0.15, "forehead_threshold": 0.2, "hair_occlusion_threshold": 0.15, "lower_face_threshold": 0.2, "mouth_threshold": 0.15, "nose_threshold": 0.2, "occlusion_threshold": 0.07 }, "estimate_gaze": 0, "estimate_glasses": 0, "estimate_head_pose": 0, "estimate_liveness": { "estimate": 0, "liveness_threshold": 0.5, "quality_threshold": 0.5 }, "estimate_mask": 0, "estimate_mouth_attributes": 0, "estimate_quality": 0, "extract_exif": 0, "face_occlusion_states": null, "face_quality": { "checks": { "aspect_ratio": { "estimate": 1, "threshold": { "max": 0.8, "min": 0.74 } }, "background_lightness": { "estimate": 1, "threshold": { "max": 1.0, "min": 0.2 } }, "background_uniformity": { "estimate": 1, "threshold": { "max": 1.0, "min": 0.5 } }, "blurriness_quality": { "estimate": 1, "threshold": { "max": 1.0, "min": 0.61 } }, "dark_quality": { "estimate": 1, "threshold": { "max": 1.0, "min": 0.5 } }, "dynamic_range": { "estimate": 1, "threshold": { "max": 1.0, "min": 0.5 } }, "eye_distance": { "estimate": 1, "threshold": { "min": 90.0 } }, "eyebrows_state": { "estimate": 1, "threshold": [ "neutral" ] }, "face_color_type": { "estimate": 1, "threshold": [ "color" ] }, "face_height": { "estimate": 1, "threshold": { "min": 180 } }, "face_occlusion": { "estimate": 1, "threshold": 0 }, "face_width": { "estimate": 1, "threshold": { "min": 180 } }, "forehead_occlusion": { "estimate": 1, "threshold": 0 }, "gaze_pitch": { "estimate": 1, "threshold": { "max": 5.0, "min": -5.0 } }, "gaze_yaw": { "estimate": 1, "threshold": { "max": 5.0, "min": -5.0 } }, "glasses": { "estimate": 1, "threshold": [ "no_glasses", "eyeglasses" ] }, "head_height": { "estimate": 1, "threshold": { "max": 0.9, "min": 0.6 } }, "head_horizontal_center": { "estimate": 1, "threshold": { "max": 0.55, "min": 0.45 } }, "head_pitch": { "estimate": 1, "threshold": { "max": 5.0, "min": -5.0 } }, "head_roll": { "estimate": 1, "threshold": { "max": 8.0, "min": -8.0 } }, "head_vertical_center": { "estimate": 1, "threshold": { "max": 0.5, "min": 0.3 } }, "head_width": { "estimate": 1, "threshold": { "max": 0.75, "min": 0.5 } }, "head_yaw": { "estimate": 1, "threshold": { "max": 5.0, "min": -5.0 } }, "headwear_type": { "estimate": 1, "threshold": [ "none" ] }, "illumination_quality": { "estimate": 1, "threshold": { "max": 1.0, "min": 0.3 } }, "illumination_uniformity": { "estimate": 1, "threshold": { "max": 1.0, "min": 0.5 } }, "image_format": { "estimate": 1, "threshold": [ "JPEG", "JPEG2000", "PNG" ] }, "image_height": { "estimate": 1, "threshold": { "max": 1080, "min": 180 } }, "image_modification": { "estimate": 1, "threshold": 0 }, "image_size": { "estimate": 1, "threshold": { "max": 2097152, "min": 5120 } }, "image_width": { "estimate": 1, "threshold": { "max": 1920, "min": 180 } }, "indent_left": { "estimate": 1, "threshold": { "min": 20 } }, "indent_lower": { "estimate": 1, "threshold": { "min": 20 } }, "indent_right": { "estimate": 1, "threshold": { "min": 20 } }, "indent_upper": { "estimate": 1, "threshold": { "min": 20 } }, "left_eye": { "estimate": 1, "threshold": [ "open" ] }, "light_quality": { "estimate": 1, "threshold": { "max": 1.0, "min": 0.57 } }, "lower_face_occlusion": { "estimate": 1, "threshold": 0 }, "mouth_occluded": { "estimate": 1, "threshold": { "max": 0.5, "min": 0.0 } }, "mouth_open": { "estimate": 1, "threshold": { "max": 0.5, "min": 0.0 } }, "mouth_smiling": { "estimate": 1, "threshold": { "max": 0.5, "min": 0.0 } }, "natural_light": { "estimate": 1, "threshold": 1 }, "nose_occlusion": { "estimate": 1, "threshold": 0 }, "radial_distortion": { "estimate": 1, "threshold": 0 }, "red_eyes": { "estimate": 1, "threshold": 0 }, "right_eye": { "estimate": 1, "threshold": [ "open" ] }, "shoulders_position": { "estimate": 1, "threshold": [ "parallel" ] }, "smile_properties": { "estimate": 1, "threshold": [ "none" ] }, "specularity_quality": { "estimate": 1, "threshold": { "max": 1.0, "min": 0.3 } } }, "estimate": 0, "filter": 0 }, "liveness_states": null, "mask_states": null, "multiface_policy": 1, "pitch_threshold": null, "roll_threshold": null, "yaw_threshold": null }, "extract_policy": { "extract_basic_attributes": 1, "fd_score_threshold": 0.0 }, "storage_policy": { "attribute_policy": { "store_attribute": 1 }, "face_sample_policy": { "store_sample": 1, "ttl": null } }, "verification_threshold": 0.5 }, "verifier_id": ..., "version": 0 } ] 
 - Count verifiers that satisfy the filters - Parameters:
- description ( - Optional[- str]) – verifier description (“like” parameter)
- accountIdFilter ( - Optional[- str]) – account id to count verifiers
 
- Returns:
- body contains json with verifier count 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.common.http_objs import VerifierPolicies, VerifierAttributePolicy, VerifierDetectPolicy >>> from luna3.common.http_objs import VerifierExtractPolicy, VerifierStoragePolicy, VerifierFaceSamplePolicy >>> >>> policies = VerifierPolicies( ... verificationThreshold=0.5, ... detectPolicy=VerifierDetectPolicy(estimateEmotions=1), ... extractPolicy=VerifierExtractPolicy(extractBasicAttributes=1), ... storagePolicy=VerifierStoragePolicy( ... faceSamplePolicy=VerifierFaceSamplePolicy(storeSample=1), ... attributePolicy=VerifierAttributePolicy(storeAttribute=1), ... ), ... ) >>> response = client.createVerifier(description="Happy_persons", policies=policies, raiseError=True) >>> response = client.getVerifiersCount(description="Happy_persons") >>> print(response.statusCode) 200 >>> print(response.json) {'verifiers_count': ...} 
 - Get version of luna service - Parameters:
- lunaRequestId ( - Optional[- str]) – External request id. Helps uniquely identifying messages, corresponding to particular requests, in system logs. Pattern: ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$
- asyncRequest ( - Optional[- bool]) – execution in asynchronous mode, disabled by default
- raiseError ( - Optional[- bool]) – if request fails, LunaApiException is raised
- totalTimeout ( - Optional[- Real]) – request processing timeout in seconds.
- connectTimeout ( - Optional[- Real]) – connection timeout seconds.
- sockReadTimeout ( - Optional[- Real]) – socket read timeout
- sockConnectTimeout ( - Optional[- Real]) – socket connect timeout
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with version. 
- Return type:
- class 
 
 - Get video task data - Parameters:
- taskId ( - str) – task id
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with task status, progress or result url. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.public.sdk import VideoSDKInput,VideoSDKAnalytics,VideoSDKProperties,DeferredTask >>> from luna3.public.sdk import PeopleCountAnalyticsParams, Rate, StoragePolicy >>> url ="https://lunatestttttt.s3.eu-central-1.amazonaws.com/video_test.avi" >>> params = PeopleCountAnalyticsParams(rate=Rate(unit="second", period=1), probeCount=2) >>> analytics = [VideoSDKAnalytics(name="people_count", targets=[], parameters=params)] >>> deferred = DeferredTask(1, StoragePolicy("luna_image_store")) >>> response = client.videosdk(inputData=VideoSDKInput(VideoSDKProperties(url), analytics, deferred)) >>> taskId = response.json["task_id"] >>> response = client.getVideoTask(taskId) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "progress": null, "status": ..., "task_id": ... } 
 - Update lambda - Parameters:
- archive ( - Optional[- bytes]) – archive file bytes
- lambdaName ( - Optional[- str]) – name of lambda
- description ( - Optional[- str]) – description
- workers ( - Optional[- int]) – count of lambda workers
- archiveTtl ( - Optional[- Literal[- -1,- 1,- 2,- 3,- 4,- 5,- 6,- 7,- 14,- 30,- 60,- 90,- 180,- 365]]) – ttl for lambda archive
- enableGPU ( - Optional[- bool]) – whether to enable GPU
- podCount ( - Optional[- int]) – count of lambda pods
- cpuLimit ( - Optional[- int]) – cpu limit for lambda in cpu units
- ramLimit ( - Optional[- int]) – ram limit for lambda in GB
- cpuRequest ( - Optional[- int]) – cpu request for lambda in cpu units
- ramRequest ( - Optional[- int]) – ram request for lambda in GB
- namespace ( - Optional[- str]) – namespace
- selector ( - Optional[- dict]) – kubernetes pod node selector
- userConfig ( - Optional[- dict]) – user config to start lambda with
- shared ( - Optional[- int]) – whether lambda is shared
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with lambda_id will be returned. 
- Return type:
- class 
 - >>> import json >>> from uuid import uuid4 >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import LAMBDA_EXPORT_ARCHIVE >>> ... response = client.importLambda(lambdaName=str(uuid4()), archive=LAMBDA_EXPORT_ARCHIVE) >>> >>> print(response.statusCode) 202 
 - Attach or detach streams to group. Optional you can set, that group and streams must belong to account. - Parameters:
- groupId ( - str) – group identifier
- streamIds ( - List[- str]) – stream ids
- action ( - Literal[- 'attach',- 'detach']) – attach or detach
- accountId ( - Optional[- str]) – account id
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME >>> from luna3.video_manager.http_objs import StreamAnalytic >>> streamId = client.createStream( ... streamType="videofile", ... reference="http://reference", ... name="test_stream", ... description="test stream description", ... analytics=[StreamAnalytic(name=ANALYTIC_NAME)], ... raiseError=True, ... ).json["stream_id"] >>> groupId = client.createGroup( ... groupName="linked_group", ... description="test group description", ... raiseError=True, ... ).json["group_id"] >>> response = client.link(groupId=groupId, streamIds=[streamId], action="attach") >>> print(response.statusCode) 204 >>> response = client.getStream(streamId=streamId, raiseError=True) >>> print(response.json["groups"] == [groupId]) True 
 - attach/detach faces to the list - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/linkFaces - Parameters:
- listId ( - str) – list id
- action ( - str) – expected action with list and faces (Enum:”attach” “detach”)
- faceIds ( - list) – faces for attach or detach to/from list
 
- Raises:
- ValueError – if action parameter not in (“attach”, “detach”) 
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> faceId = client.createFace(raiseError=True).json["face_id"] >>> listId = client.createList("happy_persons", raiseError=True).json["list_id"] >>> response = client.linkFacesToList(listId=listId, action='attach', faceIds=[faceId]) >>> print(response.statusCode) 204 >>> response = client.linkFacesToList(listId=listId, action='detach', faceIds=[faceId]) >>> print(response.statusCode) 204 
 - Prepare account header and make request. - Parameters:
- url ( - str) – request URL
- method ( - str) – request method
- queryParams ( - Optional[- dict]) – query parameters
- body ( - Union[- str,- bytes,- dict,- list,- Payload,- RequestPayload,- None]) – request body
- headers ( - Optional[- dict]) – headers for request
- asyncRequest ( - Optional[- bool]) – execution in asynchronous mode, disabled by default
- lunaRequestId ( - Optional[- str]) – External request id. Helps uniquely identifying messages, corresponding to particular requests, in system logs. Pattern: ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$
- accountId ( - Optional[- str]) – account id
- login ( - Optional[- str]) – login
- password ( - Optional[- str]) – password
- token ( - Optional[- str]) – token
 
- Returns:
- structure with status code, request and decoded Luna API response body is returned. 
 
 - Matcher API allows to submit tasks to a service that searches for faces similar to a given reference(s) by matching them. An attribute descriptor should be extracted for reference(s) and candidate(s). A source for references are events, attributes and faces. A source for candidates are faces and lists. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/matchFaces - Parameters:
- candidates ( - List[- Candidates]) – Candidates object with info about candidates
- references ( - List[- Union[- Reference,- BinaryReference]]) – list of Reference objects. Each object has entity id and it type (possible type variants: events, attributes, faces)
- accountIdFilter ( - Optional[- str]) – account id to match faces
- accept ( - str) – expected content type
 
- Returns:
- body contains json with results of matching (failed and succeeded matches) 
- Return type:
- LunaResponse 
 - >>> import json >>> from testData.resources import FACE_WARP >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> from luna3.python_matcher.match_objects import Reference >>> from luna3.python_matcher.match_objects import Candidates >>> >>> sampleId = client.saveFaceSample(FACE_WARP, raiseError=True).json["sample_id"] >>> attributeId = client.extractAttrFromSample(sampleIds=[sampleId], raiseError=True).json[0]["attribute_id"] >>> faceId = client.createFace(attributeId=attributeId, raiseError=True).json["face_id"] >>> response = client.matchFaces( ... candidates=[Candidates(FaceFilters(faceIds=[faceId]), limit=3, threshold=0.5)], ... references=[Reference("face", faceId)] ... ) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) [ { "matches": [ { "filters": { "face_ids": [...], "origin": "faces" }, "result": [ { "face": { "account_id": ..., "avatar": "", "create_time": ..., "event_id": null, "external_id": "", "face_id": ..., "lists": [], "user_data": "" }, "similarity": 1.0 } ] } ], "reference": { "id": ..., "type": "face" } } ] 
 - Matcher API allows to submit tasks to a service that searches for human bodies similar to a given reference(s) by matching them. A body attribute descriptor should be extracted for reference(s) and candidate(s). - The sources for references are events or binary descriptor. The sources for candidates is events. - Parameters:
- candidates ( - List[- Candidates]) – Candidates object with info about candidates
- references ( - List[- Union[- Reference,- BinaryReference]]) – list of Reference objects. Each object has entity id and it type (possible type variants: event, sdk_descriptor, raw_descriptor)
- accountIdFilter ( - Optional[- str]) – account id to match bodies
- accept ( - str) – expected content type
 
- Returns:
- body contains json with results of matching (failed and succeeded matches). 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import BODY_WARP >>> from luna3.common.http_objs import Policies, DetectPolicy, ExtractPolicy >>> from luna3.python_matcher.match_objects import EventFilters >>> from luna3.python_matcher.match_objects import Reference >>> from luna3.python_matcher.match_objects import Candidates >>> >>> detectPolicy = DetectPolicy(detectBody=1, detectFace=0) >>> extractPolicy = ExtractPolicy(extractBodyDescriptor=1, extractFaceDescriptor=0) >>> policies = Policies(detectPolicy=detectPolicy, extractPolicy=extractPolicy) >>> handlerId = client.createHandler( ... description="happy_people", policies=policies, raiseError=True ... ).json["handler_id"] >>> eventId = client.emitEvents( ... handlerId=handlerId, inputData=BODY_WARP, raiseError=True, ... ).json['events'][0]['event_id'] >>> response = client.matchBodies( ... candidates=[Candidates(EventFilters(eventIds=[eventId]), limit=1, threshold=0.5)], ... references=[Reference("event", eventId)] ... ) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) [ { "matches": [ { "filters": { "event_ids": [...], "origin": "events" }, "result": [ { "event": { "accessories": null, "account_id": ..., "age": null, "attach_result": [], "body_basic_attributes": null, "body_detections": [ { "detect_time": ..., "detect_ts": null, "detection": { "rect": { "height": ..., "width": ..., "x": ..., "y": ... } }, "image_origin": null, "sample_id": ... } ], "create_time": ..., "deepfake": null, "emotion": null, "end_time": ..., "ethnic_group": null, "event_id": ..., "external_id": "", "face_detections": null, "face_id": null, "gender": null, "handler_id": ..., "liveness": null, "location": { "area": null, "city": null, "district": null, "geo_position": null, "house_number": null, "street": null }, "lower_body": null, "mask": null, "match_result": null, "meta": null, "source": null, "stream_id": null, "tags": null, "top_match": null, "track_id": null, "upper_body": null, "user_data": "" }, "similarity": 1.0 } ] } ], "reference": { "id": ..., "type": "event" } } ] 
 - Matcher API allows to submit tasks to a service that searches for faces similar to a given reference(s) by matching them. An attribute descriptor should be extracted for reference(s) and candidate(s). A source for references are events, attributes and faces. A source for candidates are faces and lists. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/matchFaces - Parameters:
- candidates ( - List[- Candidates]) – Candidates object with info about candidates
- references ( - List[- Union[- Reference,- BinaryReference]]) – list of Reference objects. Each object has entity id and it type (possible type variants: events, attributes, faces)
- accountIdFilter ( - Optional[- str]) – account id to match faces
- accept ( - str) – expected content type
 
- Returns:
- body contains json with results of matching (failed and succeeded matches) 
- Return type:
- LunaResponse 
 - >>> import json >>> from testData.resources import FACE_WARP >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> from luna3.python_matcher.match_objects import Reference >>> from luna3.python_matcher.match_objects import Candidates >>> >>> sampleId = client.saveFaceSample(FACE_WARP, raiseError=True).json["sample_id"] >>> attributeId = client.extractAttrFromSample(sampleIds=[sampleId], raiseError=True).json[0]["attribute_id"] >>> faceId = client.createFace(attributeId=attributeId, raiseError=True).json["face_id"] >>> response = client.matchFaces( ... candidates=[Candidates(FaceFilters(faceIds=[faceId]), limit=3, threshold=0.5)], ... references=[Reference("face", faceId)] ... ) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) [ { "matches": [ { "filters": { "face_ids": [...], "origin": "faces" }, "result": [ { "face": { "account_id": ..., "avatar": "", "create_time": ..., "event_id": null, "external_id": "", "face_id": ..., "lists": [], "user_data": "" }, "similarity": 1.0 } ] } ], "reference": { "id": ..., "type": "face" } } ] 
 - Matcher API allows to submit tasks to a service that searches for faces similar to a given reference(s) by matching them. An attribute descriptor should be extracted for reference(s) and candidate(s). A source for references are events, attributes and faces. A source for candidates are faces and lists. - Parameters:
- descriptorType ( - str) – base descriptor type for references and candidates
- descriptorVersion ( - Optional[- int]) – descriptor version of matching
- platCoef ( - Optional[- List[- Union[- dict,- PlatCoef]]]) – plat coefs, for normalizing matching results
- candidates ( - List[- Candidates]) – Candidates object with info about candidates
- references ( - List[- Union[- Reference,- BinaryReference]]) – list of Reference objects. Each object has entity id and it type (possible type variants: events, attributes, faces, raw descriptors)
- accountId ( - Optional[- str]) – account id
- accept ( - str) – expected content type
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse: results of matching (failed and succeeded matches) 
- Return type:
- class 
 
 - Matcher raw API allows to match each candidate with each reference descriptors. - Parameters:
- candidates ( - List[- BinaryReference]) – list of BinaryReference objects for candidates
- references ( - List[- BinaryReference]) – list of BinaryReference objects for references
- accountIdFilter ( - Optional[- str]) – account id to match raw
- accept ( - str) – expected content type
 
- Returns:
- body contains json with results of matching for each reference. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.common.http_objs import RawDescriptor >>> from luna3.python_matcher.match_objects import RawDescriptorReference >>> from testData.resources import DESCRIPTOR >>> >>> response = client.matchRaw( ... references=[RawDescriptorReference("raw_descriptor_references", DESCRIPTOR)], ... candidates=[RawDescriptorReference("raw_descriptor_candidates", DESCRIPTOR)], ... ) >>> print(response.statusCode) 201 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "matches": [ { "matches": [ { "candidate_id": "raw_descriptor_candidates", "similarity": 1.0 } ], "reference_id": "raw_descriptor_references" } ] } 
 - Patch account. - Parameters:
- newLogin ( - Optional[- str]) – account login
- newPassword ( - Optional[- str]) – account password
- newAccountType ( - Optional[- Literal[- 'advanced_user',- 'user']]) – account type
- newDescription ( - Optional[- str]) – account description
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse 204 status code will be returned. 
- Return type:
- class 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from uuid import uuid4 >>> >>> response = client.patchAccount(newDescription="new description") >>> print(response.statusCode) 204 
 - Update fields of face (user_data, external_id, attribute_id) - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/patchFace - Parameters:
- faceId ( - str) – face id
- externalId ( - Optional[- str]) – user-defined external id for face
- userData ( - Optional[- str]) – user data
- avatar ( - Optional[- str]) – avatar for face, references to a sample or a user-defined reference
- eventId ( - Optional[- str]) – event id associated with creating the face
 
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> faceId = client.createFace(raiseError=True).json['face_id'] >>> response = client.patchFace(faceId=faceId, userData="test_data05_patched") >>> print(response.statusCode) 204 
 - Update group description. - Parameters:
- groupId ( - str) – group id
- description ( - str) – group description
- accountId ( - Optional[- str]) – account_id
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> groupId = client.createGroup( ... groupName="patch_group", ... description="test group description", ... raiseError=True, ... ).json["group_id"] >>> response = client.patchGroup(groupId=groupId, description="new description") >>> print(response.statusCode) 204 >>> response = client.getGroup(groupId=groupId) >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "account_id": ..., "create_time": ..., "description": "new description", "group_id": ..., "group_name": "patch_group" } 
 - Patch stream by id. - Parameters:
- groupId ( - str) – group id
- accountId ( - Optional[- str]) – account id
- action ( - str) – pause or resume
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - It’s impossible to create a working doctest because the stream must be processing. - import json from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME from luna3.video_manager.http_objs import StreamAnalytic groupId = client.createGroup( - groupName=”delete_group”, description=”test group description”, raiseError=True, - ).json[“group_id”] streamId = client.createStream( - streamType=”videofile”, reference=”http://reference”, name=”test_stream”, description=”test stream description”, analytics=[StreamAnalytic(name=ANALYTIC_NAME)], groupId=groupId, raiseError=True, - ).json[“stream_id”] response = client.patchGroupStreams(groupId=groupId, action=”pause”) print(response.statusCode) 204 
 - Patch lambda - Parameters:
- lambdaId ( - str) – lambda id
- lambdaName ( - Optional[- str]) – name of lambda
- description ( - Optional[- str]) – description
- lambdaType ( - Optional[- Literal[- 'standalone',- 'handlers',- 'tasks',- 'agent']]) – lambda type
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with lambda_id will be returned. 
- Return type:
- class 
 - >>> from uuid import uuid4 >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import LAMBDA_ARCHIVE >>> >>> lambdaId = client.createLambda(archive=LAMBDA_ARCHIVE, lambdaName=str(uuid4())).json["lambda_id"] >>> newName = str(uuid4()) >>> response = client.patchLambda(lambdaId=lambdaId, lambdaName=newName) >>> print(response.statusCode) 204 
 - Patch schedule by id - Parameters:
- scheduleId ( - int) – schedule id
- action ( - str) – action for schedule
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with response. 
- Return type:
- class 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> contentKwargs=dict( ... filters=FaceFilters(accountId=client.accountId), createList=1 ... ) >>> response = client.createSchedule( ... accountId=client.accountId, ... taskType=1, ... contentKwargs=contentKwargs, ... cron="5 4 * * *", ... cronTz="utc", ... startImmediately=False, ... raiseError=True ... ) >>> scheduleId = response.json["schedule_id"] >>> response = client.patchSchedule( ... scheduleId=scheduleId, ... action="pause" ... ) >>> print(response.statusCode) 204 
 - Patch stream by id. - Parameters:
- streamId ( - str) – stream id
- accountId ( - Optional[- str]) – account id
- action ( - str) – pause or resume
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - It’s impossible to create a working doctest because the stream must be processing. - import json from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME from luna3.video_manager.http_objs import StreamAnalytic streamId = client.createStream( - streamType=”videofile”, reference=”http://reference”, name=”test_stream”, description=”test stream description”, analytics=[StreamAnalytic(name=ANALYTIC_NAME)], raiseError=True, - ).json[“stream_id”] response = client.patchStream(streamId=streamId, action=”pause”) print(response.statusCode) 204 
 - Property get plugins uri - >>> self.pluginsUri "http://127.0.0.1:5030/plugins" 
 - Get agent streams which processing must be started - Parameters:
- agentId ( - str) – agent id
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from time import sleep >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client, ACCOUNT_ID, AGENT_ID >>> response = client.postAgentStreams(agentId=AGENT_ID, accountId=ACCOUNT_ID) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "streams": [] } 
 - Post feedback on stream - Parameters:
- agentId ( - str) – agent id
- streamsInfo ( - list[- StreamInfo]) – list of stream info
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from uuid import uuid4 >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME, ACCOUNT_ID, ANALYTIC_NAME, AGENT_ID >>> from luna3.video_manager.http_objs import Agent, StreamInfo >>> response = client.postStreamsFeedback( ... agentId=AGENT_ID, ... streamsInfo=[ ... StreamInfo( ... streamId=str(uuid4()), ... status=1, ... version=1, ... time="2024-08-11T09:11:41.674Z", ... analyticIndexes=[0], ... ) ... ] ... ) >>> >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "streams": [ { "action": "stop", "stream_id": ..., "version": 1 } ] } 
 - Liveness API allows to predict liveness for given images. - Parameters:
- images ( - Union[- BinaryImage,- List[- BinaryImage],- None]) – Single image or images list (supported formats “jpeg, png, tif, ppm, bmp”).
- urls ( - Optional[- List[- str]]) – list of urls with images
- meta ( - Optional[- Dict]) –- A dict with device information Fields: - os: A str, device os. Required manufacture: A str, manufacture model: A str, model 
- xMeta ( - Optional[- Dict]) – A dict with any additional information
- aggregate ( - Optional[- int]) – Available values : 0, 1; whether to aggregate liveness estimations
 
- Returns:
- body contains json with results of predictions (failed and succeeded predictions) 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import FACE_WARP >>> >>> response = client.predictLiveness(images=[FACE_WARP]) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "images": [ { "error": { "desc": "Success", "detail": "Success", "error_code": 0, "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-0" }, "filename": "Claudia_Schiffer_warp.jpg", "liveness": { "estimations": { "probability": ..., "quality": ... }, "prediction": ... }, "status": 1 } ] } 
 - Proxy GET request to lambda - Parameters:
- lambdaId ( - str) – lambda id
- path ( - str) – lambda uri path
- headers ( - Optional[- dict]) – request headers
- queries ( - Optional[- dict]) – request queries
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with lambda_id will be returned. 
- Return type:
- class 
 
 - Proxy POST request to lambda - Parameters:
- lambdaId ( - str) – lambda id
- path ( - str) – lambda uri path
- body ( - Union[- str,- bytes,- dict,- list,- Payload,- RequestPayload,- None]) – request body
- headers ( - Optional[- dict]) – request headers
- queries ( - Optional[- dict]) – request queries
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with lambda_id will be returned. 
- Return type:
- class 
 
 - Put face attributes. - Parameters:
- faceId ( - str) – face id
- attributeId ( - Optional[- str]) – attribute id
- descriptors ( - Optional[- List[- Union[- bytes,- RawDescriptor]]]) – list of descriptors different versions
- descriptorSamples ( - List[- str]) – list of warp image id from which the attribute was extracted.
- basicAttributes ( - Optional[- dict]) – dict with basic attributes (age, gender, ethnicity)
- basicAttributesSamples ( - List[- str]) – list of warp image id from which the basic attribute was extracted.
 
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> faceId = client.createFace(raiseError=True).json["face_id"] >>> basicAttributes = {"age": 29, "gender": 0, "ethnicity": 3} >>> response = client.putFaceAttributes(faceId=faceId, basicAttributes=basicAttributes) >>> print(response.statusCode) 204 
 - Get lambda by id. - Parameters:
- lambdaId ( - str) – lambda id
- userConfig ( - Optional[- dict]) – lambda custom config
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with new lambda config version. 
- Return type:
- class 
 - >>> import json >>> from uuid import uuid4 >>> from time import sleep >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import LAMBDA_ARCHIVE >>> >>> def wait4start(lambdaId_: str): ... for _ in range(150): ... reply = client.getLambdaStatus(lambdaId_).json ... if reply["status"] == "running": ... break ... if reply["status"] == "terminated": ... raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId_}") ... sleep(1) ... else: ... raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId_}") ... >>> lambdaId = client.createLambda(archive=LAMBDA_ARCHIVE, lambdaName=str(uuid4())).json["lambda_id"] >>> wait4start(lambdaId) >>> response = client.putLambdaUserConfig(lambdaId=lambdaId, userConfig={"LAMBDA_SETTING": "value2"}) >>> >>> print(response.statusCode) 200 >>> print(response.json) {'version': 2} 
 - Update schedule - Parameters:
- scheduleId ( - int) – schedule id
- taskType ( - int) – type of task
- contentKwargs ( - dict) – kwargs for create content
- cron ( - str) – cron string
- cronTz ( - Optional[- str]) – cron timezone
- startImmediately ( - Optional[- bool]) – start task immediately
- createStopped ( - Optional[- bool]) – create task stopped schedule task
- taskNotificationPolicy ( - Optional[- TaskNotificationPolicy]) – task notification policy
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with schedule id. 
- Return type:
- class 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> contentKwargs=dict( ... filters=FaceFilters(accountId=client.accountId), createList=1 ... ) >>> response = client.createSchedule( ... accountId=client.accountId, ... taskType=1, ... contentKwargs=contentKwargs, ... cron="5 4 * * *", ... cronTz="utc", ... startImmediately=False, ... raiseError=True ... ) >>> scheduleId = response.json["schedule_id"] >>> response = client.putSchedule( ... scheduleId=scheduleId, ... taskType=1, ... contentKwargs=contentKwargs, ... cron="0 * * * *", ... cronTz="utc", ... startImmediately=False, ... ) >>> print(response.statusCode) 200 >>> print(response.json) {'schedule_id': ...} 
 - Create/replace stream analytics working intervals - Parameters:
- streamId ( - str) – stream id
- analyticIdx ( - int) – index of analytics of interest
- intervalsIdx ( - int) – index of intervals of interest
- schedule ( - Schedule) – schedule object with schedule id or list of intervals
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME >>> from luna3.video_manager.http_objs import StreamAnalytic, Schedule, Interval >>> streamId = client.createStream( ... streamType="stream", ... reference="http://reference", ... name="test_stream", ... description="test stream description", ... analytics=[StreamAnalytic( ... name=ANALYTIC_NAME, ... schedules=[Schedule(intervals=[ ... Interval(startTime="2025-05-01T01:16:00Z", endTime="2026-05-01T01:16:00Z")]) ... ])], ... raiseError=True, ... ).json["stream_id"] >>> response = client.putStreamAnalyticsWorkingIntervals( ... streamId=streamId, ... analyticIdx=0, ... intervalsIdx=0, ... schedule=Schedule(intervals=[ ... Interval(startTime="2025-05-01T01:16:00Z", endTime="2026-05-01T01:16:00Z")]), ... raiseError=True ... ) >>> print(response.statusCode) 204 
 - Replace verifier - Parameters:
- verifierId ( - str) – verifier id
- policies ( - Optional[- VerifierPolicies]) – object with policies information
- description ( - Optional[- str]) – user description
 
- Returns:
- body contains json with verifier current version. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.common.http_objs import VerifierPolicies, VerifierAttributePolicy, VerifierDetectPolicy >>> from luna3.common.http_objs import VerifierExtractPolicy, VerifierStoragePolicy, VerifierFaceSamplePolicy >>> >>> policies = VerifierPolicies( ... verificationThreshold=0.5, ... detectPolicy=VerifierDetectPolicy(estimateEmotions=1), ... extractPolicy=VerifierExtractPolicy(extractBasicAttributes=1), ... storagePolicy=VerifierStoragePolicy( ... faceSamplePolicy=VerifierFaceSamplePolicy(storeSample=1), ... attributePolicy=VerifierAttributePolicy(storeAttribute=1), ... ), ... ) >>> verifierId = client.createVerifier( ... description="Happy_persons", policies=policies, raiseError=True ... ).json["verifier_id"] >>> newPolicies = policies >>> newPolicies.verificationThreshold = 0.9 >>> response = client.putVerifier(verifierId=verifierId, policies=newPolicies) >>> print(response.statusCode) 200 >>> print(response.json) {'version': 1} 
 - Replace analytic. - Parameters:
- analyticId ( - str) – analytic id
- analytic ( - Analytic) – analytic structure
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from time import sleep >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ACCOUNT_ID >>> from uuid import uuid4 >>> analyticName = str(uuid4()) >>> analyticId = client.createAnalytic( ... analytic=Analytic(analyticName=analyticName), raiseError=True ... ).json["analytic_id"] >>> response = client.replaceAnalytic( ... analyticId=analyticId, analytic=Analytic(analyticName=analyticName, description="new descr") ... ) >>> >>> print(response.statusCode) 204 
 - Create schedule template - Parameters:
- scheduleId ( - str) – schedule id
- scheduleTemplate ( - ScheduleTemplate) – schedule template object
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.video_manager.http_objs import ScheduleTemplate >>> scheduleId = client.createScheduleTemplate( ... scheduleTemplate=ScheduleTemplate( ... startTime="2025-05-01T00:00:00.000000+00:00", ... endTime="2025-05-16T00:00:00.000000+00:00", ... cron="5 4 * * 4", ... duration=11, ... durationType="minute", ... ), ... raiseError=True, ... ).json["schedule_id"] >>> response = client.replaceScheduleTemplate(scheduleId=scheduleId, scheduleTemplate=ScheduleTemplate( ... startTime="2026-05-01T00:00:00.000000+00:00", ... endTime="2026-05-16T00:00:00.000000+00:00", ... cron="1 4 * * 4", ... duration=1, ... durationType="hour", ... )) >>> print(response.statusCode) 201 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "intervals": [ { "end_time": ..., "start_time": ... }, { "end_time": ..., "start_time": ... } ], "schedule_id": ... } 
 - Replace an existent stream in luna-streams - Parameters:
- streamId ( - str) – id to put stream by
- analytics ( - List[- StreamAnalytic]) – stream analytics
- name ( - Optional[- str]) – stream name
- description ( - Optional[- str]) – stream description
- streamType ( - Literal[- 'stream',- 'videofile']) – stream type
- downloadable ( - bool) – whether reference is downloadable
- timestampSource ( - Literal[- 'pts',- 'server',- 'frame_rate',- 'auto']) – timestamp source where pts - video labels, server - server time, frame_rate - video file auto logic described in openapi
- reference ( - str) – stream URL
- rotation ( - Optional[- Literal[- 0,- 90,- 180,- 270]]) – angle of camera frame rotation (0, 90, 180 or 270)
- pts ( - Optional[- VideoPTS]) – video pts settings
- fps ( - Optional[- Real]) – video decoder fps
- location ( - Optional[- Location]) – location that stream belongs
- source ( - Optional[- str]) – additional stream information
- restart ( - Optional[- Restart]) – auto-restart configuration
- groupName ( - Optional[- str]) – group name
- groupId ( - Optional[- str]) – group identifier
- timeout ( - Optional[- int]) – stream/videofile read timeout
- notificationPolicy ( - Optional[- StreamNotificationPolicy]) – stream notification policy
- splittable ( - Optional[- int]) – whether stream is splittable
- ffmpegKwargs ( - Optional[- dict]) – additional ffmpeg kwargs
- behaviorParameters ( - Optional[- BehaviorParameters]) – behavior parameters for stream
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with created stream id & version will be returned. 
- Return type:
- class 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME >>> from luna3.video_manager.http_objs import StreamAnalytic >>> streamId = client.createStream( ... streamType="videofile", ... reference="http://reference", ... name="test_stream", ... description="test stream description", ... analytics=[StreamAnalytic(name=ANALYTIC_NAME)], ... raiseError=True, ... ).json["stream_id"] >>> response = client.replaceStream( ... streamId=streamId, ... streamType="videofile", ... reference="http://reference.local/replaced", ... name="replaced_name", ... description="replaced description", ... analytics=[StreamAnalytic(name=ANALYTIC_NAME)], ... ) >>> print(response.statusCode) 200 >>> response = client.getStream(streamId=streamId, raiseError=True) >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "account_id": ..., "analytics": [ { "analytic_name": "doctests_analytic", "autorestart": { "attempt_count": 10, "current_attempt": 0, "delay": 60, "last_attempt_time": null, "restart": 0, "status": "disabled" }, "parameters": {}, "status": ... } ], "create_time": ..., "data": { "behavior_parameters": ..., "downloadable": false, "ffmpeg_kwargs": ..., "fps": ..., "orientation_strategy": "static", "pts": { "start_time": 0.0 }, "reference": "http://reference.local/replaced", "rotation": 0, "timeout": ..., "timestamp_source": "auto", "type": "videofile" }, "description": "replaced description", "groups": [], "last_error": null, "location": { "area": null, "city": null, "district": null, "geo_position": null, "house_number": null, "street": null }, "name": "replaced_name", "notification_policy": { "enable": 0, "stream_callbacks": [] }, "source": null, "splittable": 0, "status": 0, "stream_id": ..., "version": 2 } 
 - Replace task notification policy by task id. - Parameters:
- taskId ( - int) – task id
- accountIdFilter ( - Optional[- str]) – account id
- notificationPolicy ( - Optional[- TaskNotificationPolicy]) – task notification policy
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse will return json with response. 
- Return type:
- class 
 - >>> import json >>> import time >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.python_matcher.match_objects import FaceFilters >>> from luna3.tasks.http_objs import TaskNotificationPolicy >>> >>> listId = client.createList("happy_persons", raiseError=True).json["list_id"] >>> faceId = client.createFace( ... externalId="14159261415928", lists=[listId], userData="clustering_faces", raiseError=True ... ).json["face_id"] >>> faceFilters = FaceFilters( ... externalIds=["14159261415928"], ... listId=listId, ... faceIds=[faceId], ... userData="clustering_faces", ... ) >>> taskId = client.createClusteringTask(filters=faceFilters, raiseError=True).json["task_id"] >>> time.sleep(1) >>> response = client.replaceTaskNotificationPolicy(taskId=taskId, ... notificationPolicy=TaskNotificationPolicy(enable=0, taskCallbacks=[], subtaskCallbacks=[])) >>> print(response.statusCode) 204 
 - Replace token. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/putToken - Parameters:
- tokenId ( - str) – token id
- grantAllPermissions ( - int) – grant all permissions to token
- tokenPermissions ( - Optional[- TokenPermissions]) – token permissions
- expirationTime ( - Optional[- str]) – token expiration time
- visibilityArea ( - Optional[- Literal[- 'all',- 'account']]) – token visibility area
- description ( - Optional[- str]) – account description
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with created token id and token will be returned. 
- Return type:
- class 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.accounts.http_objs import TokenPermissions >>> from uuid import uuid4 >>> import json >>> >>> tokenId = client.createToken(tokenPermissions=TokenPermissions(), raiseError=True).json["token_id"] >>> response = client.replaceToken(tokenId=tokenId, tokenPermissions=TokenPermissions()) >>> print(response.statusCode) 201 >>> print(response.json) {'token_id': ..., 'token': ..., 'url': ...} 
 - Save body sample to the system. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/saveSample - Parameters:
- image ( - BinaryImage) – Single image object.
- ttl ( - Optional[- int]) – Object lifetime
 
- Returns:
- body contains json with sample_id and url. 
- Return type:
- LunaResponse 
- Raises:
- ValueError – if body has unsupported mimetype. 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import BODY_WARP as image >>> >>> response = client.saveBodySample(image=image) >>> print(response.statusCode) 201 >>> print(json.dumps(response.json, sort_keys=True)) {"sample_id": ..., "url": ...} 
 - Save raw event. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/saveEvent - Parameters:
- handlerId ( - str) – handler id
- event ( - Union[- ApiRawEvent,- Dict[- str,- Any]]) – raw event
- waitSaving ( - Optional[- int]) – whether to wait for event saving
 
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> handlerId = client.createHandler( ... handlerType=1, description="dynamic_handler", raiseError=True ... ).json["handler_id"] >>> event = { ... "face_attributes": { ... "basic_attributes": { ... "age": 29, ... "gender": 1, ... "ethnicities": { ... "predominant_ethnicity": "asian", ... "estimations": { ... "african_american": 1.92238889737406e-12, ... "asian": 0.954671621322632, ... "caucasian": 0.045328326523304, ... "indian": 7.65100649502415e-10, ... }, ... }, ... } ... }, ... "user_data": "event_user_data", ... } >>> response = client.saveEvent(handlerId=handlerId, event=event, waitSaving=1) >>> print(response.statusCode) 201 
 - Save face sample to the system. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/saveSample - Parameters:
- image ( - BinaryImage) – Single image object.
- ttl ( - Optional[- int]) – Sample lifetime
 
- Returns:
- body contains json with sample_id and url. 
- Return type:
- LunaResponse 
- Raises:
- ValueError – if body has unsupported mimetype. 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import FACE_WARP as image >>> >>> response = client.saveFaceSample(image=image) >>> print(response.statusCode) 201 >>> print(json.dumps(response.json, sort_keys=True)) {"sample_id": ..., "url": ...} 
 - Save general events to luna-events. - Parameters:
- events ( - list[- Union[- GeneralEvent,- dict]]) – list of events
- waitEventsSaving ( - Optional[- bool]) – whether to wait events saving (response will be received only after events will be saved)
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. 
- Return type:
- class 
 
 - Save image to the system. - Parameters:
- image ( - BinaryImage) – Single image object.
- ttl ( - Optional[- int]) – Image lifetime
 
- Returns:
- body contains json with image_id and url. 
- Return type:
- LunaResponse 
- Raises:
- ValueError – if body has unsupported mimetype 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import FACE_IMAGE as image >>> >>> response = client.saveImage(image=image) >>> print(response.statusCode) 201 >>> print(json.dumps(response.json, sort_keys=True)) {"external_url": "http://127.0.0.1:5000/6/images/...", "image_id": ..., "url": ...} 
 - Save object to the system. - Parameters:
- objectBody ( - str) – object, available: text, json
- contentType ( - Optional[- str]) – content-type of object or application/json for default
- ttl ( - Optional[- int]) – Object lifetime
 
- Returns:
- body contains json with object_id and url. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> response = client.saveObject("1,2,3", contentType = "text/plain") >>> print(response.statusCode) 201 >>> print(json.dumps(response.json, sort_keys=True)) {"external_url": "http://127.0.0.1:5000/6/objects/...", "object_id": ..., "url": ...} 
 - Detect faces on input images. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/sdk - Parameters:
- inputData ( - Union[- BinaryImage,- List[- BinaryImage],- List[- UrlForDetection],- List[- str]]) – one of: - Single image or images list for extraction (supported formats “jpeg, png, tif, ppm, bmp”). - list of urls with images - list of images’ ids
- estimateImageModification ( - int) – Available values : 0, 1
- estimatePeopleCount ( - int) – Available values : 0, 1
- peopleCountCoordinates ( - int) – Available values : 0, 1
- multifacePolicy ( - int) – multiple face detection policy: 0 - multiple face detection not allowed, 1 - multiple face detection allowed, 2 - get best detection from the image
- detectFace ( - Optional[- int]) – detect faces
- detectBody ( - Optional[- int]) – detect human bodies
- estimateHeadPose ( - Optional[- int]) – Available values : 0, 1
- estimateLandmarks5 ( - Optional[- int]) – Available values : 0, 1
- estimateLandmarks68 ( - Optional[- int]) – Available values : 0, 1
- estimateQuality ( - Optional[- int]) – Available values : 0, 1
- estimateGaze ( - Optional[- int]) – Available values : 0, 1
- estimateEyesAttributes ( - Optional[- int]) – Available values : 0, 1
- estimateMouthAttributes ( - Optional[- int]) – Available values : 0, 1
- estimateEmotions ( - Optional[- int]) – Available values : 0, 1
- estimateMask ( - Optional[- int]) – Available values : 0, 1
- estimateLiveness ( - Optional[- int]) – Available values : 0, 1
- estimateDeepfake ( - Optional[- int]) – Available values : 0, 1
- estimateGlasses ( - Optional[- int]) – Available values : 0, 1
- estimateFaceDescriptor ( - Optional[- int]) – Available values : 0, 1
- estimateBasicAttributes ( - Optional[- int]) – Available values : 0, 1
- estimateBodyDescriptor ( - Optional[- int]) – Available values : 0, 1
- estimateUpperBody ( - Optional[- int]) – Available values : 0, 1
- estimateLowerBody ( - Optional[- int]) – Available values : 0, 1
- estimateBodyBasicAttributes ( - Optional[- int]) – Available values : 0, 1
- estimateAccessories ( - Optional[- int]) – Available values : 0, 1
- estimateFaceOcclusion ( - Optional[- int]) – Available values : 0, 1
- estimateBodyWarp ( - Optional[- int]) – Available values : 0, 1
- estimateFaceWarp ( - Optional[- int]) – Available values : 0, 1
- pitchThreshold ( - Optional[- int]) – maximum deviation pitch angle from 0
- rollThreshold ( - Optional[- int]) – maximum deviation roll angle from 0
- yawThreshold ( - Optional[- int]) – maximum deviation yaw angle from 0
- scoreThreshold ( - float) – descriptor garbage score
- maskStates ( - Optional[- List[- int]]) – Array of integer (filter by mask state) (Items Enum:1 2 3)
- livenessStates ( - Optional[- List[- int]]) – Array of integer (filter by liveness state) (Items Enum:0 1 2)
- deepfakeStates ( - Optional[- List[- int]]) – Array of integer (filter by deepfake state) (Items Enum:0 1)
- faceOcclusionStates ( - Optional[- List[- str]]) – Array of strings (Items Enum: “face”, “forehead”, “eye”, “nose”, “mouth”, “lower_face”)
- aggregateAttributes ( - Optional[- int]) – Available values : 0, 1
- imageType ( - Optional[- int]) – image type (0 - raw image, 1 - face warped image, 2 - body warped image)
- useExifInfo ( - Optional[- int]) – whether to use exif info for auto orientation
- extractExif ( - Optional[- int]) – extract EXIF meta information from images
- accept ( - str) – expected content type
 
- Returns:
- body contains json with samples, exif, filename for succeeded images and errors for failed images. 
- Return type:
- LunaResponse 
- Raises:
- ValueError – if no images were found 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import FACE_WARP as image >>> >>> response = client.sdk( ... inputData=image, ... estimatePeopleCount=1, ... peopleCountCoordinates=1, ... detectFace=1, ... estimateHeadPose=1, ... estimateEmotions=1, ... estimateGaze=1, ... estimateLiveness=1, ... estimateDeepfake=1, ... estimateQuality=1, ... estimateMask=1, ... estimateEyesAttributes=1, ... estimateMouthAttributes=1, ... estimateGlasses=1, ... estimateFaceWarp=1, ... estimateFaceDescriptor=1, ... estimateLandmarks5=1, ... estimateLandmarks68=1, ... estimateBasicAttributes=1, ... estimateBodyBasicAttributes=1, ... estimateUpperBody=1, ... estimateLowerBody=1, ... estimateAccessories=1, ... pitchThreshold=20, ... rollThreshold=20, ... yawThreshold=20, ... scoreThreshold=0.7, ... livenessStates=[1], ... deepfakeStates=[1], ... aggregateAttributes=1, ... imageType=1, ... useExifInfo=1, ... extractExif=1, ... accept="application/json" ... ) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "aggregate_estimations": { "body": null, "face": { "attributes": { "basic_attributes": { "age": ..., "ethnicities": { "estimations": { "african_american": ..., "asian": ..., "caucasian": ..., "indian": ... }, "predominant_ethnicity": "caucasian" }, "gender": 0 }, "descriptor": { "score": ..., "sdk_descriptor": ... }, "emotions": { "estimations": { "anger": ..., "disgust": ..., "fear": ..., "happiness": ..., "neutral": ..., "sadness": ..., "surprise": ... }, "predominant_emotion": "neutral" }, "mask": { "estimations": { "medical_mask": ..., "missing": ..., "occluded": ... }, "face_occlusion": { "estimations": { "chin": ..., "clear": ..., "correct": ..., "full": ..., "mouth": ..., "partially": ... }, "predominant_occlusion": "clear" }, "predominant_mask": "missing" } } } }, "images_estimations": [ { "estimations": [ { "body": null, "face": { "detection": { "attributes": { "emotions": { "estimations": { "anger": ..., "disgust": ..., "fear": ..., "happiness": ..., "neutral": ..., "sadness": ..., "surprise": ... }, "predominant_emotion": "neutral" }, "glasses": { "glasses": "no_glasses" }, "mask": { "estimations": { "medical_mask": ..., "missing": ..., "occluded": ... }, "face_occlusion": { "estimations": { "chin": ..., "clear": ..., "correct": ..., "full": ..., "mouth": ..., "partially": ... }, "predominant_occlusion": "clear" }, "predominant_mask": "missing" }, "mouth_attributes": { "occluded": ..., "opened": ..., "score": ..., "smile": ... } }, "quality": { "blurriness": ..., "dark": ..., "illumination": ..., "light": ..., "specularity": ... }, "warp": ... } } } ], "exif": {}, "filename": "raw image", "image_estimations": { "people": { "coordinates": ..., "count": ... } } } ] } 
 - Aiohttp session getter. Same for one BaseHTTPAPI instance. - Returns:
- initialised aiohttp session or None 
 
 - Create ws-connection to receive real time data from stream analytics - Parameters:
- streamId ( - str) – stream id
- analyticIndex ( - int) – analytics of interest index
- accountId ( - Optional[- str]) – account id to connect to
- login ( - Optional[- str]) – account login
- password ( - Optional[- str]) – account password
- token ( - Optional[- str]) – token
- asyncRequest ( - Optional[- bool]) – execution in asynchronous mode, disabled by default
- messageReceiveTimeout ( - Optional[- Real]) – message receive timeout (time between start waiting message and message appearance)
 
- Return type:
- Union[- _BaseRequestContextManager[- ClientWebSocketResponse],- contextmanager]
- Returns:
- context manager with connection to luna-video-manager 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.lunavl.mixins.doctests.config import ANALYTIC_NAME >>> from luna3.video_manager.http_objs import StreamAnalytic >>> response = client.createStream( ... streamType="videofile", ... reference="http://reference", ... name="test_stream", ... description="test stream description", ... analytics=[StreamAnalytic(name=ANALYTIC_NAME)], ... raiseError=True, ... ) >>> streamId = response.json["stream_id"] >>> with client.streamsWsConnect(streamId=streamId, messageReceiveTimeout=5) as ws: ... WS_RESP = json.loads(ws.recv()) >>> print(ws.status) 101 >>> print(json.dumps(WS_RESP, sort_keys=True, indent=4)) { "stream_status": "in_progress", "error": null, "analytics_results": { "crowd": { "track_id": ..., "event_id": ..., "people_count": ..., "time_offset": ..., "event_status": "started", "people_coordinates": ... } } } 
 - Test connection to current configured service. - Parameters:
- lunaRequestId ( - Optional[- str]) – External request id. Helps uniquely identifying messages, corresponding to particular requests, in system logs. Pattern: ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$
- asyncRequest (bool) – default mode for request async or blocking 
- raiseError ( - Optional[- bool]) – if request fails, LunaApiException is raised
- totalTimeout ( - Optional[- Real]) – request processing timeout in seconds.
- connectTimeout ( - Optional[- Real]) – connection timeout seconds.
- sockReadTimeout ( - Optional[- Real]) – socket read timeout
- sockConnectTimeout ( - Optional[- Real]) – socket connect timeout
- closeSession ( - bool) – whether to close session
 
- Return type:
- Union[- Awaitable[- bool],- bool]
- Returns:
- boolean status of establish connection 
 
 - Update a handler. You can not update a part of handler. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/putHandler - Parameters:
- handlerId ( - str) – handler id
- policies ( - Optional[- Policies]) – object with policies information
- handlerType ( - Optional[- int]) – handler type (0 - static, 1 - dynamic, 2 - lambda)
- description ( - Optional[- str]) – user description
 
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> handlerId = client.createHandler(handlerType=1, description="dynamic", raiseError=True).json['handler_id'] >>> response = client.updateHandler( ... handlerId=handlerId, handlerType=1, description="test_persons_3" ... ) >>> print(response.statusCode) 204 
 - Update lambda - Parameters:
- lambdaId ( - str) – lambda id
- archive ( - bytes) – archive file bytes
- lambdaName ( - str) – name of lambda
- description ( - Optional[- str]) – description
- lambdaType ( - Optional[- Literal[- 'standalone',- 'handlers',- 'tasks',- 'agent']]) – lambda type
- imageBuilder ( - Optional[- Literal[- 'kaniko',- 'buildah']]) – image builder type
- additionalUserDockerCommands ( - Optional[- List[- str]]) – additional user docker commands
- baseImageName ( - Optional[- str]) – base lambda image name
- baseImageTag ( - Optional[- str]) – base lambda image tag (for custom image)
- archiveTtl ( - Optional[- Literal[- -1,- 1,- 2,- 3,- 4,- 5,- 6,- 7,- 14,- 30,- 60,- 90,- 180,- 365]]) – ttl for lambda archive
- workers ( - Optional[- int]) – count of lambda workers
- enableGPU ( - Optional[- bool]) – whether to enable GPU
- podCount ( - Optional[- int]) – count of lambda pods
- cpuLimit ( - Optional[- int]) – cpu limit for lambda in cpu units
- ramLimit ( - Optional[- int]) – ram limit for lambda in GB
- cpuRequest ( - Optional[- int]) – cpu request for lambda in cpu units
- ramRequest ( - Optional[- int]) – ram request for lambda in GB
- namespace ( - Optional[- str]) – k8s namespace
- selector ( - Optional[- dict]) – kubernetes pod node selector
- imageName ( - Optional[- str]) – lambda image
- imageTag ( - Optional[- str]) – lambda image tag
- agentParameters ( - Optional[- AgentParameters]) – lambda agent paramters
- userConfig ( - Optional[- dict]) – lambda custom config
- shared ( - Optional[- int]) – whether lambda is shared
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with lambda_id will be returned. 
- Return type:
- class 
 - >>> from uuid import uuid4 >>> from time import sleep >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import LAMBDA_ARCHIVE >>> >>> def wait4start(lambdaId_: str): ... for _ in range(150): ... reply = client.getLambdaStatus(lambdaId_).json ... if reply["status"] == "running": ... break ... if reply["status"] == "terminated": ... raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId_}") ... sleep(1) ... else: ... raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId_}") ... >>> lambdaId = client.createLambda(archive=LAMBDA_ARCHIVE, lambdaName=str(uuid4())).json["lambda_id"] >>> wait4start(lambdaId) >>> newName = str(uuid4()) >>> response = client.updateLambda(lambdaId=lambdaId, lambdaName=newName, archive=LAMBDA_ARCHIVE) >>> print(response.statusCode) 200 
 - Update lambda using latest base image - Parameters:
- lambdaId ( - str) – lambda id
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with lambda_id will be returned. 
- Return type:
- class 
 - >>> from uuid import uuid4 >>> from time import sleep >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import LAMBDA_ARCHIVE >>> >>> def wait4start(lambdaId_: str): ... for _ in range(150): ... reply = client.getLambdaStatus(lambdaId_).json ... if reply["status"] == "running": ... break ... if reply["status"] == "terminated": ... raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId_}") ... sleep(1) ... else: ... raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId_}") >>> >>> lambdaId = client.createLambda(archive=LAMBDA_ARCHIVE, lambdaName=str(uuid4()), ... raiseError=True).json["lambda_id"] >>> wait4start(lambdaId) >>> response = client.updateLambdaImage(lambdaId=lambdaId) >>> print(response.statusCode) 200 
 - Update the list user_data - Parameters:
- listId ( - str) – list id
- userData ( - str) – user data associated with the list (<= 128 characters)
 
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> >>> listId = client.createList("strange_persons", raiseError=True).json["list_id"] >>> response = client.updateList(listId=listId, userData="test_data12_updated") >>> print(response.statusCode) 204 
 - Update settings. - Keyword Arguments:
- see Attributes 
 
 - Validate handler policies. - Parameters:
- policies ( - Policies) – object with policies information
- Returns:
- not contains response body. 
- Return type:
- LunaResponse 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.common.http_objs import DetectPolicy, ExtractPolicy, StoragePolicy, LinkToListPolicy >>> from luna3.common.http_objs import MatchPolicy, Filters, Policies, FacePolicy >>> from luna3.common.http_objs import MatchPolicyCandidates, ConditionalTagPolicy >>> >>> listId = client.createList("strange_persons", raiseError=True).json["list_id"] >>> policies = Policies( ... detectPolicy=DetectPolicy( ... estimateHeadPose=1, ... estimateEmotions=1, ... estimateGaze=1, ... extractExif=1, ... estimateLiveness=DetectPolicy.LivenessEstimationPolicy(1, 0.5, 0.5), ... estimateDeepfake=DetectPolicy.DeepfakeEstimationPolicy(1, 0.5, 2), ... rollThreshold=20, ... ), ... extractPolicy=ExtractPolicy(extractBasicAttributes=1, extractFaceDescriptor=1, fdScoreThreshold=0.7772), ... matchPolicy=[ ... MatchPolicy( ... candidates=MatchPolicyCandidates(origin="faces", listId=listId), ... label="test_faces", ... gender=1, ... ethnicities=[1, 2], ... limit=3, ... ) ... ], ... storagePolicy=StoragePolicy( ... facePolicy=FacePolicy( ... storeFace=1, ... filters=Filters(ageGte=18, ageLt=40), ... setSampleAsAvatar=1, ... linkToListsPolicy=[LinkToListPolicy(listId=listId)], ... ) ... ), ... conditionalTagsPolicy=[ConditionalTagPolicy(tag="test_tag")], ... ) >>> response = client.validateHandler(policies=policies) >>> print(response.statusCode) 204 
 - Validate lambda. - Parameters:
- archive ( - bytes) – archive file bytes
- lambdaType ( - Optional[- Literal[- 'standalone',- 'handlers',- 'tasks',- 'agent']]) – lambda type
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse json with lambda_id will be returned. 
- Return type:
- class 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from testData.resources import LAMBDA_ARCHIVE >>> >>> response = client.validateLambda(archive=LAMBDA_ARCHIVE, lambdaType="standalone") >>> print(response.statusCode) 204 
 - Verify account data. - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#operation/verifier - Parameters:
- accountId ( - Optional[- str]) – account id
- token ( - Optional[- str]) – account JWT token
- login ( - Optional[- str]) – account login
- password ( - Optional[- str]) – account password
 
- Returns:
- ~.LunaResponse or asyncio coroutine with LunaResponse. In body of :class: ~.LunaResponse 204 status code will be returned. 
- Return type:
- class 
 - >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from uuid import uuid4 >>> import json >>> >>> response = client.verifyAccount(login=client.login, password=client.password) >>> print(response.statusCode) 200 >>> print(response.json['account_type']) advanced_user 
 - Perform data verification against specified objects. Only one objects set is allowed. - Parameters:
- verifierId ( - str) – verifier id
- inputData ( - Union[- BinaryImage,- BinaryDescriptorData,- List[- Union[- BinaryImage,- BinaryDescriptorData]]]) – one of: - Single image - Single descriptor - List of images and descriptors
- faceIds ( - Optional[- List[- str]]) – faces ids to verify against
- eventIds ( - Optional[- List[- str]]) – event ids to verify against
- externalIds ( - Optional[- List[- str]]) – external ids to verify against
- attributeIds ( - Optional[- List[- str]]) – temporary attribute ids to verify against
- imageType ( - Optional[- int]) – image type (0 - raw image, 1 - face warped image)
- useExifInfo ( - Optional[- int]) – whether to use exif info for auto orientation
 
- Returns:
- body contains json with verifications info. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.common.http_objs import VerifierPolicies, VerifierAttributePolicy, VerifierDetectPolicy >>> from luna3.common.http_objs import VerifierExtractPolicy, VerifierStoragePolicy, VerifierFaceSamplePolicy >>> from testData.resources import FACE_WARP as image >>> >>> sampleId = client.detectFaces( ... inputData=image, raiseError=True ... ).json["images"][0]["detections"]["samples"][0]["face"]["sample_id"] >>> attributeId = client.extractAttrFromSample(sampleIds=[sampleId], raiseError=True).json[0]["attribute_id"] >>> faceId = client.createFace(attributeId=attributeId, raiseError=True).json["face_id"] >>> policies = VerifierPolicies( ... verificationThreshold=0.5, ... detectPolicy=VerifierDetectPolicy(estimateEmotions=1), ... extractPolicy=VerifierExtractPolicy(extractBasicAttributes=1), ... storagePolicy=VerifierStoragePolicy( ... faceSamplePolicy=VerifierFaceSamplePolicy(storeSample=1), ... attributePolicy=VerifierAttributePolicy(storeAttribute=1), ... ), ... ) >>> verifierId = client.createVerifier( ... description="test_verifier", policies=policies, raiseError=True).json["verifier_id"] >>> response = client.verifyData( ... verifierId=verifierId, faceIds=[faceId], inputData=image, imageType=1, useExifInfo=1 ... ) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "images": [ { "detections": { "face_detections": [ { "face_attributes": { "attribute_id": ..., "basic_attributes": { "age": ..., "ethnicities": { "estimations": { "african_american": ..., "asian": ..., "caucasian": ..., "indian": ... }, "predominant_ethnicity": "caucasian" }, "gender": 0 }, "samples": [...], "score": ..., "url": "/6/attributes/..." }, "sample": { "face": { "attributes": { "emotions": { "estimations": { "anger": ..., "disgust": ..., "fear": ..., "happiness": ..., "neutral": ..., "sadness": ..., "surprise": ... }, "predominant_emotion": "neutral" } }, "sample_id": ..., "url": "/6/samples/faces/..." } }, "verifications": [ { "face": { "face_id": ... }, "similarity": ..., "status": true } ] } ], "filtered_detections": { "face_detections": [] } }, "error": { "desc": "Success", "detail": "Success", "error_code": 0, "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-0" }, "filename": "raw_image", "status": 1 } ] } 
 - Verify raw API allows to match each candidate with each reference descriptors. - Parameters:
- verifierId ( - str) – verifier id
- candidates ( - List[- BinaryReference]) – list of BinaryReference objects for candidates
- references ( - List[- BinaryReference]) – list of BinaryReference objects for references verifierId: verifier id
 
- Returns:
- body contains json with results of matching. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.common.http_objs import VerifierPolicies, VerifierAttributePolicy, VerifierDetectPolicy >>> from luna3.common.http_objs import VerifierExtractPolicy, VerifierStoragePolicy, VerifierFaceSamplePolicy >>> from luna3.python_matcher.match_objects import RawDescriptorReference, RawDescriptor >>> from testData.resources import DESCRIPTOR >>> >>> policies = VerifierPolicies( ... verificationThreshold=0.5, ... detectPolicy=VerifierDetectPolicy(estimateEmotions=1), ... extractPolicy=VerifierExtractPolicy(extractBasicAttributes=1), ... storagePolicy=VerifierStoragePolicy( ... faceSamplePolicy=VerifierFaceSamplePolicy(storeSample=1), ... attributePolicy=VerifierAttributePolicy(storeAttribute=1), ... ), ... ) >>> verifierId = client.createVerifier( ... description="test_verifier", policies=policies, raiseError=True ... ).json["verifier_id"] >>> candidate = RawDescriptorReference(referenceId="candidate_id", descriptor=DESCRIPTOR) >>> reference = RawDescriptorReference(referenceId="reference_id", descriptor=DESCRIPTOR) >>> response = client.verifyRaw( ... verifierId=verifierId, candidates=[candidate], references=[reference] ... ) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "matches": [ { "matches": [ { "candidate_id": "candidate_id", "similarity": 1.0, "status": true } ], "reference_id": "reference_id" } ] } 
 - Property get version uri - >>> self.versionUri "http://127.0.0.1:5030/version" 
 - Process video - Parameters:
- inputData ( - VideoSDKInput) – video properties including url and analytics params
- Returns:
- body contains json with analytics results errors for failed images. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.public.sdk import VideoSDKInput, VideoSDKAnalytics, VideoSDKProperties >>> from luna3.public.sdk import PeopleCountAnalyticsParams, Rate >>> url ="https://lunatestttttt.s3.eu-central-1.amazonaws.com/video_test.avi" >>> params = PeopleCountAnalyticsParams(rate=Rate(unit="second", period=1), probeCount=2) >>> analytics = [VideoSDKAnalytics(name="people_count", targets=[], parameters=params)] >>> response = client.videosdk(inputData=VideoSDKInput(VideoSDKProperties(url), analytics)) >>> print(response.statusCode) 200 >>> print(json.dumps(response.json, sort_keys=True, indent=4)) { "analytics": [ { "name": "people_count", "result": { "crowd": { "events": [ { "event_id": ..., "frames_estimations": [ { "people_count": ..., "time_offset": ... }, { "people_count": ..., "time_offset": ... }, { "people_count": ..., "time_offset": ... }, { "people_count": ..., "time_offset": ... } ], "people_count": 2, "track_id": ..., "video_segment": { "end_time_offset": ..., "start_time_offset": 1.0 } } ] } } } ], "video_data": { "duration": 5.0, "error_count": 0, "frame_rate": 24.0, "frames_count": 120, "processed_parts": [ { "end_offset": ..., "start_offset": 0 } ], "rotation": ... } } 
 - Create ws-connection to luna-sender - See https://docs.visionlabs.ai/luna/latest/ReferenceManuals/APIReferenceManual.html#tag/ws - Parameters:
- accountId ( - Optional[- str]) – account id to connect to
- login ( - Optional[- str]) – account login
- password ( - Optional[- str]) – account password
- token ( - Optional[- str]) – token
- ageLt ( - Optional[- int]) – [ 0 .. 100 ] - upper bound for reference age
- ageGte ( - Optional[- int]) – [ 0 .. 100 ] - lower including bound for reference age
- gender ( - Optional[- int]) – Gender. 1 - male, 0 - female
- ethnicGroups ( - Optional[- List[- int]]) – Array of integer (ethnicities_filter) - Items Enum:1 2 3 4 ( AfricanAmerican - 1; Indian - 2; Asian - 3; Caucasian - 4)
- tags ( - Optional[- List[- str]]) – users tags
- objectSimilarityLt ( - Optional[- float]) – upper excluding similarity boundary
- objectSimilarityGte ( - Optional[- float]) – lower including similarity boundary
- sources ( - Optional[- List[- str]]) – list of source
- streamIds ( - Optional[- List[- str]]) – list of stream ids
- matchingCandidatesLabels ( - Optional[- List[- str]]) – matching candidate label list
- userData ( - Optional[- str]) – event user data
- geoPosition ( - Union[- GeoBbox,- str,- None]) – geo position bbox filter specified by coordinates of its center (origin) and some delta
- cities ( - Optional[- List[- str]]) – list of cities
- areas ( - Optional[- List[- str]]) – list of areas
- districts ( - Optional[- List[- str]]) – list of districts
- streets ( - Optional[- List[- str]]) – list of streets
- houseNumbers ( - Optional[- List[- str]]) – list of house numbers
- handlerIds ( - Optional[- List[- str]]) – handler ids
- liveness ( - Optional[- List[- int]]) – allowed liveness states: 0 - spoof, 1 - real, 2 - fake
- deepfake ( - Optional[- List[- int]]) – allowed deepfake states: 0 - fake, 1 - real
- masks ( - Optional[- List[- int]]) – Array of integer (masks) - Items Enum: 1, 2, 3 (1 - missing, 2 - medical mask, 3 - occluded)
- emotions ( - Optional[- List[- int]]) – Array of integer (emotions) - Items Enum: 1, 2, 3, 4, 5, 6, 7 ( 1 - anger, 2 - disgust, 3 - fear, 4 - happiness, 5 - neutral, 6 - sadness, 7 - surprise)
- apparentGender ( - Optional[- List[- Literal[- 0,- 1,- 2]]]) – apparent gender (body) of event (0, 1, 2) - means (female, male, undefined)
- apparentAgeLt ( - Optional[- int]) – upper excluding apparent age boundary (body)
- apparentAgeGte ( - Optional[- int]) – lower including apparent age boundary (body)
- backpackStates ( - Optional[- List[- Literal[- 0,- 1,- 2]]]) – interest backpack states list ((0, 1, 2) - means (no, yes, unknown)
- headwearStates ( - Optional[- List[- Literal[- 0,- 1,- 2]]]) – interest headwear states list ((0, 1, 2) - means (no, yes, unknown)
- upperClothingColors ( - Optional[- List[- Literal[- 'black',- 'blue',- 'green',- 'gray',- 'orange',- 'purple',- 'red',- 'white',- 'yellow',- 'pink',- 'brown',- 'beige',- 'khaki',- 'multicolored',- 'undefined']]]) – interest upper clothing colors list
- sleeveLengths ( - Optional[- List[- Literal[- 'short',- 'long',- 'undefined']]]) – interest sleeve length list (short, long, undefined)
- asyncRequest ( - Optional[- bool]) – execution in asynchronous mode, disabled by default
- messageReceiveTimeout ( - Optional[- Real]) – message receive timeout (time between start waiting message and message appearance)
 
- Returns:
- body contains json with event info. 
- Return type:
- LunaResponse 
 - >>> import json >>> from luna3.lunavl.mixins.doctests.config import TEST_CLIENT as client >>> from luna3.common.http_objs import DetectPolicy, ExtractPolicy, NotificationPolicy >>> from luna3.common.http_objs import MatchPolicy, Policies, Filters, StoragePolicy >>> from luna3.common.http_objs import MatchPolicyCandidates >>> from testData.resources import FACE_WARP as image >>> >>> listId = client.createList(userData="happy_persons", raiseError=True).json["list_id"] >>> policies = Policies( ... detectPolicy=DetectPolicy(detectFace=1), ... extractPolicy=ExtractPolicy(extractBasicAttributes=1, fdScoreThreshold=0.0,), ... matchPolicy=[ ... MatchPolicy( ... candidates=MatchPolicyCandidates(origin="faces", listId=listId), ... label="happy", ... limit=3, ... threshold=0.5, ... gender=0, ... ) ... ], ... storagePolicy=StoragePolicy(notificationPolicy=NotificationPolicy(sendNotification=1, ... filters=Filters(gender=0)))) >>> handler = client.createHandler(description="test_handler_notification", policies=policies, raiseError=True) >>> with client.wsConnect(messageReceiveTimeout=5) as ws: ... event = client.emitEvents( ... handlerId=handler.json["handler_id"], ... inputData=[image], ... tags="notify_tag", ... imageType=1, ... useExifInfo=1, ... raiseError=True, ... meta={"foo": "bar"}, ... ) ... WS_RESP = json.loads(ws.recv()) >>> print(ws.status) 101 >>> print(json.dumps(WS_RESP, sort_keys=True, indent=4)) { "Luna-Request-id": ..., "event": { "aggregate_estimations": { "body": { "attributes": {} }, "face": { "attributes": {} } }, "body_attributes": null, "detections": [ { "detect_time": ..., "detect_ts": null, "filename": "Claudia_Schiffer_warp.jpg", "image_origin": null, "samples": { "body": null, "face": { "detection": {}, "sample_id": ..., "url": "/6/samples/faces/..." } } } ], "event_id": ..., "external_id": "", "face": null, "face_attributes": { "attribute_id": null, "basic_attributes": { "age": ..., "ethnicities": { "estimations": { "african_american": ..., "asian": ..., "caucasian": ..., "indian": ... }, "predominant_ethnicity": "caucasian" }, "gender": ... }, "samples": [...], "score": ..., "url": null }, "location": {}, "matches": [ { "candidates": [], "label": "happy" } ], "meta": { "foo": "bar" }, "source": null, "stream_id": null, "tags": [ "notify_tag" ], "track_id": null, "url": "/6/events/...", "user_data": "" }, "event-create-time": ..., "event-end-time": ..., "handler_id": ... }