face-transform
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFace Transform
人脸变换
Analyze and transform faces through AceDataCloud's Face API suite.
Setup: See authentication for token setup.
通过AceDataCloud的人脸API套件进行人脸分析与变换。
设置: 请查看身份验证文档进行令牌设置。
Quick Start
快速开始
bash
curl -X POST https://api.acedata.cloud/face/analyze \
-H "Authorization: Bearer $ACEDATACLOUD_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"image_url": "https://example.com/portrait.jpg"}'bash
curl -X POST https://api.acedata.cloud/face/analyze \
-H "Authorization: Bearer $ACEDATACLOUD_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"image_url": "https://example.com/portrait.jpg"}'Available APIs
可用API
| Endpoint | Purpose | Description |
|---|---|---|
| Face Detection | Detect face keypoints (90+ points per face) |
| Beautification | Apply beauty/decoration effects |
| Age Transform | Make a face look older or younger |
| Gender Swap | Transform facial gender characteristics |
| Face Swap | Replace one person's face with another |
| Cartoon Style | Convert portrait to animated/cartoon style |
| Liveness Check | Detect if a face image is from a live person |
| 接口 | 用途 | 描述 |
|---|---|---|
| 人脸检测 | 检测人脸关键点(每张人脸90+个关键点) |
| 人像美化 | 应用美颜/装饰效果 |
| 年龄变换 | 让人脸看起来更老或更年轻 |
| 性别转换 | 变换面部性别特征 |
| 人脸互换 | 将一个人的脸替换为另一个人的脸 |
| 卡通风格 | 将人像转换为动画/卡通风格 |
| 活体检测 | 检测人脸图像是否来自真人 |
Workflows
工作流程
1. Face Analysis
1. 人脸分析
Detect faces and extract 90+ keypoints per face.
json
POST /face/analyze
{
"image_url": "https://example.com/photo.jpg"
}Response includes detailed keypoints: , , , , , , — each as arrays of coordinates.
nosemouthleft_eyeright_eyeleft_eyebrowright_eyebrowcontour{x, y}检测人脸并提取每张人脸的90+个关键点。
json
POST /face/analyze
{
"image_url": "https://example.com/photo.jpg"
}响应包含详细的关键点:、、、、、、 —— 每个都是坐标数组。
nosemouthleft_eyeright_eyeleft_eyebrowright_eyebrowcontour{x, y}2. Face Beautification
2. 人像美化
json
POST /face/beautify
{
"image_url": "https://example.com/portrait.jpg"
}json
POST /face/beautify
{
"image_url": "https://example.com/portrait.jpg"
}3. Age Transformation
3. 年龄变换
json
POST /face/change-age
{
"image_url": "https://example.com/portrait.jpg"
}json
POST /face/change-age
{
"image_url": "https://example.com/portrait.jpg"
}4. Gender Swap
4. 性别转换
json
POST /face/change-gender
{
"image_url": "https://example.com/portrait.jpg"
}json
POST /face/change-gender
{
"image_url": "https://example.com/portrait.jpg"
}5. Face Swap
5. 人脸互换
Replace the face in the target image with the face from the source.
json
POST /face/swap
{
"source_image_url": "https://example.com/source-face.jpg",
"target_image_url": "https://example.com/target-person.jpg"
}将目标图像中的人脸替换为源图像中的人脸。
json
POST /face/swap
{
"source_image_url": "https://example.com/source-face.jpg",
"target_image_url": "https://example.com/target-person.jpg"
}6. Cartoon Style
6. 卡通风格转换
json
POST /face/cartoon
{
"image_url": "https://example.com/portrait.jpg"
}json
POST /face/cartoon
{
"image_url": "https://example.com/portrait.jpg"
}7. Liveness Detection
7. 活体检测
json
POST /face/detect-live
{
"image_url": "https://example.com/face-photo.jpg"
}json
POST /face/detect-live
{
"image_url": "https://example.com/face-photo.jpg"
}Parameters
参数
Common
通用参数
| Parameter | Required | Description |
|---|---|---|
| Yes (most endpoints) | Source face image URL |
| 参数 | 是否必填 | 描述 |
|---|---|---|
| 是(大多数接口) | 源人脸图像URL |
/face/swap
/face/swap/face/swap
/face/swap| Parameter | Required | Description |
|---|---|---|
| Yes | URL of the face to use (replaces the face) |
| Yes | URL of the image to put the face onto |
| No | Webhook URL for async delivery |
| No | Max wait time in seconds (default: 120) |
| 参数 | 是否必填 | 描述 |
|---|---|---|
| 是 | 要使用的人脸URL(用于替换) |
| 是 | 要合成人脸的目标图像URL |
| 否 | 用于异步交付的Webhook URL |
| 否 | 最大等待时间(秒,默认值:120) |
/face/beautify
/face/beautify/face/beautify
/face/beautify| Parameter | Required | Description |
|---|---|---|
| Yes | Image URL |
| No | Skin smoothing 0–100 (default: 10) |
| No | Whitening 0–100 (default: 30) |
| No | Face slimming 0–100 (default: 70) |
| No | Eye enlarging 0–100 (default: 70) |
| 参数 | 是否必填 | 描述 |
|---|---|---|
| 是 | 图像URL |
| 否 | 磨皮程度 0–100(默认值:10) |
| 否 | 美白程度 0–100(默认值:30) |
| 否 | 瘦脸程度 0–100(默认值:70) |
| 否 | 大眼程度 0–100(默认值:70) |
/face/analyze
/face/analyze/face/analyze
/face/analyze| Parameter | Required | Description |
|---|---|---|
| Yes | Image URL |
| No | |
| No | Algorithm version (recommended: |
| No | |
| 参数 | 是否必填 | 描述 |
|---|---|---|
| 是 | 图像URL |
| 否 | |
| 否 | 算法版本(推荐: |
| 否 | |
Gotchas
注意事项
- All face APIs return results synchronously. additionally supports an optional
/face/swapparameter for async delivery (pass it to receive the result via webhook instead of waiting inline)callback_url - Face analyze returns 90+ keypoints per detected face, supporting multiple faces in one image
- Face swap uses (the face to apply) and
source_image_url(the body to apply it to)target_image_url - All APIs are currently in Alpha stage — interfaces may evolve
- Images should contain clearly visible, front-facing faces for best results
- Liveness detection helps distinguish live photos from printed/screen photos
- 所有人脸API均同步返回结果。额外支持可选的
/face/swap参数用于异步交付(传入该参数后,将通过Webhook接收结果,而非等待即时响应)callback_url - 人脸分析接口会为每个检测到的人脸返回90+个关键点,支持单张图像中的多个人脸
- 人脸互换接口使用(要应用的人脸)和
source_image_url(要合成的主体)target_image_url - 所有API目前处于Alpha阶段——接口可能会迭代更新
- 为获得最佳效果,图像应包含清晰可见的正面人脸
- 活体检测可帮助区分真人照片与打印/屏幕显示的照片