去讯飞开发平台将人脸识别的代码和sdk下下来,它包括在线识别,离线识别(这两种都是调用相册或者拍完照根据图片来验证的),还一种视频流识别(只帮我们实现了检测与聚焦,不过前面两种已经实现了识别功能,拿到图片的字节数组去注册和验证就ok了)
讯飞给我们采集到的一帧的格式是NV21的,并不是RGB或者ARGB,所以我们就需要进行转换了
关键代码: 在官方提供的VideoDemo.java代码中的添加
//得到预览的一帧图片 mCamera.setPreviewCallback(new PreviewCallback() { @Override public void onPreviewFrame(byte[] data, Camera camera) { System.arraycopy(data, 0, nv21, 0, data.length); //检测到图片 Bitmap b3 = decodeToBitMap(nv21,camera); imageview.setImageBitmap(b3); //拿到该图片的字节数组去注册验证就行了,代码可以拷贝他们给的离线或者在线验证的代码 } }); /** * NV21格式(所有相机都支持的格式)转换为bitmap */ public Bitmap decodeToBitMap(byte[] data, Camera mCamera) { Size size = mCamera.getParameters().getPreviewSize(); try { YuvImage image = new YuvImage(data, ImageFormat.NV21, size.width, size.height, null); if (image != null) { ByteArrayOutputStream stream = new ByteArrayOutputStream(); image.compressToJpeg(new Rect(0, 0, size.width, size.height), 80, stream); Bitmap bmp = BitmapFactory.decodeByteArray( stream.toByteArray(), 0, stream.size()); stream.close(); Matrix matrix = new Matrix(); matrix.postRotate(270); //上面得到的图片旋转了270度,下面将图片旋转回来,前置摄像头270度,后置只需要90度 Bitmap nbmp = Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), matrix, true); return nbmp; } } catch (Exception ex) { Log.e("tag", "Error:" + ex.getMessage()); } return null; }
拿到图片就简单了...
效果:(代码中对使用后置还是前置没判断,设置使用后置将旋转设置为90度的效果)
人脸属性的检测使用的Face++:https://www.faceplusplus.com.cn/
创建APPkey,请求他们网址提交图片就能拿到数据:
代码如下:拍照裁剪提交图片 注意:这里没有对图片压缩
/** * 人脸检测测试 */ public class MainActivity extends Activity { /** * 裁剪好的图片的输出路径 */ private File photoZoomOutFile; /** * 拍照的图片的url */ private Uri pictureOutUri; private ProgressDialog dialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); dialog = new ProgressDialog(this); dialog.setMessage("正在提交..."); } //点击事件 public void btn(View view){ //1.拍照 camera(); } public void btn2(View view){ //重新提交 if(photoZoomOutFile != null){ getFaceInfo(photoZoomOutFile.getName(),photoZoomOutFile); }else{ Toast.makeText(getApplicationContext(),"还没有图片,请先拍照",Toast.LENGTH_SHORT).show(); } } /** * 拍照 */ private void camera() { Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { File icon_file = new File(Environment.getExternalStorageDirectory().getPath() + "/shch/icon"); if (!icon_file.exists()) { icon_file.mkdirs(); } pictureOutUri = Uri.fromFile(new File(icon_file, System.currentTimeMillis() + ".jpg")); intent.putExtra(MediaStore.EXTRA_OUTPUT, pictureOutUri); } startActivityForResult(intent, 1); } /** * 裁剪 * @param uri 被裁剪的图片 */ private void startPhotoZoom(Uri uri) { File file = new File(Environment.getExternalStorageDirectory().getPath() + "/shch/icon"); if (!file.exists()) { file.mkdirs(); } photoZoomOutFile = new File(file, System.currentTimeMillis() + ".jpg");//裁剪的图片保存路径 Uri outUri = Uri.fromFile(photoZoomOutFile); Intent intent = new Intent("com.android.camera.action.CROP"); intent.setDataAndType(uri, "image/*"); intent.putExtra("crop", "true"); intent.putExtra("aspectX", 1); intent.putExtra("aspectY", 1); //intent.putExtra("outputX", 480); //intent.putExtra("outputY", 480); intent.putExtra(MediaStore.EXTRA_OUTPUT, outUri); intent.putExtra("return-data", false); intent.putExtra("noFaceDetection", true); startActivityForResult(intent, 3); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); switch (requestCode) { case 1://拍照 if (resultCode == RESULT_OK) { startPhotoZoom(pictureOutUri);//裁剪 } break; case 2://图库 if (resultCode == RESULT_OK) { Uri uri = data.getData(); if (uri == null) { //选择图片失败 return; } } break; case 3://裁剪 if (resultCode == RESULT_OK) { Log.e("tag2","文件名="+photoZoomOutFile.getName()); getFaceInfo(photoZoomOutFile.getName(),photoZoomOutFile); } break; } } /** * 获取人脸信息 */ public void getFaceInfo(String name,File file){ dialog.show(); //请求接口拿到数据 OkHttpUtils.post() .url("https://api-cn.faceplusplus.com/facepp/v3/detect") //请求数据的接口 .addParams("api_key","IYBMBAX6moez1pirP_J6jLGsrUfLn3YY") .addParams("api_secret","kS0Otv3e9G20nS8UpZn3_8DcuAo8cjJq") .addFile("image_file",name,file) //提交图片 .addParams("return_attributes","gender,age,smiling,headpose,facequality,blur,eyestatus,ethnicity")//需要的数据 //.addParams("return_landmark","1") .build() .execute(new StringCallback() { @Override public void onError(Call call, Exception e, int id) { Log.e("tag2","onError="+e.getMessage()); dialog.dismiss(); if(e.getMessage().contains("403")){ Toast.makeText(getApplicationContext(),"服务器繁忙,请重试",Toast.LENGTH_SHORT).show(); }else{ Toast.makeText(getApplicationContext(),"提交错误",Toast.LENGTH_SHORT).show(); } } @Override public void onResponse(String response, int id) { Log.i("tag2","response="+response); dialog.dismiss(); //Toast.makeText(getApplicationContext(),"成功了",Toast.LENGTH_SHORT).show(); DataBean dataBean = new Gson().fromJson(response, DataBean.class); if(dataBean == null){ Toast.makeText(getApplicationContext(),"获取的数据为空",Toast.LENGTH_SHORT).show(); return; } List<DataBean.Faces> faces = dataBean.getFaces(); String age = "未知";//年龄 String ethnicity = "未知";//人种 String facequality = "未知";//人脸质量 String gender = "未知";//性别 String smile = "未知";//笑容分析 if(faces!=null && faces.size()>0 && faces.get(0).getAttributes()!=null){ DataBean.Attributes attributes = faces.get(0).getAttributes(); if(attributes.getAge()!=null){ age = attributes.getAge().getValue()+""; } if(!TextUtils.isEmpty(attributes.getEthnicity().getValue())){ switch (attributes.getEthnicity().getValue()){ case "Asian": ethnicity = "亚洲人"; break; case "White": ethnicity = "白种人"; break; case "Black": ethnicity = "黑种人"; break; } } //人脸质量 if(attributes.getFacequality()!=null){ facequality = attributes.getFacequality().getValue()+"";//0-100 } if(attributes.getGender()!=null && !TextUtils.isEmpty(attributes.getGender().getValue())){ switch (attributes.getGender().getValue()){ case "Male": gender = "男性"; break; case "Female": gender = "女性"; break; } } //笑容度 if(attributes.getSmile()!=null){ smile = attributes.getSmile().getValue() + ""; } } TextView tv = (TextView) findViewById(R.id.tv); tv.setText("年龄="+ age + ",人种=" + ethnicity + ",人脸质量=" + facequality + ",性别=" + gender + ",笑容度=" + smile); } }); } }
布局文件:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <Button android:onClick="btn" android:text="拍照检测" android:layout_width="match_parent" android:layout_height="wrap_content" /> <Button android:onClick="btn2" android:text="重新提交图片" android:layout_width="match_parent" android:layout_height="wrap_content" /> <TextView android:id="@+id/tv" android:textSize="12sp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" /> </LinearLayout>
实体类如下:
/** * 人脸属性值 */ public class DataBean { private List<Faces> faces; private String image_id; private String request_id; private int time_used; public void setFaces(List<Faces> faces){ this.faces = faces; } public List<Faces> getFaces(){ return this.faces; } public void setImage_id(String image_id){ this.image_id = image_id; } public String getImage_id(){ return this.image_id; } public void setRequest_id(String request_id){ this.request_id = request_id; } public String getRequest_id(){ return this.request_id; } public void setTime_used(int time_used){ this.time_used = time_used; } public int getTime_used(){ return this.time_used; } public class Age { private int value; public void setValue(int value){ this.value = value; } public int getValue(){ return this.value; } @Override public String toString() { return "年龄=" + value ; } } public class Blurness { private int threshold; private double value; public void setThreshold(int threshold){ this.threshold = threshold; } public int getThreshold(){ return this.threshold; } public void setValue(double value){ this.value = value; } public double getValue(){ return this.value; } } public class Gaussianblur { private int threshold; private double value; public void setThreshold(int threshold){ this.threshold = threshold; } public int getThreshold(){ return this.threshold; } public void setValue(double value){ this.value = value; } public double getValue(){ return this.value; } } public class Motionblur { private int threshold; private double value; public void setThreshold(int threshold){ this.threshold = threshold; } public int getThreshold(){ return this.threshold; } public void setValue(double value){ this.value = value; } public double getValue(){ return this.value; } } public class Blur { private Blurness blurness; private Gaussianblur gaussianblur; private Motionblur motionblur; public void setBlurness(Blurness blurness){ this.blurness = blurness; } public Blurness getBlurness(){ return this.blurness; } public void setGaussianblur(Gaussianblur gaussianblur){ this.gaussianblur = gaussianblur; } public Gaussianblur getGaussianblur(){ return this.gaussianblur; } public void setMotionblur(Motionblur motionblur){ this.motionblur = motionblur; } public Motionblur getMotionblur(){ return this.motionblur; } } public class Ethnicity { private String value; public void setValue(String value){ this.value = value; } public String getValue(){ return this.value; } @Override public String toString() { return "人种{" + "value=\'" + value + \'\\'\' + \'}\'; } } public class Left_eye_status { private int dark_glasses; private int no_glass_eye_close; private double no_glass_eye_open; private int normal_glass_eye_close; private double normal_glass_eye_open; private int occlusion; public void setDark_glasses(int dark_glasses){ this.dark_glasses = dark_glasses; } public int getDark_glasses(){ return this.dark_glasses; } public void setNo_glass_eye_close(int no_glass_eye_close){ this.no_glass_eye_close = no_glass_eye_close; } public int getNo_glass_eye_close(){ return this.no_glass_eye_close; } public void setNo_glass_eye_open(double no_glass_eye_open){ this.no_glass_eye_open = no_glass_eye_open; } public double getNo_glass_eye_open(){ return this.no_glass_eye_open; } public void setNormal_glass_eye_close(int normal_glass_eye_close){ this.normal_glass_eye_close = normal_glass_eye_close; } public int getNormal_glass_eye_close(){ return this.normal_glass_eye_close; } public void setNormal_glass_eye_open(double normal_glass_eye_open){ this.normal_glass_eye_open = normal_glass_eye_open; } public double getNormal_glass_eye_open(){ return this.normal_glass_eye_open; } public void setOcclusion(int occlusion){ this.occlusion = occlusion; } public int getOcclusion(){ return this.occlusion; } } public class Right_eye_status { private int dark_glasses; private int no_glass_eye_close; private double no_glass_eye_open; private int normal_glass_eye_close; private double normal_glass_eye_open; private double occlusion; public void setDark_glasses(int dark_glasses){ this.dark_glasses = dark_glasses; } public int getDark_glasses(){ return this.dark_glasses; } public void setNo_glass_eye_close(int no_glass_eye_close){ this.no_glass_eye_close = no_glass_eye_close; } public int getNo_glass_eye_close(){ return this.no_glass_eye_close; } public void setNo_glass_eye_open(double no_glass_eye_open){ this.no_glass_eye_open = no_glass_eye_open; } public double getNo_glass_eye_open(){ return this.no_glass_eye_open; } public void setNormal_glass_eye_close(int normal_glass_eye_close){ this.normal_glass_eye_close = normal_glass_eye_close; } public int getNormal_glass_eye_close(){ return this.normal_glass_eye_close; } public void setNormal_glass_eye_open(double normal_glass_eye_open){ this.normal_glass_eye_open = normal_glass_eye_open; } public double getNormal_glass_eye_open(){ return this.normal_glass_eye_open; } public void setOcclusion(double occlusion){ this.occlusion = occlusion; } public double getOcclusion(){ return this.occlusion; } } public class Eyestatus { private Left_eye_status left_eye_status; private Right_eye_status right_eye_status; public void setLeft_eye_status(Left_eye_status left_eye_status){ this.left_eye_status = left_eye_status; } public Left_eye_status getLeft_eye_status(){ return this.left_eye_status; } public void setRight_eye_status(Right_eye_status right_eye_status){ this.right_eye_status = right_eye_status; } public Right_eye_status getRight_eye_status(){ return this.right_eye_status; } } public class Facequality { private double threshold; private double value; public void setThreshold(double threshold){ this.threshold = threshold; } public double getThreshold(){ return this.threshold; } public void setValue(double value){ this.value = value; } public double getValue(){ return this.value; } @Override public String toString() { return "人脸质量{" + "threshold=" + threshold + ", value=" + value + \'}\'; } } public class Gender { private String value; public void setValue(String value){ this.value = value; } public String getValue(){ return this.value; } @Override public String toString() { return "性别{" + "value=\'" + value + \'\\'\' + \'}\'; } } public class Glass { private String value; public void setValue(String value){ this.value = value; } public String getValue(){ return this.value; } } public class Headpose { private double pitch_angle; private double roll_angle; private double yaw_angle; public void setPitch_angle(double pitch_angle){ this.pitch_angle = pitch_angle; } public double getPitch_angle(){ return this.pitch_angle; } public void setRoll_angle(double roll_angle){ this.roll_angle = roll_angle; } public double getRoll_angle(){ return this.roll_angle; } public void setYaw_angle(double yaw_angle){ this.yaw_angle = yaw_angle; } public double getYaw_angle(){ return this.yaw_angle; } } public class Smile { private double threshold; private double value; public void setThreshold(double threshold){ this.threshold = threshold; } public double getThreshold(){ return this.threshold; } public void setValue(double value){ this.value = value; } public double getValue(){ return this.value; } @Override public String toString() { return "笑容分享{" + "threshold=" + threshold + ", value=" + value + \'}\'; } } public class Attributes { private Age age;//年龄 private Blur blur; /** * ethnicity: 人种分析结果,value的值为Asian/White/Black。Asian代表亚洲人,White代表白人,Black代表黑人。 */ private Ethnicity ethnicity; private Eyestatus eyestatus;// 眼睛状态信息 包括 le /** * facequality: 人脸质量判断结果,value值为人脸的质量判断的分数,是一个浮点数,范围[0,100], 小数点后3位有效数字。threshold表示人脸质量基本合格的一个阈值,超过该阈值的人脸适合用于人脸比对。 */ private Facequality facequality; /** * gender:性别分析结果,value的值为Male/Female。Male 代表男性,Female代表女性。 */ private Gender gender; /** * 是否佩戴眼镜的分析结果,value的值为None/Dark/Normal。None代表不佩戴眼镜,Dark代表佩戴墨镜,Normal代表佩戴普通眼镜。(请注意,motionblur 和 gaussianblur 将于2017-4-30日停止返回,请尽快停用) headpose:人脸姿势分析结果,包括pitch_angle, roll_angle, yaw_angle,分别对应抬头,旋转(平面旋转),摇头。单位为角度。 */ private Glass glass; private Headpose headpose; /** * smiling:笑容分析结果,value的值为一个[0,100]的浮点数,小数点后3位有效数字,数值大表示笑程度高。threshold代表笑容的阈值,超过该阈值认为有笑容。 */ private Smile smile; public void setAge(Age age){ this.age = age; } public Age getAge(){ return this.age; } public void setBlur(Blur blur){ this.blur = blur; } public Blur getBlur(){ return this.blur; } public void setEthnicity(Ethnicity ethnicity){ this.ethnicity = ethnicity; } public Ethnicity getEthnicity(){ return this.ethnicity; } public void setEyestatus(Eyestatus eyestatus){ this.eyestatus = eyestatus; } public Eyestatus getEyestatus(){ return this.eyestatus; } public void setFacequality(Facequality facequality){ this.facequality = facequality; } public Facequality getFacequality(){ return this.facequality; } public void setGender(Gender gender){ this.gender = gender; } public Gender getGender(){ return this.gender; } public void setGlass(Glass glass){ this.glass = glass; } public Glass getGlass(){ return this.glass; } public void setHeadpose(Headpose headpose){ this.headpose = headpose; } public Headpose getHeadpose(){ return this.headpose; } public void setSmile(Smile smile){ this.smile = smile; } public Smile getSmile(){ return this.smile; } @Override public String toString() { return "Attributes{" + "age=" + age + ", blur=" + blur + ", ethnicity=" + ethnicity + ", eyestatus=" + eyestatus + ", facequality=" + facequality + ", gender=" + gender + ", glass=" + glass + ", headpose=" + headpose + ", smile=" + smile + \'}\'; } } public class Face_rectangle { private int height; private int left; private int top; private int width; public void setHeight(int height){ this.height = height; } public int getHeight(){ return this.height; } public void setLeft(int left){ this.left = left; } public int getLeft(){ return this.left; } public void setTop(int top){ this.top = top; } public int getTop(){ return this.top; } public void setWidth(int width){ this.width = width; } public int getWidth(){ return this.width; } } public class Contour_chin { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Contour_left1 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Contour_left2 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Contour_left3 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Contour_left4 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Contour_left5 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Contour_left6 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Contour_left7 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Contour_left8 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Contour_left9 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Contour_right1 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Contour_right2 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Contour_right3 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Contour_right4 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Contour_right5 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Contour_right6 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Contour_right7 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Contour_right8 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Contour_right9 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Left_eye_bottom { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Left_eye_center { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Left_eye_left_corner { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Left_eye_lower_left_quarter { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Left_eye_lower_right_quarter { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Left_eye_pupil { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Left_eye_right_corner { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Left_eye_top { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Left_eye_upper_left_quarter { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Left_eye_upper_right_quarter { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Left_eyebrow_left_corner { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Left_eyebrow_lower_left_quarter { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Left_eyebrow_lower_middle { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Left_eyebrow_lower_right_quarter { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Left_eyebrow_right_corner { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Left_eyebrow_upper_left_quarter { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Left_eyebrow_upper_middle { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Left_eyebrow_upper_right_quarter { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Mouth_left_corner { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Mouth_lower_lip_bottom { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Mouth_lower_lip_left_contour1 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Mouth_lower_lip_left_contour2 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Mouth_lower_lip_left_contour3 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Mouth_lower_lip_right_contour1 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Mouth_lower_lip_right_contour2 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Mouth_lower_lip_right_contour3 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Mouth_lower_lip_top { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Mouth_right_corner { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Mouth_upper_lip_bottom { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Mouth_upper_lip_left_contour1 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Mouth_upper_lip_left_contour2 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Mouth_upper_lip_left_contour3 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Mouth_upper_lip_right_contour1 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Mouth_upper_lip_right_contour2 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Mouth_upper_lip_right_contour3 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Mouth_upper_lip_top { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Nose_contour_left1 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Nose_contour_left2 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Nose_contour_left3 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Nose_contour_lower_middle { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Nose_contour_right1 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Nose_contour_right2 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Nose_contour_right3 { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Nose_left { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Nose_right { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Nose_tip { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Right_eye_bottom { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Right_eye_center { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Right_eye_left_corner { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Right_eye_lower_left_quarter { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Right_eye_lower_right_quarter { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Right_eye_pupil { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Right_eye_right_corner { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Right_eye_top { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Right_eye_upper_left_quarter { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Right_eye_upper_right_quarter { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Right_eyebrow_left_corner { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Right_eyebrow_lower_left_quarter { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Right_eyebrow_lower_middle { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Right_eyebrow_lower_right_quarter { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Right_eyebrow_right_corner { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Right_eyebrow_upper_left_quarter { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Right_eyebrow_upper_middle { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Right_eyebrow_upper_right_quarter { private int x; private int y; public void setX(int x){ this.x = x; } public int getX(){ return this.x; } public void setY(int y){ this.y = y; } public int getY(){ return this.y; } } public class Landmark { private Contour_chin contour_chin; private Contour_left1 contour_left1; private Contour_left2 contour_left2; private Contour_left3 contour_left3; private Contour_left4 contour_left4; private Contour_left5 contour_left5; private Contour_left6 contour_left6; private Contour_left7 contour_left7; private Contour_left8 contour_left8; private Contour_left9 contour_left9; private Contour_right1 contour_right1; private Contour_right2 contour_right2; private Contour_right3 contour_right3; private Contour_right4 contour_right4; private Contour_right5 contour_right5; private Contour_right6 contour_right6; private Contour_right7 contour_right7; private Contour_right8 contour_right8; private Contour_right9 contour_right9; private Left_eye_bottom left_eye_bottom; private Left_eye_center left_eye_center; private Left_eye_left_corner left_eye_left_corner; private Left_eye_lower_left_quarter left_eye_lower_left_quarter; private Left_eye_lower_right_quarter left_eye_lower_right_quarter; private Left_eye_pupil left_eye_pupil; private Left_eye_right_corner left_eye_right_corner; private Left_eye_top left_eye_top; private Left_eye_upper_left_quarter left_eye_upper_left_quarter; private Left_eye_upper_right_quarter left_eye_upper_right_quarter; private Left_eyebrow_left_corner left_eyebrow_left_corner; private Left_eyebrow_lower_left_quarter left_eyebrow_lower_left_quarter; private Left_eyebrow_lower_middle left_eyebrow_lower_middle; private Left_eyebrow_lower_right_quarter left_eyebrow_lower_right_quarter; private Left_eyebrow_right_corner left_eyebrow_right_corner; private Left_eyebrow_upper_left_quarter left_eyebrow_upper_left_quarter; private Left_eyebrow_upper_middle left_eyebrow_upper_middle; private Left_eyebrow_upper_right_quarter left_eyebrow_upper_right_quarter; private Mouth_left_corner mouth_left_corner; private Mouth_lower_lip_bottom mouth_lower_lip_bottom; private Mouth_lower_lip_left_contour1 mouth_lower_lip_left_contour1; private Mouth_lower_lip_left_contour2 mouth_lower_lip_left_contour2; private Mouth_lower_lip_left_contour3 mouth_lower_lip_left_contour3; private Mouth_lower_lip_right_contour1 mouth_lower_lip_right_contour1; private Mouth_lower_lip_right_contour2 mouth_lower_lip_right_contour2; private Mouth_lower_lip_right_contour3 mouth_lower_lip_right_contour3; private Mouth_lower_lip_top mouth_lower_lip_top; private Mouth_right_corner mouth_right_corner; private Mouth_upper_lip_bottom mouth_upper_lip_bottom; private Mouth_upper_lip_left_contour1 mouth_upper_lip_left_contour1; private Mouth_upper_lip_left_contour2 mouth_upper_lip_left_contour2; private Mouth_upper_lip_left_contour3 mouth_upper_lip_left_contour3; private Mouth_upper_lip_right_contour1 mouth_upper_lip_right_contour1; private Mouth_upper_lip_right_contour2 mouth_upper_lip_right_contour2; private Mouth_upper_lip_right_contour3 mouth_upper_lip_right_contour3; private Mouth_upper_lip_top mouth_upper_lip_top; private Nose_contour_left1 nose_contour_left1; private Nose_contour_left2 nose_contour_left2; private Nose_contour_left3 nose_contour_left3; private Nose_contour_lower_middle nose_contour_lower_middle; private Nose_contour_right1 nose_contour_right1; private Nose_contour_right2 nose_contour_right2; private Nose_contour_right3 nose_contour_right3; private Nose_left nose_left; private Nose_right nose_right; private Nose_tip nose_tip; private Right_eye_bottom right_eye_bottom; private Right_eye_center right_eye_center; private Right_eye_left_corner right_eye_left_corner; private Right_eye_lower_left_quarter right_eye_lower_left_quarter; private Right_eye_lower_right_quarter right_eye_lower_right_quarter; private Right_eye_pupil right_eye_pupil; private Right_eye_right_corner right_eye_right_corner; private Right_eye_top right_eye_top; private Right_eye_upper_left_quarter right_eye_upper_left_quarter; private Right_eye_upper_right_quarter right_eye_upper_right_quarter; private Right_eyebrow_left_corner right_eyebrow_left_corner; private Right_eyebrow_lower_left_quarter right_eyebrow_lower_left_quarter; private Right_eyebrow_lower_middle right_eyebrow_lower_middle; private Right_eyebrow_lower_right_quarter right_eyebrow_lower_right_quarter; private Right_eyebrow_right_corner right_eyebrow_right_corner; private Right_eyebrow_upper_left_quarter right_eyebrow_upper_left_quarter; private Right_eyebrow_upper_middle right_eyebrow_upper_middle; private Right_eyebrow_upper_right_quarter right_eyebrow_upper_right_quarter; public void setContour_chin(Contour_chin contour_chin){ this.contour_chin = contour_chin; } public Contour_chin getContour_chin(){ return this.contour_chin; } public void setContour_left1(Contour_left1 contour_left1){ this.contour_left1 = contour_left1; } public Contour_left1 getContour_left1(){ return this.contour_left1; } public void setContour_left2(Contour_left2 contour_left2){ this.contour_left2 = contour_left2; } public Contour_left2 getContour_left2(){ return this.contour_left2; } public void setContour_left3(Contour_left3 contour_left3){ this.contour_left3 = contour_left3; } public Contour_left3 getContour_left3(){ return this.contour_left3; } public void setContour_left4(Contour_left4 contour_left4){ this.contour_left4 = contour_left4; } public Contour_left4 getContour_left4(){ return this.contour_left4; } public void setContour_left5(Contour_left5 contour_left5){ this.contour_left5 = contour_left5; } public Contour_left5 getContour_left5(){ return this.contour_left5; } public void setContour_left6(Contour_left6 contour_left6){ this.contour_left6 = contour_left6; } public Contour_left6 getContour_left6(){ return this.contour_left6; } public void setContour_left7(Contour_left7 contour_left7){ this.contour_left7 = contour_left7; } public Contour_left7 getContour_left7(){ return this.contour_left7; } public void setContour_left8(Contour_left8 contour_left8){ this.contour_left8 = contour_left8; } public Contour_left8 getContour_left8(){ return this.contour_left8; } public void setContour_left9(Contour_left9 contour_left9){ this.contour_left9 = contour_left9; } public Contour_left9 getContour_left9(){ return this.contour_left9; } public void setContour_right1(Contour_right1 contour_right1){ this.contour_right1 = contour_right1; } public Contour_right1 getContour_right1(){ return this.contour_right1; } public void setContour_right2(Contour_right2 contour_right2){ this.contour_right2 = contour_right2; } public Contour_right2 getContour_right2(){ return this.contour_right2; } public void setContour_right3(Contour_right3 contour_right3){ this.contour_right3 = contour_right3; } public Contour_right3 getContour_right3(){ return this.contour_right3; } public void setContour_right4(Contour_right4 contour_right4){ this.contour_right4 = contour_right4; } public Contour_right4 getContour_right4(){ return this.contour_right4; } public void setContour_right5(Contour_right5 contour_right5){ this.contour_right5 = contour_right5; } public Contour_right5 getContour_right5(){ return this.contour_right5; } public void setContour_right6(Contour_right6 contour_right6){ this.contour_right6 = contour_right6; } public Contour_right6 getContour_right6(){ return this.contour_right6; } public void setContour_right7(Contour_right7 contour_right7){ this.contour_right7 = contour_right7; } public Contour_right7 getContour_right7(){ return this.contour_right7; } public void setContour_right8(Contour_right8 contour_right8){ this.contour_right8 = contour_right8; } public Contour_right8 getContour_right8(){ return this.contour_right8; } public void setContour_right9(Contour_right9 contour_right9){ this.contour_right9 = contour_right9; } public Contour_right9 getContour_right9(){ return this.contour_right9; } public void setLeft_eye_bottom(Left_eye_bottom left_eye_bottom){ this.left_eye_bottom = left_eye_bottom; } public Left_eye_bottom getLeft_eye_bottom(){ return this.left_eye_bottom; } public void setLeft_eye_center(Left_eye_center left_eye_center){ this.left_eye_center = left_eye_center; } public Left_eye_center getLeft_eye_center(){ return this.left_eye_center; } public void setLeft_eye_left_corner(Left_eye_left_corner left_eye_left_corner){ this.left_eye_left_corner = left_eye_left_corner; } public Left_eye_left_corner getLeft_eye_left_corner(){ return this.left_eye_left_corner; } public void setLeft_eye_lower_left_quarter(Left_eye_lower_left_quarter left_eye_lower_left_quarter){ this.left_eye_lower_left_quarter = left_eye_lower_left_quarter; } public Left_eye_lower_left_quarter getLeft_eye_lower_left_quarter(){ return this.left_eye_lower_left_quarter; } public void setLeft_eye_lower_right_quarter(Left_eye_lower_right_quarter left_eye_lower_right_quarter){ this.left_eye_lower_right_quarter = left_eye_lower_right_quarter; } public Left_eye_lower_right_quarter getLeft_eye_lower_right_quarter(){ return this.left_eye_lower_right_quarter; } public void setLeft_eye_pupil(Left_eye_pupil left_eye_pupil){ this.left_eye_pupil = left_eye_pupil; } public Left_eye_pupil getLeft_eye_pupil(){ return this.left_eye_pupil; } public void setLeft_eye_right_corner(Left_eye_right_corner left_eye_right_corner){ this.left_eye_right_corner = left_eye_right_corner; } public Left_eye_right_corner getLeft_eye_right_corner(){ return this.left_eye_right_corner; } public void setLeft_eye_top(Left_eye_top left_eye_top){ this.left_eye_top = left_eye_top; } public Left_eye_top getLeft_eye_top(){ return this.left_eye_top; } public void setLeft_eye_upper_left_quarter(Left_eye_upper_left_quarter left_eye_upper_left_quarter){ this.left_eye_upper_left_quarter = left_eye_upper_left_quarter; } public Left_eye_upper_left_quarter getLeft_eye_upper_left_quarter(){ return this.left_eye_upper_left_quarter; } public void setLeft_eye_upper_right_quarter(Left_eye_upper_right_quarter left_eye_upper_right_quarter){ this.left_eye_upper_right_quarter = left_eye_upper_right_quarter; } public Left_eye_upper_right_quarter getLeft_eye_upper_right_quarter(){ return this.left_eye_upper_right_quarter; } public void setLeft_eyebrow_left_corner(Left_eyebrow_left_corner left_eyebrow_left_corner){ this.left_eyebrow_left_corner = left_eyebrow_left_corner; } public Left_eyebrow_left_corner getLeft_eyebrow_left_corner(){ return this.left_eyebrow_left_corner; } public void setLeft_eyebrow_lower_left_quarter(Left_eyebrow_lower_left_quarter left_eyebrow_lower_left_quarter){ this.left_eyebrow_lower_left_quarter = left_eyebrow_lower_left_quarter; } public Left_eyebrow_lower_left_quarter getLeft_eyebrow_lower_left_quarter(){ return this.left_eyebrow_lower_left_quarter; } public void setLeft_eyebrow_lower_middle(Left_eyebrow_lower_middle left_eyebrow_lower_middle){ this.left_eyebrow_lower_middle = left_eyebrow_lower_middle; } public Left_eyebrow_lower_middle getLeft_eyebrow_lower_middle(){ return this.left_eyebrow_lower_middle; } public void setLeft_eyebrow_lower_right_quarter(Left_eyebrow_lower_right_quarter left_eyebrow_lower_right_quarter){ this.left_eyebrow_lower_right_quarter = left_eyebrow_lower_right_quarter; } public Left_eyebrow_lower_right_quarter getLeft_eyebrow_lower_right_quarter(){ return this.left_eyebrow_lower_right_quarter; } public void setLeft_eyebrow_right_corner(Left_eyebrow_right_corner left_eyebrow_right_corner){ this.left_eyebrow_right_corner = left_eyebrow_right_corner; } public Left_eyebrow_right_corner getLeft_eyebrow_right_corner(){ return this.left_eyebrow_right_corner; } public void setLeft_eyebrow_upper_left_quarter(Left_eyebrow_upper_left_quarter left_eyebrow_upper_left_quarter){ this.left_eyebrow_upper_left_quarter = left_eyebrow_upper_left_quarter; } public Left_eyebrow_upper_left_quarter getLeft_eyebrow_upper_left_quarter(){ return this.left_eyebrow_upper_left_quarter; } public void setLeft_eyebrow_upper_middle(Left_eyebrow_upper_middle left_eyebrow_upper_middle){ this.left_eyebrow_upper_middle = left_eyebrow_upper_middle; } public Left_eyebrow_upper_middle getLeft_eyebrow_upper_middle(){ return this.left_eyebrow_upper_middle; } public void setLeft_eyebrow_upper_right_quarter(Left_eyebrow_upper_right_quarter left_eyebrow_upper_right_quarter){ this.left_eyebrow_upper_right_quarter = left_eyebrow_upper_right_quarter; } public Left_eyebrow_upper_right_quarter getLeft_eyebrow_upper_right_quarter(){ return this.left_eyebrow_upper_right_quarter; } public void setMouth_left_corner(Mouth_left_corner mouth_left_corner){ this.mouth_left_corner = mouth_left_corner; } public Mouth_left_corner getMouth_left_corner(){ return this.mouth_left_corner; } public void setMouth_lower_lip_bottom(Mouth_lower_lip_bottom mouth_lower_lip_bottom){ this.mouth_lower_lip_bottom = mouth_lower_lip_bottom; } public Mouth_lower_lip_bottom getMouth_lower_lip_bottom(){ return this.mouth_lower_lip_bottom; } public void setMouth_lower_lip_left_contour1(Mouth_lower_lip_left_contour1 mouth_lower_lip_left_contour1){ this.mouth_lower_lip_left_contour1 = mouth_lower_lip_left_contour1; } public Mouth_lower_lip_left_contour1 getMouth_lower_lip_left_contour1(){ return this.mouth_lower_lip_left_contour1; } public void setMouth_lower_lip_left_contour2(Mouth_lower_lip_left_contour2 mouth_lower_lip_left_contour2){ this.mouth_lower_lip_left_contour2 = mouth_lower_lip_left_contour2; } public Mouth_lower_lip_left_contour2 getMouth_lower_lip_left_contour2(){ return this.mouth_lower_lip_left_contour2; } public void setMouth_lower_lip_left_contour3(Mouth_lower_lip_left_contour3 mouth_lower_lip_left_contour3){ this.mouth_lower_lip_left_contour3 = mouth_lower_lip_left_contour3; } public Mouth_lower_lip_left_contour3 getMouth_lower_lip_left_contour3(){ return this.mouth_lower_lip_left_contour3; } public void setMouth_lower_lip_right_contour1(Mouth_lower_lip_right_contour1 mouth_lower_lip_right_contour1){ this.mouth_lower_lip_right_contour1 = mouth_lower_lip_right_contour1; } public Mouth_lower_lip_right_contour1 getMouth_lower_lip_right_contour1(){ return this.mouth_lower_lip_right_contour1; } public void setMouth_lower_lip_right_contour2(Mouth_lower_lip_right_contour2 mouth_lower_lip_right_contour2){ this.mouth_lower_lip_right_contour2 = mouth_lower_lip_right_contour2; } public Mouth_lower_lip_right_contour2 getMouth_lower_lip_right_contour2(){ return this.mouth_lower_lip_right_contour2; } public void setMouth_lower_lip_right_contour3(Mouth_lower_lip_right_contour3 mouth_lower_lip_right_contour3){ this.mouth_lower_lip_right_contour3 = mouth_lower_lip_right_contour3; } public Mouth_lower_lip_right_contour3 getMouth_lower_lip_right_contour3(){ return this.mouth_lower_lip_right_contour3; } public void setMouth_lower_lip_top(Mouth_lower_lip_top mouth_lower_lip_top){ this.mouth_lower_lip_top = mouth_lower_lip_top; } public Mouth_lower_lip_top getMouth_lower_lip_top(){ return this.mouth_lower_lip_top; } public void setMouth_right_corner(Mouth_right_corner mouth_right_corner){ this.mouth_right_corner = mouth_right_corner; } public Mouth_right_corner getMouth_right_corner(){ return this.mouth_right_corner; } public void setMouth_upper_lip_bottom(Mouth_upper_lip_bottom mouth_upper_lip_bottom){ this.mouth_upper_lip_bottom = mouth_upper_lip_bottom; } public Mouth_upper_lip_bottom getMouth_upper_lip_bottom(){ return this.mouth_upper_lip_bottom; } public void setMouth_upper_lip_left_contour1(Mouth_upper_lip_left_contour1 mouth_upper_lip_left_contour1){ this.mouth_upper_lip_left_contour1 = mouth_upper_lip_left_contour1; } public Mouth_upper_lip_left_contour1 getMouth_upper_lip_left_contour1(){ return this.mouth_upper_lip_left_contour1; } public void setMouth_upper_lip_left_contour2(Mouth_upper_lip_left_contour2 mouth_upper_lip_left_contour2){ this.mouth_upper_lip_left_contour2 = mouth_upper_lip_left_contour2; } public Mouth_upper_lip_left_contour2 getMouth_upper_lip_left_contour2(){ return this.mouth_upper_lip_left_contour2; } public void setMouth_upper_lip_left_contour3(Mouth_upper_lip_left_contour3 mouth_upper_lip_left_contour3){ this.mouth_upper_lip_left_contour3 = mouth_upper_lip_left_contour3; } public Mouth_upper_lip_left_contour3 getMouth_upper_lip_left_contour3(){ return this.mouth_upper_lip_left_contour3; } public void setMouth_upper_lip_right_contour1(Mouth_upper_lip_right_contour1 mouth_upper_lip_right_contour1){ this.mouth_upper_lip_right_contour1 = mouth_upper_lip_right_contour1; } public Mouth_upper_lip_right_contour1 getMouth_upper_lip_right_contour1(){ return this.mouth_upper_lip_right_contour1; } public void setMouth_upper_lip_right_contour2(Mouth_upper_lip_right_contour2 mouth_upper_lip_right_contour2){ this.mouth_upper_lip_right_contour2 = mouth_upper_lip_right_contour2; } public Mouth_upper_lip_right_contour2 getMouth_upper_lip_right_contour2(){ return this.mouth_upper_lip_right_contour2; } public void setMouth_upper_lip_right_contour3(Mouth_upper_lip_right_contour3 mouth_upper_lip_right_contour3){ this.mouth_upper_lip_right_contour3 = mouth_upper_lip_right_contour3; } public Mouth_upper_lip_right_contour3 getMouth_upper_lip_right_contour3(){ return this.mouth_upper_lip_right_contour3; } public void setMouth_upper_lip_top(Mouth_upper_lip_top mouth_upper_lip_top){ this.mouth_upper_lip_top = mouth_upper_lip_top; } public Mouth_upper_lip_top getMouth_upper_lip_top(){ return this.mouth_upper_lip_top; } public void setNose_contour_left1(Nose_contour_left1 nose_contour_left1){ this.nose_contour_left1 = nose_contour_left1; } public Nose_contour_left1 getNose_contour_left1(){ return this.nose_contour_left1; } public void setNose_contour_left2(Nose_contour_left2 nose_contour_left2){ this.nose_contour_left2 = nose_contour_left2; } public Nose_contour_left2 getNose_contour_left2(){ return this.nose_contour_left2; } public void setNose_contour_left3(Nose_contour_left3 nose_contour_left3){ this.nose_contour_left3 = nose_contour_left3; } public Nose_contour_left3 getNose_contour_left3(){ return this.nose_contour_left3; } public void setNose_contour_lower_middle(Nose_contour_lower_middle nose_contour_lower_middle){ this.nose_contour_lower_middle = nose_contour_lower_middle; } public Nose_contour_lower_middle getNose_contour_lower_middle(){ return this.nose_contour_lower_middle; } public void setNose_contour_right1(Nose_contour_right1 nose_contour_right1){ this.nose_contour_right1 = nose_contour_right1; } public Nose_contour_right1 getNose_contour_right1(){ return this.nose_contour_right1; } public void setNose_contour_right2(Nose_contour_right2 nose_contour_right2){ this.nose_contour_right2 = nose_contour_right2; } public Nose_contour_right2 getNose_contour_right2(){ return this.nose_contour_right2; } public void setNose_contour_right3(Nose_contour_right3 nose_contour_right3){ this.nose_contour_right3 = nose_contour_right3; } public Nose_contour_right3 getNose_contour_right3(){ return this.nose_contour_right3; } public void setNose_left(Nose_left nose_left){ this.nose_left = nose_left; } public Nose_left getNose_left(){ return this.nose_left; } public void setNose_right(Nose_right nose_right){ this.nose_right = nose_right; } public Nose_right getNose_right(){ return this.nose_right; } public void setNose_tip(Nose_tip nose_tip){ this.nose_tip = nose_tip; } public Nose_tip getNose_tip(){ return this.nose_tip; } public void setRight_eye_bottom(Right_eye_bottom right_eye_bottom){ this.right_eye_bottom = right_eye_bottom; } public Right_eye_bottom getRight_eye_bottom(){ return this.right_eye_bottom; } public void setRight_eye_center(Right_eye_center right_eye_center){ this.right_eye_center = right_eye_center; } public Right_eye_center getRight_eye_center(){ return this.right_eye_center; } public void setRight_eye_left_corner(Right_eye_left_corner right_eye_left_corner){ this.right_eye_left_corner = right_eye_left_corner; } public Right_eye_left_corner getRight_eye_left_corner(){ return this.right_eye_left_corner; } public void setRight_eye_lower_left_quarter(Right_eye_lower_left_quarter right_eye_lower_left_quarter){ this.right_eye_lower_left_quarter = right_eye_lower_left_quarter; } public Right_eye_lower_left_quarter getRight_eye_lower_left_quarter(){ return this.right_eye_lower_left_quarter; } public void setRight_eye_lower_right_quarter(Right_eye_lower_right_quarter right_eye_lower_right_quarter){ this.right_eye_lower_right_quarter = right_eye_lower_right_quarter; } public Right_eye_lower_right_quarter getRight_eye_lower_right_quarter(){ return this.right_eye_lower_right_quarter; } public void setRight_eye_pupil(Right_eye_pupil right_eye_pupil){ this.right_eye_pupil = right_eye_pupil; } public Right_eye_pupil getRight_eye_pupil(){ return this.right_eye_pupil; } public void setRight_eye_right_corner(Right_eye_right_corner right_eye_right_corner){ this.right_eye_right_corner = right_eye_right_corner; } public Right_eye_right_corner getRight_eye_right_corner(){ return this.right_eye_right_corner; } public void setRight_eye_top(Right_eye_top right_eye_top){ this.right_eye_top = right_eye_top; } public Right_eye_top getRight_eye_top(){ return this.right_eye_top; } public void setRight_eye_upper_left_quarter(Right_eye_upper_left_quarter right_eye_upper_left_quarter){ this.right_eye_upper_left_quarter = right_eye_upper_left_quarter; } public Right_eye_upper_left_quarter getRight_eye_upper_left_quarter(){ return this.right_eye_upper_left_quarter; } public void setRight_eye_upper_right_quarter(Right_eye_upper_right_quarter right_eye_upper_right_quarter){ this.right_eye_upper_right_quarter = right_eye_upper_right_quarter; } public Right_eye_upper_right_quarter getRight_eye_upper_right_quarter(){ return this.right_eye_upper_right_quarter; } public void setRight_eyebrow_left_corner(Right_eyebrow_left_corner right_eyebrow_left_corner){ this.right_eyebrow_left_corner = right_eyebrow_left_corner; } public Right_eyebrow_left_corner getRight_eyebrow_left_corner(){ return this.right_eyebrow_left_corner; } public void setRight_eyebrow_lower_left_quarter(Right_eyebrow_lower_left_quarter right_eyebrow_lower_left_quarter){ this.right_eyebrow_lower_left_quarter = right_eyebrow_lower_left_quarter; } public Right_eyebrow_lower_left_quarter getRight_eyebrow_lower_left_quarter(){ return this.right_eyebrow_lower_left_quarter; } public void setRight_eyebrow_lower_middle(Right_eyebrow_lower_middle right_eyebrow_lower_middle){ this.right_eyebrow_lower_middle = right_eyebrow_lower_middle; } public Right_eyebrow_lower_middle getRight_eyebrow_lower_middle(){ return this.right_eyebrow_lower_middle; } public void setRight_eyebrow_lower_right_quarter(Right_eyebrow_lower_right_quarter right_eyebrow_lower_right_quarter){ this.right_eyebrow_lower_right_quarter = right_eyebrow_lower_right_quarter; } public Right_eyebrow_lower_right_quarter getRight_eyebrow_lower_right_quarter(){ return this.right_eyebrow_lower_right_quarter; } public void setRight_eyebrow_right_corner(Right_eyebrow_right_corner right_eyebrow_right_corner){ this.right_eyebrow_right_corner = right_eyebrow_right_corner; } public Right_eyebrow_right_corner getRight_eyebrow_right_corner(){ return this.right_eyebrow_right_corner; } public void setRight_eyebrow_upper_left_quarter(Right_eyebrow_upper_left_quarter right_eyebrow_upper_left_quarter){ this.right_eyebrow_upper_left_quarter = right_eyebrow_upper_left_quarter; } public Right_eyebrow_upper_left_quarter getRight_eyebrow_upper_left_quarter(){ return this.right_eyebrow_upper_left_quarter; } public void setRight_eyebrow_upper_middle(Right_eyebrow_upper_middle right_eyebrow_upper_middle){ this.right_eyebrow_upper_middle = right_eyebrow_upper_middle; } public Right_eyebrow_upper_middle getRight_eyebrow_upper_middle(){ return this.right_eyebrow_upper_middle; } public void setRight_eyebrow_upper_right_quarter(Right_eyebrow_upper_right_quarter right_eyebrow_upper_right_quarter){ this.right_eyebrow_upper_right_quarter = right_eyebrow_upper_right_quarter; } public Right_eyebrow_upper_right_quarter getRight_eyebrow_upper_right_quarter(){ return this.right_eyebrow_upper_right_quarter; } } public class Faces { private Attributes attributes; private Face_rectangle face_rectangle; private String face_token; private Landmark landmark; public void setAttributes(Attributes attributes){ this.attributes = attributes; } public Attributes getAttributes(){ return this.attributes; } public void setFace_rectangle(Face_rectangle face_rectangle){ this.face_rectangle = face_rectangle; } public Face_rectangle getFace_rectangle(){ return this.face_rectangle; } public void setFace_token(String face_token){ this.face_token = face_token; } public String getFace_token(){ return this.face_token; } public void setLandmark(Landmark landmark){ this.landmark = landmark; } public Landmark getLandmark(){ return this.landmark; } @Override public String toString() { return "Faces{" + "attributes=" + attributes + ", face_rectangle=" + face_rectangle + ", face_token=\'" + face_token + \'\\'\' + ", landmark=" + landmark + \'}\'; } } }
如果不需要检测出来的点,可以使用该实体类:
import java.util.List; /** * 人脸属性值 */ public class DataBean { private List<Faces> faces; private String image_id; private String request_id; private int time_used; public void setFaces(List<Faces> faces){ this.faces = faces; } public List<Faces> getFaces(){ return this.faces; } public void setImage_id(String image_id){ this.image_id = image_id; } public String getImage_id(){ return this.image_id; } public void setRequest_id(String request_id){ this.request_id = request_id; } public String getRequest_id(){ return this.request_id; } public void setTime_used(int time_used){ this.time_used = time_used; } public int getTime_used(){ return this.time_used; } public class Age { private int value; public void setValue(int value){ this.value = value; } public int getValue(){ return this.value; } @Override public String toString() { return "年龄=" + value ; } } public class Blurness { private int threshold; private double value; public void setThreshold(int threshold){ this.threshold = threshold; } public int getThreshold(){ return this.threshold; } public void setValue(double value){ this.value = value; } public double getValue(){ return this.value; } } public class Gaussianblur { private int threshold; private double value; public void setThreshold(int threshold){ this.threshold = threshold; } public int getThreshold(){ return this.threshold; } public void setValue(double value){ this.value = value; } public double getValue(){ return this.value; } } public class Motionblur { private int threshold; private double value; public void setThreshold(int threshold){ this.threshold = threshold; } public int getThreshold(){ return this.threshold; } public void setValue(double value){ this.value = value; } public double getValue(){ return this.value; } } public class Blur { private Blurness blurness; private Gaussianblur gaussianblur; private Motionblur motionblur; public void setBlurness(Blurness blurness){ this.blurness = blurness; } public Blurness getBlurness(){ return this.blurness; } public void setGaussianblur(Gaussianblur gaussianblur){ this.gaussianblur = gaussianblur; } public Gaussianblur getGaussianblur(){ return this.gaussianblur; } public void setMotionblur(Motionblur motionblur){ this.motionblur = motionblur; } public Motionblur getMotionblur(){ return this.motionblur; } } public class Ethnicity { private String value; public void setValue(String value){ this.value = value; } public String getValue(){ return this.value; } @Override public String toString() { return "人种{" + "value=\'" + value + \'\\'\' + \'}\'; } } public class Facequality { private double threshold; private double value; public void setThreshold(double threshold){ this.threshold = threshold; } public double getThreshold(){ return this.threshold; } public void setValue(double value){ this.value = value; } public double getValue(){ return this.value; } @Override public String toString() { return "人脸质量{" + "threshold=" + threshold + ", value=" + value + \'}\'; } } public class Gender { private String value; public void setValue(String value){ this.value = value; } public String getValue(){ return this.value; } @Override public String toString() { return "性别{" + "value=\'" + value + \'\\'\' + \'}\'; } } public class Glass { private String value; public void setValue(String value){ this.value = value; } public String getValue(){ return this.value; } } public class Smile { private double threshold; private double value; public void setThreshold(double threshold){ this.threshold = threshold; } public double getThreshold(){ return this.threshold; } public void setValue(double value){ this.value = value; } public double getValue(){ return this.value; } @Override public String toString() { return "笑容分享{" + "threshold=" + threshold + ", value=" + value + \'}\'; } } public class Attributes { private Age age;//年龄 private Blur blur; /** * ethnicity: 人种分析结果,value的值为Asian/White/Black。Asian代表亚洲人,White代表白人,Black代表黑人。 */ private Ethnicity ethnicity; //private Eyestatus eyestatus;// 眼睛状态信息 包括 le /** * facequality: 人脸质量判断结果,value值为人脸的质量判断的分数,是一个浮点数,范围[0,100], 小数点后3位有效数字。threshold表示人脸质量基本合格的一个阈值,超过该阈值的人脸适合用于人脸比对。 */ private Facequality facequality; /** * gender:性别分析结果,value的值为Male/Female。Male 代表男性,Female代表女性。 */ private Gender gender; /** * 是否佩戴眼镜的分析结果,value的值为None/Dark/Normal。None代表不佩戴眼镜,Dark代表佩戴墨镜,Normal代表佩戴普通眼镜。(请注意,motionblur 和 gaussianblur 将于2017-4-30日停止返回,请尽快停用) headpose:人脸姿势分析结果,包括pitch_angle, roll_angle, yaw_angle,分别对应抬头,旋转(平面旋转),摇头。单位为角度。 */ private Glass glass; /** * smiling:笑容分析结果,value的值为一个[0,100]的浮点数,小数点后3位有效数字,数值大表示笑程度高。threshold代表笑容的阈值,超过该阈值认为有笑容。 */ private Smile smile; public void setAge(Age age){ this.age = age; } public Age getAge(){ return this.age; } public void setBlur(Blur blur){ this.blur = blur; } public Blur getBlur(){ return this.blur; } public void setEthnicity(Ethnicity ethnicity){ this.ethnicity = ethnicity; } public Ethnicity getEthnicity(){ return this.ethnicity; } public void setFacequality(Facequality facequality){ this.facequality = facequality; } public Facequality getFacequality(){ return this.facequality; } public void setGender(Gender gender){ this.gender = gender; } public Gender getGender(){ return this.gender; } public void setGlass(Glass glass){ this.glass = glass; } public Glass getGlass(){ return this.glass; } public void setSmile(Smile smile){ this.smile = smile; } public Smile getSmile(){ return this.smile; } @Override public String toString() { return "Attributes{" + "age=" + age + ", blur=" + blur + ", ethnicity=" + ethnicity + ", facequality=" + facequality + ", gender=" + gender + ", glass=" + glass + ", smile=" + smile + \'}\'; } } public class Face_rectangle { private int height; private int left; private int top; private int width; public void setHeight(int height){ this.height = height; } public int getHeight(){ return this.height; } public void setLeft(int left){ this.left = left; } public int getLeft(){ return this.left; } public void setTop(int top){ this.top = top; } public int getTop(){ return this.top; } public void setWidth(int width){ this.width = width; } public int getWidth(){ return this.width; } } public class Faces { private Attributes attributes; private Face_rectangle face_rectangle; private String face_token; public void setAttributes(Attributes attributes){ this.attributes = attributes; } public Attributes getAttributes(){ return this.attributes; } public void setFace_rectangle(Face_rectangle face_rectangle){ this.face_rectangle = face_rectangle; } public Face_rectangle getFace_rectangle(){ return this.face_rectangle; } public void setFace_token(String face_token){ this.face_token = face_token; } public String getFace_token(){ return this.face_token; } @Override public String toString() { return "Faces{" + "attributes=" + attributes + ", face_rectangle=" + face_rectangle + ", face_token=\'" + face_token + \'\\'\' + \'}\'; } } }
添加权限:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.CAMERA" />
效果图