Sequence diagrams#
This chapter describes the general requests to LP and shows interactions between services during the request processing.
More information about the requests can be found in the "APIReferenceManual.html" document.
Samples creation diagrams#
Sample creation diagram#
The request enables detecting the faces in input photos. The photos can be sent in standard image formats (JPEG, PNG, etc.) or in the BASE64 format.
See the "detect faces" request in "../ReferenceManuals/APIReferenceManual.html" for details.
Request | Description | Type |
---|---|---|
detect faces | The request enables to detect faces in incoming images, estimate face parameters, extract samples and save them in Image Store. | POST |
The request result contains the parameters of the detected faces and the IDs for all the created samples.
The general request processing scheme:
- The face detection request is sent to API;
- API receives the request, processes it and sends the task to the Handlers service;
- The Handler processes the task according to the specified parameters;
- The Handler sends received samples to Image Store;
- Image Store saves the samples to the storage;
- The storage returns the result of sample saving;
- Image Store returns the samples IDs and URLs;
- The Handler sends the samples IDs and the received face parameters to the API service;
- API generates and sends the response.
Get information about samples and save samples#
The following request adds external samples to Image Store.
See the "save samples" request in "../ReferenceManuals/APIReferenceManual.html" for details.
Request | Description | Type |
---|---|---|
save sample | The external sample is saved in Image Store | POST |
The following requests enables to manage the already existing samples.
See the "samples" section in "../ReferenceManuals/APIReferenceManual.html" for details.
Request | Description | Type |
---|---|---|
get sample | Receive a sample by its ID | GET |
remove sample | Delete a sample by its ID | DEL |
check to exist sample | Check existence of the sample with the specified ID | HEAD |
All the requests above are processed by the Image Store service.
The requests processing scheme:
- A request is sent to the API service;
- API sends the request to Image Store;
- Image Store performs the required actions with the storage;
- The storage returns the required data;
- Image Store returns the result to API;
- API generates and sends the response.
More information about the requests can be found in the "APIReferenceManual.html" document in the "Samples" section.
Attributes diagrams#
Temporary attributes extraction diagram#
Handler receives samples from Image Store and extracts information from them.
See the "extract attributes" request in "../ReferenceManuals/APIReferenceManual.html" for details.
You should specify the array of sample IDs.
Request | Description | TYPE |
---|---|---|
extract attributes | Extracts the following attributes: descriptors and basic attributes (age, gender, ethnicity) | POST |
The general request processing scheme:
- The extraction request is sent to API;
- API receives the request, processes it and sends the request to the Handlers service;
- The Handlers service requests samples from Image Store;
- Image Store requests the samples from the storage;
- The storage sends samples;
- Image Store sends the samples to the Handlers service;
- The Handlers service processes the task according to the specified parameters;
- The Handlers service sends descriptors and basic attributes to the Faces service;
- The Faces service sends requests to store temporary attributes in the Redis database;
- Redis database sends the response to Faces;
- Faces sends the response to the Handlers service;
- The Handlers service sends received attribute IDs, basic attributes, attribute URLs, filtering results and GS score to the API service;
- API sends the response.
Diagram of attribute creation using external data#
The diagram shows attributes creation using data from an external database.
See the "attributes" section in "APIReferenceManual.html" for details.
Request | Description | TYPE |
---|---|---|
create temporary attribute | New temporary attributes creation. | POST |
-
The request for adding new attributes (descriptors and/or basic attributes) is sent to the API service. All the required data for attributes creation is sent with the request. Optional. The request to the Image Store service is sent when samples were provided with descriptors and/or attributes;
-
The API service sends the request to the Image Store service to save the received samples;
-
Image Store requests the samples from the storage;
-
The storage sends samples;
-
Image Store sends the samples to the API service;
-
The API service sends descriptors and basic attributes to the Faces service;
-
The Faces service sends requests to store temporary attributes in the Redis database;
-
Redis database sends the response to Faces;
-
Faces sends the response to the API service;
-
The API service sends response.
Attributes information diagrams#
The following requests enable you to receive data about the already existing attributes or delete them.
Request | Description | Type |
---|---|---|
get temporary attributes | Receive all attribute IDs and their creation time according to the targets | GET |
get temporary attribute | Receive the temporary attribute information by ID | GET |
check temporary attribute | Check existence of an attribute by its ID | HEAD |
delete attributes | Delete the attribute with the specified ID | DEL |
get temporary attribute samples | Get all the temporary attribute samples by the attribute ID | GET |
The general request processing scheme:
-
A request is sent to the API service;
-
API sends the request to the Faces service;
-
Faces service sends the request to the Redis database to receive information about temporary attributes;
-
The Redis database returns requested information;
-
The Faces service returns the result;
-
The API service returns the information to the user. If the TTL of the attribute has expired, an error is returned.
Faces and lists diagrams#
All the requests in this section are processed by the Faces service.
See the "faces" section in "APIReferenceManual.html" for details.
Face creation diagram#
Request | Description | Type |
---|---|---|
create face | Create a new face with the specified attribute ID, user's data, avatar and lists | POST |
The general request processing scheme:
-
A request is sent to the API service;
-
API sends the request to the Faces service;
-
Faces service sends the request to the Redis database to receive temporary attributes. Optional. The request to the Redis DB is not sent if there are external attributes specified for the face or when there are no attributes set for the face.;
-
The Redis database returns requested information;
-
The Faces service returns the result;
-
The Faces service sends the request to the Faces database to create a new face using the specified data;
-
The Faces database saves the data;
-
The Faces service returns the information about the created face;
-
The API service returns the information to the user.
Faces and Lists information and management#
All the following requests have similar sequence diagrams.
The following requests enable you to create faces, receive data about the already existing faces or delete them.
Request | Description | Type |
---|---|---|
get faces | Get the array of all the existing faces and their data: face ID, external ID, user's data, create time, avatar, account ID, and lists to which the Face is attached | GET |
delete faces | Delete several faces by IDs | DEL |
get face count | Receive the number of existing faces according to the specified filter | GET |
get count of faces with attributes | Count of faces with attributes | GET |
get face | Receive data of the face (face ID, external ID, user's data, create time, avatar, account ID, and lists to which the face is attached) that corresponds to the specified ID | GET |
patch face | Update a Face using the specified data: user's data, event ID, external ID, avatar | PATCH |
remove face | Delete the specified face | DEL |
check to exist a face | Check existence of the face by its ID | HEAD |
put face attribute | Put face attribute, changing all the attribute data corresponding to the specified face | PUT |
get face attribute | Receive attributes of the specified face: gender, age, ethnicity, create time | GET |
delete face attribute | Remove face attribute by ID | DEL |
get face attribute samples | Receive information about samples (sample ID) that correspond to the specified face | GET |
The following requests enable you to create lists and receive data about the already existing lists or delete them.
Request | Description | Type |
---|---|---|
create list | Create a new empty list. You can specify user data for it | POST |
get lists | Receive the array of all existing lists with the following data: list ID, user data, account ID, creation time, last update time | GET |
delete lists | Delete several lists by IDs | DEL |
get list count | Get number of the existing lists | GET |
get list | Receive information (list ID, user data, account ID, creation time, last update time) about the list by the specified ID | GET |
check list existence | Check existence of the list with the specified ID | HEAD |
update list | Update the user_data field of the list | PATCH |
delete list | Delete the list with the specified ID | DEL |
attach/detach faces to the list | Update the list by attaching or detaching the specified faces from it | PATCH |
The following diagram represents workflow for all the listed above requests to Faces.
The general request processing scheme:
- A request is sent to the API service;
- API sends the request to the Faces service;
- The Faces service sends the request to the Faces database to receive information or manage the existing data;
- The Faces database returns requested information or information about database changes;
- The Faces service returns the result;
- The API service returns the result to the user.
Matcher diagrams#
You should specify references and candidates for matching. You can limit the number of candidates with the highest similarity value.
Request | Description | Type |
---|---|---|
matcher/faces | Matcher compares given references with the given candidates. As a result, matcher returns similarity level for each of the candidates and additional information about candidates | POST |
human body matching | Allows to submit tasks to a service that searches for human bodies similar to a given reference(s) by matching them | POST |
raw matching | Allows to do similarity calculations for input descriptors | POST |
See the "matching faces", "human body matching" and "raw matching" sections in "APIReferenceManual.html" for details.
Matching using Python Matcher#
Matching by DB#
The example of matching events (references) with faces (candidates) is given below.
- The matching request is sent to the API service;
- The API service sends the request to the Python Matcher service;
- The Python Matcher service requests references from the Events database;
- The Events database returns the data;
- The Python Matcher service sends the requests for matching by the Faces database;
- The matching is performed;
- The Faces database returns the matching results;
- The Python Matcher service requests additional data for candidates;
- The Faces database returns the data;
- The Python Matcher service returns results to the API service;
- The API service sends the response.
Matching by list#
The example of matching faces (references) with the list of faces (candidate) is given below.
- The matching request is sent to the API service;
- The API service sends the request to the Python Matcher service;
- The Python Matcher service requests references from the Faces database;
- The Faces database returns the data;
- The matching is performed in The Python Matcher service. The cached descriptors are used;
- The Python Matcher service requests additional data for candidates;
- The Faces database returns the data;
- The Python Matcher service returns results to the API service;
- The API service sends the response.
Handlers diagrams#
Handler management requests#
A handler defines the logic for input image processing. You should specify a handler when a new event is created.
The following requests are related to the handler.
Request | Description | Type |
---|---|---|
create handler | Create handler | POST |
get handlers | Get handlers according to the specified filters | GET |
get handler count | Receive number of existing handlers | GET |
get handler | Receive handler policies by the handler ID | GET |
replace handler | Update fields of a handler. You should specify the handler ID. You should fill in all the required policies in the request body. Update of individual parameters of a handler is not allowed | PUT |
check to exist a handler | Check if the handler with the specified ID exists | HEAD |
remove handler | Remove a handler by ID | DEL |
The general scheme of handler creation is shown in the figure below. All the handler requests have similar sequence diagrams.
- A request for a new handler creation is sent from the API service to the Handlers service;
- The Handlers service processes the request and creates a handler;
- The Handlers service stores the handler to API database;
- The Handlers service database returns result;
- The Handlers service service returns the ID of the created handler.
The handler is used upon Event creation and its usage example is described in the "Events" section. All the results are stored in the Events database.
Events diagrams#
Event creation general diagram#
Event is created after an image is processed according to a handler.
Request | Description | Service |
---|---|---|
generate events | Create an event. You should specify the required handler ID or set dynamiic handler policies and specify images for processing. You can set additional parameters and data for the created event. | POST |
The sequence diagram for a new event creation will differ depending on the specified handler policies.
The sequence diagram below shows the general process of new event creation and includes only general entry points for the execution of policies.
- The API service sends the request for new Event creation to the Handlers service;
- The Handlers service receives the corresponding handler from the Handlers database;
- The Handlers database sends the handler to the Handlers service. The handler is processed policy after policy;
- The "detect_policy" is processed by the Handlers service. The received samples are stored in RAM;
- The "extract_policy" is processed by the Handlers service. The received attributes are stored in RAM;
-
The "match_policy" is processed according to the provided filters. Descriptors received during the "extract_policy" execution are provided as references for matching. There can be several ways for matching execution:
- Faces are set as matching candidates. The matching will be performed using the Faces DB.
- Events are set as matching candidates. The matching will be performed using the Events DB.
- Faces are set as matching candidates and list of faces is set in filters. The matching will be performed using the Matcher service.
-
The "storage_policy" is processed according to the specified data:
- Samples are stored to the Image Store service;
- Faces are created and stored in the Faces database by the Faces service. They also can be linked to lists;
- Attributes are created and stored in the Redis database by the Faces service;
- Events are stored to the Events database by the Events service;
-
The "conditional_tags_policy" is processed by the Handler service;
- The Handlers service returns results to the API service;
- The Handlers service sends the results to Events;
- The Events service creates a new event and stores it in the Events database;
- The Events database sends response;
- The Events service sends response to the Handlers service.
Get statistics on events and events information#
Policy | Description | Service |
---|---|---|
get statistics on events | Receive statistics on Events. The target group enables to aggregate events according to the specified aggregators: number of items, max or min value, average value, grouping. You can also apply filters and periods to select events that should be aggregated. Grouping by frequency or grouping by time intervals is available. | POST |
get events | Receive all events that satisfy the specified filters. In the filters you can set values of one or several event fields. The target parameter enables to select fields that you want to receive in response. You can left the target field of the request empty. In this case all data about the events will be shown. You may also set sorting parameters, number of events on page and number of pages. If the create_time__gte is not set, it is set to one month by default |
GET |
get event | Receive all fields for the event. You should specify event_id for the request. | GET |
check event existence | Check existence of the specified event. You should specify event_id for the request. | HEAD |
The sequence diagram describes the request processing.
- API receives request to Events;
- API sends the request to Events;
- Events receives the required data from the database;
- The database returns result;
- Events returns results;
- API returns results.
Tasks diagrams#
There are several requests for different long tasks creation.
Each of the requests begins with a new task creation in the database. API returns the created task ID and does not wait until the end of the task. You can use the task ID in the corresponding request to receive information about the task processing.
Task creation diagram is shown below.
-
API service receives a task creation request;
-
API service sends the request to Tasks service;
-
Tasks service creates a new task, subtasks and stores them in the database;
-
The result of the task creation and its ID is sent as a response. According to the task type, the following Tasks service actions may differ. In the general case, Tasks creates subtasks and sends them to the Tasks workers;
-
Tasks sends subtasks to workers;
-
Tasks workers send response.
You will receive a task ID as a response.
{
"task_id": 123
}
You should use the task ID to receive the report with the task result and perform other actions with the task. The corresponding requests are listed in "General information about Tasks" section.
Clustering task diagrams#
Request | Description | Method |
---|---|---|
clustering task | Creates the task for clustering Faces or Events according to the specified filters. | POST |
Clustering task processing#
After a corresponding task was created (see Tasks Diagrams), Tasks worker starts its processing.
Only faces or events that have already created descriptors will be processed.
A single subtask is created for this task type. Subtask contains filters according to which faces or events are selected. The subtask is processed by a single worker.
Clustering task processing depends on the objects (faces or events) specified in the request.
-
Faces: Tasks worker sends the request to Faces service. Tasks worker requests all the required attribute IDs according to the filters specified in the subtask;
-
Faces sends the request to Faces database;
-
Faces database returns IDs;
-
Faces sends IDs to Tasks worker;
-
Events: Tasks worker sends the request to Events service. Tasks worker requests all the required attribute IDs according to the filters specified in the subtask;
-
Event service sends a request to the database to receive data;
-
The database sends the required data;
-
Events sends data to the Tasks worker;
-
The Tasks worker matching request. The requests is processed according to one of the schemes described in section "Matching diagrams";
-
The Python Matcher service sends the results.
End of clustering task#
After Tasks worker ends subtask processing, it performs the following actions.
- The Tasks service sends the created cluster to Image Store;
- Image store sends cluster to the storage;
- The storage returns result;
- Image Store sends the result to the Tasks service;
- The Tasks worker updates the status of the task in the Tasks database;
- The Tasks database sends the result to the Tasks worker.
Linker task diagrams#
Request | Description | Method |
---|---|---|
linker task | The request enables you to create a linker task. | POST |
Linker task creation#
The linker task can be created for faces and events objects. Linker task creation process depends on the object type.
Attach faces to list
- API service receives the request for creation of a new linker task;
- Tasks service receives the request;
- Tasks service creates a new linker task in the Tasks database;
- Tasks database returns the task ID;
- The task ID is sent to the API service;
- API service sends the task ID as a response;
- Optional. If you have specified a list ID in the request, Tasks service checks the existence of the list;
- Optional. Faces service checks the list existence in the Faces database;
- Optional. The Faces database sends response;
- Optional. The Faces service sends response to the Tasks service;
- Optional. If the specified list does not exist or you have specified new list creation in the request, the Tasks service sends request for new list creation;
- Optional. Faces creates the list in the Faces database;
- Optional. The Faces database sends response;
- Optional. The Faces service sends the response to the Tasks service.
- The Tasks service creates subtasks for Tasks workers in the Tasks database;
- The database sends response on the subtasks creation;
- The Tasks service sends subtasks to Tasks workers;
- Tasks workers send responses.
Attach faces created from events to list
-
API service receives the request to create a new linker task;
-
Tasks service receives the request;
-
Tasks service creates a new linker task in the Tasks database;
-
Tasks database returns the task ID;
-
The task ID is sent to API;
-
API sends the task ID as a response;
-
Optional. If you specified a list ID in the request, Tasks service checks the existence of the list;
-
Optional. Faces service checks the list existence in the Faces database;
-
Optional. Faces database sends response;
-
Optional. Faces service sends the response to Tasks;
-
Optional. If the list does not exist or you have specified to create a new list in the request, Tasks sends the request to create a new list;
-
Optional. Faces creates the list in the Faces database;
-
Optional. Faces database sends response;
-
Optional. Faces service sends the response to Tasks;
-
Tasks receives face IDs and attribute IDs from Events;
-
Events receives the data from Events database;
-
The database sends response;
-
Faces sends the IDs to Tasks service;
-
Tasks service checks the existence of faces in Faces;
-
Faces service sends the request to the Faces database;
-
Faces database sends information about faces existence;
-
Faces service sends the data to Tasks service;
-
Faces exist in Faces database If the face for an event exits, Tasks checks that the attribute ID of the face is similar to the attribute ID of the event;
-
Faces sends a request to the Faces database;
-
The Faces database send attribute IDs;
-
Faces sends attribute IDs to Tasks service. If the attribute IDs for the existing face and event are not equal, the "28009: Attribute is not equal" error will be returned;
-
Faces do not exist in Faces database If there are no faces with the specified IDs in Faces database, Tasks service sends the request to create new faces in Faces database;
-
Faces sends the request to the Faces database;
-
The Faces database sends results of face creation;
-
Faces sends the response to Tasks service;
-
Tasks creates subtasks for Tasks workers in the Tasks database;
-
The database sends response on the subtasks creation;
-
Tasks sends subtasks to Tasks workers;
-
Tasks workers send responses.
Linker subtask processing#
Linker task processing is shown in the diagram below. There can be several workers used for task execution.
- The Tasks worker requests faces in Faces service according to the received face IDs;
- Faces service requests faces in the Faces database;
- The database sends faces to Faces;
- Faces sends faces to the Tasks worker;
- Tasks worker sends requests for attaching faces to the specified list;
- Faces service sends requests for attaching to the database;
- The database sends the result of attaching to Faces;
- Faces sends the result to the Tasks worker;
- The Tasks worker generates a report on the basis of the subtask results and stores it in Image Store;
- Image Store stores report in the storage;
- The storage sends result of storage. The result has its result ID;
- Image Store returns the result to the Tasks worker.
Linker task report generation#
- The Tasks worker combines all the reports corresponding to the same task into a single report and sends it to Image Store;
- Image Store sends the report to the storage;
- The storage sends the response;
- Image Store sends the result of the report saving to the Tasks worker;
- Tasks worker sends the request to update the task status in Tasks database;
- Tasks database sends the response.
Garbage collection task diagrams#
Request | Description | Method |
---|---|---|
garbage collection task | A task for deleting attributes according to the specified creation time filter. Only attributes that are not attached to any face are deleted. The task allows to delete unused data from Faces database. | POST |
Garbage collection task creation#
The garbage collection task can be requested by a user using API or by the administrator using the Admin service.
- The administrator sends a request to the Admin service;
- Admin service sends a request to the Tasks service;
- Tasks creates a new task and subtasks in the Tasks database;
- Tasks database sends response;
- Tasks sends the created task ID to the Admin service;
- The Admin service returns the task ID to the administrator;
- The Tasks service sends subtasks to Tasks workers. Each subtask includes the range of attribute IDs and time filter;
- Tasks workers receive subtasks and send the response.
Garbage collection task processing#
After a corresponding task was created, Tasks worker starts its processing.
Several subtasks are created for this task type. Each of the subtasks contains the range of attribute IDs.
- Tasks worker has a range of the attribute IDs that should be deleted. Tasks worker requests deletion of temporary attributes and corresponding descriptors in Faces service;
- Faces service sends the request to Faces database to delete attributes with the specified IDs;
- The database sends results of deletion;
- Faces sends the response to the Tasks worker;
- The Tasks worker stores report in Image Store;
- Image Store sends report to the storage;
- The storage sends information about storage results to Image Store;
- Image Store sends the result to the Tasks worker;
- The Tasks worker updates status of the task in the Tasks database.
Reporter task diagram#
Request | Description | Method |
---|---|---|
reporter task | Create a report for a complete clustering task. The report is in the CSV format. You can specify the columns that should be added to the report. The report is in a zip archive and includes avatar images for each of the objects in a cluster. | POST |
Reporter task processing#
After a corresponding task was created (see Tasks Diagrams), the Tasks Worker starts its processing. A single subtask is created for this task type. The subtask includes filters for the data that should be obtained for inclusion into the report.
Request processing depends on the data, stored in the clustering report. If the report was created for faces, face data will be requested from the Faces service and added to the report. If the report was created for events, event data will be requested from the Events service and added to the report.
-
The Tasks worker requests a clustering report in Image Store;
-
Image Store requests the report from the storage;
-
The storage sends the report;
-
Image Store sends the report;
-
Report for faces. The Tasks worker receives all the face IDs from the cluster and requests additional face data from the Faces service. The requested data depends on the columns specified in the request;
-
The Faces service requests data from the Faces database;
-
The Faces database sends the required data;
-
The Faces service sends the data to the Tasks worker;
-
Report for events. The Tasks worker requests additional event data from the Events service. The requested data depends on the columns specified in the request;
-
The Events service requests data from the Events database;
-
The Events database sends the required data;
-
The Events service sends the data to the Tasks worker;
-
Tasks worker requests the avatar image for each of the faces or events. The image for a face is specified in the "avatar" field of the Faces database. It can be stored in the Image Store storage or any other storage. The image for the event is the corresponding sample from the Image Store storage;
-
Image Store requests the image from the storage;
-
The storage sends the image;
-
Image Store sends the image;
-
Tasks worker sends report to Image Store;
-
Image Store saves the report in the storage;
-
Storage sends response about saving;
-
Image Store sends response to the Tasks worker;
-
The Tasks worker updates task status in the Tasks database;
-
The Tasks database sends response.
Exporter task diagram#
Request | Description | Method |
---|---|---|
exporter task | Collects event/face data and exports them to a CSV file. The exported CSV file is in a zip archive and includes avatar images for each of the objects. | POST |
Exporter task processing#
After a corresponding task was created (see Tasks Diagrams), the Tasks Worker starts its processing.
-
Export data for faces. The Tasks worker receives all the face IDs and requests additional face data from the Faces service. The requested data depends on the columns specified in the request;
-
The Faces service requests data from the Faces database;
-
The Faces database sends the required data;
-
The Faces service sends the data to the Tasks worker;
-
Export data for events. The Tasks worker requests additional event data from the Events service. The requested data depends on the columns specified in the request;
-
The Events service requests data from the Events database;
-
The Events database sends the required data;
-
The Events service sends the data to the Tasks worker;
-
Tasks worker requests the avatar image for each of the faces or events. The image for a face is specified in the "avatar" field of the Faces database. It can be stored in the Image Store storage or any other storage. The image for the event is the corresponding sample from the Image Store storage;
-
Image Store requests the image from the storage;
-
The storage sends the image;
-
Image Store sends the image;
-
Tasks worker sends exported data to Image Store;
-
Image Store saves the exported data in the storage;
-
Storage sends response about saving;
-
Image Store sends response to the Tasks worker;
-
The Tasks worker updates task status in the Tasks database;
-
The Tasks database sends response.
Cross-matching task diagrams#
Request | Description | Method |
---|---|---|
cross-matching task | The task enables to match events and faces according to the specified filters. Faces and events can be set as references and as candidates. Additional filters can be specified for both references and candidates. | POST |
Cross-matching subtask processing#
After a corresponding task was created (see Tasks Diagrams), the Tasks worker starts its processing.
A single subtask is created for this task type. The subtask includes all the required reference and candidate filters.
Cross-matching subtask execution may vary depending on the specified references and candidates.
They can be specified using faces and/or events. In the diagrams below, requests to Faces and Events services are marked as alternative. The requests to Faces service are used when faces are set as references or candidates. The requests to Events service are used when events are set as references or candidates.
Cross-matching task processing depends on the objects selected (events or faces).
-
Faces are set as references or candidates. Tasks worker sends the request to the Faces service to receive attribute IDs for faces. Faces are selected according to the specified filters;
-
Faces requests IDs in the Faces database;
-
The Faces database sends attribute IDs;
-
The Faces service sends the attribute IDs to the Tasks worker;
-
Events are set as references or candidates. The Tasks worker sends the request to the Events service to receive attribute IDs for events. Events are selected according to the specified filters;
-
Events requests event IDs in the Events database;
-
The database sends the IDs;
-
Events service sends the IDs to the Tasks worker;
-
The Tasks worker matching request. The requests is processed according to one of the schemes described in section "Matching diagrams";
-
The Python Matcher service sends the results.
Cross-matching task end#
- The Tasks worker generates a report based on the subtask results and stores it in Image Store;
- Image Store saves the report in the storage;
- The storage sends the result to Image Store;
- Image Store returns the result to the Tasks worker;
- The Tasks worker sends the request to update the task status in the Tasks database;
- The Tasks database sends the response.
Estimator task diagram#
Request | Description | Method |
---|---|---|
estimator task | Create an Estimator task. With this task, you can perform batch image processing with the specified policies. | POST |
Estimator task processing#
After a corresponding task was created (see Tasks Diagrams), the Tasks worker starts its processing.
-
The Tasks worker requests a batch of images from the following locations:
-
from the Image Store service in a ZIP archive if the "zip" type is selected as the image source.
- from the S3 storage if the "s3" type is selected as the image source.
-
from a directory on a network disk that is mounted on a local drive and synchronized with the directory in the containers of the Tasks and Tasks Worker service (see the detailed description in the "Estimator task" section).
-
Processing the parameters specified in the request - authorization, use of prefixes, etc.
- Image Store/S3/Network disk sends an images to the Tasks worker.
- handler_id exists. The Tasks worker sends a request to get the existing handler ID in the Handlers database.
- From the Handlers database, a response comes with handler_id to the Tasks worker.
- The Tasks worker sends a request to the Handlers service to process handler_id.
- The Handlers service processes the batch of images by the received handler_id in accordance with the specified policies (see the policy processing diagram).
- The received response is returned to the Tasks worker.
- no handler_id. The Tasks worker sends a request to process the policies specified directly in the request to the Handlers service.
- The Handlers service processes the batch of images in accordance with the specified policies (see the policy processing diagram).
- The received response is returned to the Tasks worker.
Additional extraction task diagrams#
Request | Description | Method |
---|---|---|
create additional extract task | Extract all the existing descriptors using the new NN version. | POST |
Task creation#
The request is sent using Admin service. Task creation is shown in the diagram below.
- The administrator sends a request to the Admin service using the Admin UI or any other application;
- Admin service sends a request to Tasks;
- Tasks sends a request to Faces to receive descriptor IDs that were not extracted using the new NN;
- Faces sends the request to the database;
- Database returns IDs;
- Faces sends IDs to Tasks;
- Tasks creates a new task and stores it in the database;
- The database sends the response and the created task ID;
- Tasks service sends task ID to Admin service;
- Admin service sends the created task ID back to the UI or application, which is used by the administrator;
- Tasks creates and sends subtasks to Tasks workers;
- Tasks workers send the response.
Additional extraction subtask processing#
Several subtasks are created for this task type. Each of the subtasks contains the range of attribute IDs.
The general workflow for each subtask processing is shown below.
- The Tasks worker sends the request to Faces to receive all the required descriptors according to their IDs;
- Faces sends the request to the DB;
- The DB sends back the required descriptors;
- Faces sends the descriptors to the Tasks worker;
- The Tasks worker sends the extraction task to the Handlers service;
- The Handlers service requests samples for extraction from Image Store;
- Image Store requests samples from the storage;
- Image Store receives samples from the storage;
- Image Store sends samples to the Handlers service;
- The Handlers service processes task according to the specified parameters;
- The Handlers service sends descriptors and basic attributes to Faces;
- Faces sends the request to store data in the database;
- The database returns the result of data storage;
- The Faces service returns the result of data storage;
- The Handlers service sends the result of the task execution to the Tasks service;
- The Tasks worker generates a report based on the subtask results and stores it in the Image Store;
- Image Store stores report in the storage;
- Storage sends the result of storage;
- Image Store returns the result to the Tasks worker.
The described sequence is performed for each of the Tasks workers.
The Tasks worker that completes the last subtask gathers all the task reports into a single report and changes the task status. The diagram is shown below.
- The Tasks worker gathers all the reports corresponding to the same task into a single report and sends it to Image Store;
- Image Store sends the report to the storage;
- The storage sends the response;
- Image Store sends the result of the report saving to the Tasks worker;
- The Tasks worker sends the request to update the task status in the Tasks database;
- Tasks database sends the response.
Tasks information diagrams#
The following requests provide information on the status of existing tasks.
Request | Description | Method |
---|---|---|
cancel task | Cancel the tasks execution by its ID. | PATCH |
get tasks | Receive tasks information. You can set filters for the tasks. | GET |
get tasks count | Receive number of tasks according to the specified filters. | GET |
get task | Receive information about a task by its ID. | GET |
get subtasks | Receive information about all subtasks of the specified task. | GET |
The following requests provide information about errors occurred while processing tasks.
Request | Description | Method |
---|---|---|
get errors of task | Receive all the errors of the specified task by the task ID. | GET |
get errors | Receive all the errors according to the specified filters. | GET |
get errors count | Receive the number of errors according to the specified filter. | GET |
get error | Receive information about an error by the error ID. | GET |
The corresponding diagram is shown below.
- A request is sent to API;
- API service sends the request to Tasks to receive the required data or perform required actions;
- Tasks sends the request to the Tasks database to receive the required data or perform required actions;
- The database sends the response to Tasks;
- Tasks sends the response to API service;
- API service returns information.
Request | Description | Method |
---|---|---|
delete task | Delete the specified task and its results. | DEL |
get task result | Receive results of the specified task. | GET |
- The request is sent to API;
- API sends the request to Tasks to receive the required task data or delete a task;
- Tasks sends the request to the Tasks database to receive the required data or delete a task;
- The database sends the response to Tasks;
- Tasks sends the request to Image Store to receive or delete the results of the specified task;
- Image Store sends the request to the storage;
- The storage sends the response to Image Store;
- Image Store returns the result to Tasks;
- Tasks sends the response to API service.
- API service sends the response.