예제 #1
0
        public bool IsMatch(FaceRequest face)
        {
            bool genderMatches = Gender == Gender.NotSpecified || face.Gender == Gender;
            bool ageMatches    = face.Age >= MinAge && face.Age <= MaxAge;

            return(genderMatches && ageMatches);
        }
예제 #2
0
 public async Task AddNewFaceAsync([FromBody] FaceRequestDTO faceRequestDTO)
 {
     var faceRequest = new FaceRequest()
     {
         RequestedFaceId   = faceRequestDTO.FaceId,
         AuthorizationCode = faceRequestDTO.AuthorizationCode,
         CreationDateTime  = DateTime.UtcNow
     };
     await _requestService.AddAsync(faceRequest);
 }
예제 #3
0
        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);
        }
예제 #4
0
 /// <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));
 }
예제 #5
0
 public async Task AddAsync(FaceRequest faceRequest)
 {
     faceRequest.Id = Id++;
     _requests.Add(faceRequest);
 }
예제 #6
0
 public async Task AddAsync(FaceRequest faceRequest)
 {
     _context.FaceRequests.Add(faceRequest);
     await _context.SaveChangesAsync();
 }