AI之API:人工智能领域之国内外各大人工智能平台(百度云/华为云/阿里云/Face++等)及其API的简介、使用方法之详细攻略

目录

一、百度云api

1、api之CV

二、旷视科技(face++)api

1、api之CV

三、阿里云api

1、api之CV

四、腾讯云api

1、api之CV

五、华为云api

1、api之CV


一、百度云api

1、api之CV

CV之FR:基于百度API接口实现对人脸图片(国内外明星/企业家)进行人脸预测(性别/年龄/颜值)代码实现

二、旷视科技(face++)api

1、api之CV

Detect API    文档中心/Detect API描述

传入图片进行人脸检测和人脸分析。
可以检测图片内的所有人脸,对于每个检测出的人脸,会给出其唯一标识 face_token,可用于后续的人脸分析、人脸比对等操作。对于正式 API Key,支持指定图片的某一区域进行人脸检测。
本 API 支持对检测到的人脸直接进行分析,获得人脸的关键点和各类属性信息。对于试用 API Key,最多只对人脸框面积最大的 5 个人脸进行分析,其他检测到的人脸可以使用 Face Analyze API 进行分析。对于正式 API Key,支持分析所有检测到的人脸。

关于 face_token

如果您需要将检测出的人脸用于后续的分析、比对等操作,建议将对应的 face_token 添加到 FaceSet 中。如果一个 face_token 在 72 小时内没有存放在任一 FaceSet 中,则该 face_token 将会失效。如果对同一张图片进行多次人脸检测,同一个人脸得到的 face_token 是不同的。

图片要求

图片格式:JPG(JPEG),PNG
图片像素尺寸:最小 48*48 像素,最大 4096*4096 像素
图片文件大小:2 MB
最小人脸像素尺寸: 系统能够检测到的人脸框为一个正方形,正方形边长的最小值为图像短边长度的 48 分之一,最小值不低于 48 像素。 例如图片为 4096*3200 像素,则最小人脸像素尺寸为 66*66 像素。
请求返回的内容
r = requests.post(url=url, files=file, data=params)
print(points) #输出的内容为以下

