public bool IsMatch(FaceRequest face) { bool genderMatches = Gender == Gender.NotSpecified || face.Gender == Gender; bool ageMatches = face.Age >= MinAge && face.Age <= MaxAge; return(genderMatches && ageMatches); }
public async Task AddNewFaceAsync([FromBody] FaceRequestDTO faceRequestDTO) { var faceRequest = new FaceRequest() { RequestedFaceId = faceRequestDTO.FaceId, AuthorizationCode = faceRequestDTO.AuthorizationCode, CreationDateTime = DateTime.UtcNow }; await _requestService.AddAsync(faceRequest); }
public void TestFaceRequest() { var faceRequest = new FaceRequest(); Assert.IsTrue(faceRequest.DefaultOnEnd); faceRequest.AddFace("Smile"); faceRequest.AddFace("Angry", 1.1f, "angry face"); Assert.AreEqual("Smile", faceRequest.Faces[0].Name); Assert.AreEqual(0.0f, faceRequest.Faces[0].Duration); Assert.AreEqual(null, faceRequest.Faces[0].Description); Assert.AreEqual("Angry", faceRequest.Faces[1].Name); Assert.AreEqual(1.1f, faceRequest.Faces[1].Duration); Assert.AreEqual("angry face", faceRequest.Faces[1].Description); }
/// <summary> /// 按条件批量查询人脸 /// </summary> /// <param name="model"></param> /// <returns></returns> public Task <FaceResponse> FaceAsync(FaceRequest model) { return(_hikVisionApiManager.PostAndGetAsync <FaceRequest, FaceResponse>("/api/frs/v1/face", model, Const.V1_2)); }
public async Task AddAsync(FaceRequest faceRequest) { faceRequest.Id = Id++; _requests.Add(faceRequest); }
public async Task AddAsync(FaceRequest faceRequest) { _context.FaceRequests.Add(faceRequest); await _context.SaveChangesAsync(); }