public void SearchFaceTest() { var image = Bitmap.FromFile(@"Ego.jpg"); var groupIds = new string[] { "EE" }; var option = new SearchFaceOption() { Max_User_Num = 10, }; var jObj = FaceApi.FaceSearch(new Bitmap(image), groupIds, option); image.Dispose(); }
public static BaseResponse <FaceSearchResult> FaceSearch(Bitmap image, string[] groupIds, SearchFaceOption option = null) { var imageByte = image.ToBytes(); return(FaceSearch(imageByte, groupIds, option)); }
public static BaseResponse <FaceSearchResult> FaceSearch(byte[] imageByte, string[] groupIds, SearchFaceOption option = null) { if (imageByte.Length > 1024 * 1024 * 10) { throw new Exception("图片大小必须小于10Mb"); } var imageBase64 = Convert.ToBase64String(imageByte); return(Execute <FaceSearchResult>(client.Search(imageBase64, ImageType, string.Join(",", groupIds), option?.Options))); }