{"image_id": "qgdLY0……PEg==", "request_id": "1531563……a1", "time_used": 166, 
"faces": [{"landmark": 
           {
            "contour_chin": {"y": 382, "x": 399}, 
            "left_eye_upper_left_quarter": {"y": 218, "x": 327}, 
            "mouth_lower_lip_right_contour1": {"y": 322, "x": 410}, 
            "left_eye_bottom": {"y": 231, "x": 338}, 
            "mouth_lower_lip_right_contour2": {"y": 329, "x": 419}, 
            "contour_left7": {"y": 296, "x": 305}, 
            "contour_left6": {"y": 283, "x": 301}, 
            "contour_left5": {"y": 270, "x": 299}, 
            "contour_left4": {"y": 257, "x": 296}, 
            "contour_left3": {"y": 243, "x": 295}, 
            "contour_left2": {"y": 230, "x": 295}, 
            "contour_left1": {"y": 216, "x": 296}, 
            "left_eye_lower_left_quarter": {"y": 230, "x": 328}, 
            "contour_right1": {"y": 203, "x": 480}, 
            "contour_right3": {"y": 230, "x": 484}, 
            "contour_right2": {"y": 217, "x": 482}, 
            "contour_right5": {"y": 257, "x": 484}, 
            "contour_right4": {"y": 243, "x": 484}, 
            "contour_right7": {"y": 284, "x": 481}, 
            "left_eyebrow_left_corner": {"y": 207, "x": 310}, 
            "right_eye_right_corner": {"y": 217, "x": 454}, 
            "nose_bridge1": {"y": 220, "x": 386}, 
            "nose_bridge3": {"y": 259, "x": 389}, 
            "nose_bridge2": {"y": 239, "x": 387}, 
            "right_eyebrow_upper_left_corner": {"y": 195, "x": 401}, 
            "mouth_upper_lip_right_contour4": {"y": 320, "x": 409}, 
            "mouth_upper_lip_right_contour1": {"y": 309, "x": 401}, 
            "right_eye_left_corner": {"y": 225, "x": 412}, 
            "left_eyebrow_upper_right_corner": {"y": 198, "x": 366}, 
            "left_eyebrow_upper_middle": {"y": 190, "x": 335}, 
            "mouth_lower_lip_right_contour3": {"y": 336, "x": 409}, 
            "nose_left_contour3": {"y": 284, "x": 367}, 
            "mouth_lower_lip_bottom": {"y": 340, "x": 395}, 
            "mouth_upper_lip_right_contour2": {"y": 313, "x": 414}, 
            "left_eye_top": {"y": 215, "x": 339}, 
            "nose_left_contour1": {"y": 227, "x": 374}, 
            "mouth_upper_lip_bottom": {"y": 322, "x": 394}, 
            "mouth_upper_lip_left_contour2": {"y": 316, "x": 373}, 
            "mouth_upper_lip_top": {"y": 312, "x": 393}, 
            "mouth_upper_lip_left_contour1": {"y": 310, "x": 384}, 
            "mouth_upper_lip_left_contour4": {"y": 322, "x": 378}, 
            "right_eye_top": {"y": 209, "x": 432}, 
            "mouth_upper_lip_right_contour3": {"y": 320, "x": 421}, 
            "right_eye_bottom": {"y": 225, "x": 435}, 
            "right_eyebrow_lower_left_corner": {"y": 202, "x": 403}, 
            "mouth_left_corner": {"y": 324, "x": 362}, 
            "nose_middle_contour": {"y": 292, "x": 391}, 
            "right_eye_lower_right_quarter": {"y": 222, "x": 446}, 
            "right_eyebrow_lower_right_quarter": {"y": 195, "x": 452}, 
            "contour_right9": {"y": 310, "x": 476}, 
            "mouth_right_corner": {"y": 319, "x": 426}, 
            "right_eye_lower_left_quarter": {"y": 226, "x": 423}, 
            "right_eye_center": {"y": 215, "x": 432}, 
            "left_eye_upper_right_quarter": {"y": 219, "x": 351}, 
            "right_eyebrow_lower_left_quarter": {"y": 198, "x": 419}, 
            "left_eye_pupil": {"y": 221, "x": 340}, 
            "contour_right8": {"y": 297, "x": 479}, 
            "contour_left13": {"y": 363, "x": 346}, 
            "left_eyebrow_lower_right_quarter": {"y": 203, "x": 350}, 
            "left_eye_right_corner": {"y": 228, "x": 361}, 
            "left_eyebrow_lower_right_corner": {"y": 206, "x": 364}, 
            "mouth_upper_lip_left_contour3": {"y": 323, "x": 367}, 
            "left_eyebrow_lower_left_quarter": {"y": 203, "x": 322}, 
            "mouth_lower_lip_left_contour1": {"y": 324, "x": 378}, 
            "mouth_lower_lip_left_contour3": {"y": 338, "x": 381}, 
            "mouth_lower_lip_left_contour2": {"y": 332, "x": 370}, 
            "contour_left9": {"y": 322, "x": 314}, 
            "left_eye_lower_right_quarter": {"y": 230, "x": 350}, 
            "contour_right6": {"y": 270, "x": 482}, 
            "nose_tip": {"y": 278, "x": 390}, 
            "right_eyebrow_upper_middle": {"y": 185, "x": 435}, 
            "right_eyebrow_lower_middle": {"y": 195, "x": 436}, 
            "left_eye_center": {"y": 221, "x": 340}, 
            "right_eyebrow_upper_left_quarter": {"y": 188, "x": 417}, 
            "right_eyebrow_right_corner": {"y": 196, "x": 468}, 
            "right_eyebrow_upper_right_quarter": {"y": 186, "x": 453}, 
            "contour_left16": {"y": 382, "x": 384}, 
            "contour_left15": {"y": 378, "x": 370}, 
            "contour_left14": {"y": 371, "x": 358}, 
            "left_eyebrow_upper_right_quarter": {"y": 192, "x": 352}, 
            "contour_left12": {"y": 355, "x": 336}, 
            "contour_left11": {"y": 345, "x": 327}, 
            "contour_left10": {"y": 334, "x": 320}, 
            "left_eyebrow_lower_middle": {"y": 202, "x": 336}, 
            "left_eyebrow_upper_left_quarter": {"y": 195, "x": 320}, 
            "right_eye_upper_right_quarter": {"y": 210, "x": 445}, 
            "nose_right_contour4": {"y": 286, "x": 407}, 
            "nose_right_contour5": {"y": 289, "x": 399}, 
            "nose_left_contour4": {"y": 288, "x": 374}, 
            "nose_left_contour5": {"y": 290, "x": 382}, 
            "nose_left_contour2": {"y": 267, "x": 370}, 
            "nose_right_contour1": {"y": 225, "x": 399}, 
            "nose_right_contour2": {"y": 264, "x": 407}, 
            "nose_right_contour3": {"y": 280, "x": 414},
             "left_eye_left_corner": {"y": 226, "x": 320}, 
            "contour_right15": {"y": 373, "x": 428}, 
            "contour_right14": {"y": 365, "x": 440}, 
            "contour_right16": {"y": 379, "x": 415}, 
            "contour_right11": {"y": 335, "x": 466}, 
            "contour_right10": {"y": 323, "x": 472}, 
            "contour_right13": {"y": 356, "x": 450}, 
            "contour_right12": {"y": 346, "x": 458}, 
            "contour_left8": {"y": 309, "x": 309}, 
            "mouth_lower_lip_top": {"y": 324, "x": 393}, 
            "right_eye_upper_left_quarter": {"y": 214, "x": 420}, 
            "right_eye_pupil": {"y": 215, "x": 432}
            }, 
           "face_rectangle": {"width": 196, "top": 187, "left": 294, "height": 196}, 
           "face_token": "52……8"}]
           }

三、阿里云api

1、api之CV

四、腾讯云api

1、api之CV

五、华为云api

1、api之CV