Search

Function

This API is used to search AI > Recognition > SnapedFaces snapshot face information.

Request Message

Parameter Description

Table 1

ParameterRangeTypeDescription
MsgIdnull
StartTimestringSearch the start time, for example, 2020-07-12 00:00:00.
EndTimestringSearch end time, such as "2020-07-12 23:59:59"
Chn0~MAX_PARA_CHN_NUMarray
AlarmGrouparrayThe value represents the group Id of the selected group. If it is empty, all (including deleted groups) are displayed. If the given group is selected, the results will be filtered according to the given group Id.
Similarity0-100intIf the similarity is lower than the similarity, the face will be filtered [0, 100], which is the normal value range. If the face is not matched, the parameter can be -1
Engine0intConsidering that the search process and operation logic are superimposed (for example, after the search results of the matching page, you can open the face selection dialog box to add a new face, at this time the matched cache information will be overwritten by the results of a new search and become invalid), the device provides two search engines with equivalent functions (0 and 1), and the data and cache of the two engines are completely independent. Do not interfere with each other, how the division of labor is distributed by the client itself, for example, you can use No. 0 engine to achieve some temporary face selection tasks (for the selection dialog box to use), and use the data of No. 1 engine to display search or matching results.
CountintSearch for the number of matching images
GenderarrayGender, the value represents the selected gender, 0: male 1: female
fAttrAge[0, 1, 2, 3, 4, 5, 6]arrayAge range, the value represents the corresponding age. [[0, 17], [18, 25], [26, 30], [31 and 35], [36, 40], [41 to 50], [51, 127], [1, 0]]. [-1, 0] indicates the age of less than 1 year old
Beauty[0, 1, 2, 3, 4]arrayAppearance level, the value represents the corresponding value. [[0, 9], [10, 29], [30, 69], [70, 89], [90, 100]]
GlassesType[0, 1]arrayType of glasses, 0: no glasses, 1: wear glasses (currently no distinction between sunglasses, ordinary glasses, default to all glasses)
Expression[0, 1, 2]arrayExpression type: 0: blank expression, 1: smile, 2: laugh
MouthMask[0, 1]arrayThe value represents the search type, 0: no mask, 1: wearing a mask
Race[0, 1, 2, 3]arrayRace, the value represents the corresponding type, 0: yellow, 1: white, 2: black, 3: Arab
FaceInfoJSONarraysearch SnapedFaces JSON show as follow Table 2

Table 2

ParameterRangeTypeDescription
Idint
MD5"F74C70ADB0B63B00E279E71B4143704D"stringMD5 value
Feature"base64(feature)"stringeigenvalue
FtVersionintVersion of the eigenvalue. This parameter is meaningful only when the eigenvalue of the same version is compared. If the eigenvalue is returned, this field is also returned

Sample:

POST /API/AI/SnapedFaces/Search HTTP/1.1
{
	"msgType": "AI_searchSnapedFaces",
	"data": {
		"MsgId": null,
		"StartTime": "2018-10-20 00:00:00",
		"EndTime": "2018-10-28 23:59:59",
		"Chn": [0, 1, 2, 3, 4, 5, 6, 7, 8],  
		"AlarmGroup": [1, 2, 5, 9, 13],   
		"Similarity": 70,	
		"Engine": 0,	
		"Count": 2,
		"FaceInfo": [
			{
				"Id": 2,
				"MD5": "F74C70ADB0B63B00E279E71B4143704D",
				"Feature": "base64(feature)",
				"FtVersion": 0	
			},
			{
				"Id": 5,	
				"MD5": "294C703DB05F3B00E279E71B41437E46",
				"Feature": "base64(feature)",
				"FtVersion": 0	
			}
		]
	}
}

Response Message

Parameter Description

Table 3

ParameterRangeTypeDescription
MsgIdnull
Result0intSee the resultTable x
CountintThe total number of captured faces in this response

Table x

Result typeDescription
AORT_SUCCESS = 0succeed
AORT_NO_DB = -1No database
AORT_DB_EXEC_FAILED = -2Database execution failure
AORT_CALC_FEATURE_FAILED = -3Feature extraction failure
AORT_CANCELED = -4canceled
AORT_NO_DISK = -5No hard disk
AORT_DISK_ERROR = -6Hard disk error
AORT_EXIST = -7Already exist
AORT_GROUP_INVALID = -8Group invalid
AORT_NOT_EXIST = -9inexistence
AORT_MORE_FILE_EXIST = -10File already exists
AORT_SEARCH_ERROR = -11Search error
AORT_OVER_MAX_COUNT = -12upper limit exceeded
AORT_UPDATING_FEATURE = -13Updating feature values
AORT_NO_USABLE_IPC = -14There is no IPC vailable for eigenvalue calculation
AORT_INVALID_PARAM = -15invalid parameter
AORT_INVALID_FORMAT = -16malformed
AORT_INVALID_RES = -17resolution error
AORT_INVALID_MEM = -18File too large error
AORT_CREAT_FAILED = -19create failed
AORT_MD5_NOT_MATCH = -20MD5 mismatch
AORT_POS_ERROR = -21wrong location
AORT_SIZE_ERROR = -22size error
AORT_NOT_READY = -23not ready
AORT_INVALID_DB = -24invalid database

Tips:

Response messages and request messages may not contain all the fields in the table above. If no fields are included, the device does not support this parameter configuration.

Sample:

HTTP/1.1 200 OK
Content-Type: application/json
{
	"data": {
		"MsgId": null,
		"Result": 0,	
		"Count": 153	
	}
}

Error Code

See Response Messages Body and Common error_code for more information.