You need to enable JavaScript to run this app.
文档中心
AI 数据湖服务

AI 数据湖服务

复制全文
下载 pdf
视频处理
人脸模糊
复制全文
下载 pdf
人脸模糊
人脸模糊算子面向视频内容提供人脸检测与模糊能力:既可以自动识别视频中的人脸并按指定等级进行模糊处理以保护隐私,也可以输出逐帧人脸边界框 JSON 文件,支持同时输出或单独输出。​
算子介绍​
算子 ID : las_face_blur​
应用场景​
​
场景​
描述​
隐私保护​
在社交媒体、视频分享平台中自动模糊人脸,保护用户隐私​
内容审核​
对用户上传的视频进行人脸模糊处理,满足合规要求​
视频制作​
在新闻、纪录片等制作中保护受访者隐私​
训练/评测数据集中的人脸模糊预处理​
在训练/评测模型时,对数据集中的视频帧进行人脸模糊处理,提高模型泛化能力​
​
核心能力​
  • 支持模糊模式,可对输入视频中的人脸进行模糊处理,返回模糊处理后的视频。​
  • 自动检测视频帧中的人脸并进行模糊处理;​
  • 支持多种模糊类型(马赛克、高斯);​
  • 支持多种不同区域的精细模糊(如脸部椭圆形模糊、贴脸型模糊、眼部区域模糊等)。​
  • 支持通过 outputs 参数灵活指定输出结果:可同时输出打码视频和逐帧人脸 bbox JSON 文件,也可单独输出打码视频或 bbox JSON 文件。​
效果展示​
  • 输入视频​
  • ​
    Replay
    Play
    00:00 / 00:06 Live
    00:00
    Fullscreen
    Cssfullscreen
    1x
    • 2x
    • 1.5x
    • 1x
    • 0.75x
    • 0.5x
    Click and hold to drag
    ​
    ​
  • 人脸椭圆模糊​
  • ​
    Replay
    Play
    00:00 / 00:06 Live
    00:00
    Fullscreen
    Cssfullscreen
    1x
    • 2x
    • 1.5x
    • 1x
    • 0.75x
    • 0.5x
    Click and hold to drag
    ​
    ​
  • 人脸马赛克模糊​
  • ​
    Replay
    Play
    00:00 / 00:06 Live
    00:00
    Fullscreen
    Cssfullscreen
    1x
    • 2x
    • 1.5x
    • 1x
    • 0.75x
    • 0.5x
    Click and hold to drag
    ​
    ​
  • 贴脸模糊​
  • ​
    Replay
    Play
    00:00 / 00:06 Live
    00:00
    Fullscreen
    Cssfullscreen
    1x
    • 2x
    • 1.5x
    • 1x
    • 0.75x
    • 0.5x
    Click and hold to drag
    ​
    ​
  • 眼部模糊​
  • ​
    Replay
    Play
    00:00 / 00:06 Live
    00:00
    Fullscreen
    Cssfullscreen
    1x
    • 2x
    • 1.5x
    • 1x
    • 0.75x
    • 0.5x
    Click and hold to drag
    ​
    ​
​
​​
【人脸 bbox 识别与同步打码示例】​
  • 效果说明​
  • 识别视频逐帧的人脸位置,输出 bbox JSON。​
  • 对检出的人脸进行高斯模糊,并在输出视频中绘制 bbox。​
  • bbox 格式为 [x1, y1, x2, y2],坐标基于原视频画面的像素坐标系。​
  • bbox 结果节选​
  • ​
    {​
    "frame_index": 7,​
    "faces": [​
    {​
    "box": [575, 780, 606, 818],​
    "confidence": 0.608485​
    }​
    ]​
    }​
    ​
  • 核心参数示例​
  • ​
    "data": {​
    "url": "tos://<your_bucket_name>/input.mp4",​
    "output_tos_path": "tos://<your_bucket_name>/output/",​
    "output_filename": "face-gaussian.mp4",​
    "outputs": ["video", "bbox"],​
    "blur_mode": "face",​
    "blur_type": "gaussian",​
    "blur_strength": 99,​
    "confidence_threshold": 0.6,​
    "draw_box": true,​
    "preserve_audio": true​
    }​
    ​
  • outputs 同时指定 video 和 bbox 后,算子会在同一输出目录中生成打码视频和 bbox JSON 文件。draw_box=true 用于在打码视频上同步绘制人脸框。​
  • 带 bbox 和高斯打码的输出效果​
  • ​
    Replay
    Play
    00:00 / 00:00 Live
    00:00
    Fullscreen
    Cssfullscreen
    1x
    • 2x
    • 1.5x
    • 1x
    • 0.75x
    • 0.5x
    Click and hold to drag
    ​
    ​
  • 完整 bbox 结果​
​
支持的地域​
  • 北京:cn-beijing​
  • 上海:cn-shanghai​
  • 广州:cn-guangzhou​
算子性能​
​
细分项​
性能影响说明​
最大 RPM​
600​
最大并发度​
10​
耗时​
  • 与视频时长正相关。​
​
输入与输出要求​
输入要求​
​
细分​
详细说明​
支持的输入数据模态​
  • 视频​
输入格式:视频​
  • 格式:mp4, mov, avi, mkv、flv、webm 等常见格式​
  • 大小:最大 10 GB。​
输入路径要求​
通过请求参数 url提供给算子输入数据,当前支持公网 URL、TOS 路径这几种方式。​
  • 公网 URL:公网可访问的视频 URL,格式为 http/https。​
  • TOS 路径:将待处理数据上传至与当前 LAS 服务同主账号、同地域的 TOS Bucket后,可提供 TOS 路径,格式为tos://bucket_name/demo。​
​
输出要求​
​
细分​
详细说明​
输出数据模态​
  • 视频​
  • 文本(人脸检测 bbox JSON 文件)​
输出格式:视频​
  • 格式、分辨率、时长等与原视频保持一致​
输出路径:TOS​
通过请求参数output_tos_path 指定算子输出结果的存储路径,当前支持设置为 TOS 路径。​
  • TOS 路径:与LAS服务同主账号、同地域下,有可写权限的 TOS Bucket 目录。​
​
计费说明​
  • 计费标准​
  • ​
    细分项​
    计费标准说明​
    计费项​
    按输出视频的时长统计用量进行计费。​
    计费类型​
    按量计费,单位:元/分钟,按实际的计费用量每小时出账。计费精度:四舍五入​
    单价​
    0.1 元/分钟​
    ​
  • 计费详情​
  • 计费公式:总费用 = 单价 * 用量​
注意与前提​
​
细分项​
注意与前提​
开通 LAS​
  • 如果您是一个全新的火山引擎用户,此前未开通过 LAS 产品,您可先开通 LAS,不使用 LAS 的计费功能仅开通 LAS 产品不会产生费用。开通操作请参见准备工作。​
费用​
调用算子前,您需先了解使用算子时的模型调用费用,详情请参见大模型调用计费。​
鉴权(API Key)​
调用算子前,您需要先生成算子调用的API Key,并建议将API Key配置为环境变量,便于更安全地调用算子,详情请参见获取 API Key 并配置。​
BaseURL​
调用算子前,您需要先根据您当前使用的LAS服务所在地域,了解算子调用的BaseURL,用于配置算子调用路径参数取值。​
详情请参见获取 Base URL,下文中的调用示例仅作为参考,实际调用时需替换为您对应地域的路径取值。​
​
Rest API 调用​
API 调用说明​
  • 本算子的 API 为异步任务接口,您需要通过 Submit 接口提交任务获得任务的 task_id,再通过 Poll 接口获取对应任务(task_id)运行状态,并获取算子处理结果。​
  • 注意,任务提交后,任务的 task_id 有效期为 3 天,超过 3 天后即无法通过此 task_id 来获取算子处理结果。​
Submit​
接口说明​
提交 las_face_blur 算子进行人脸模糊任务。​
请求参数​
operator_id string 必选 示例值: las_face_blur​
本算子的id是 las_face_blur​
​
operator_version string 必选 示例值: v1​
目前只支持v1。​
​
data FaceBlurReqParams 必选​
算子参数​
url string 必选 示例值: tos://xxx/video.mp4​
输入视频路径。支持的视频格式: mp4、mov、avi、mkv、flv、webm,视频最大为 10 GB​
​
output_tos_path string 必选 示例值: tos://testbucket/path/​
结果保存的 TOS 路径。支持火山 TOS(tos://bucket/key)。同时输出视频和 bbox 时,bbox JSON 文件与视频保存在同一目录。​
​
output_filename string Optional​
自定义输出文件名,仅支持文件名,不能包含目录。仅输出 bbox 时应使用 .json 文件名;仅输出打码视频时通常使用 .mp4 后缀;同时输出打码视频和 bbox JSON 文件时通常使用 .mp4 后缀,bbox JSON 文件名由视频文件名自动派生为 <视频文件名不含后缀>_face_bbox.json。未提供时,服务会从 url 提取文件名,并自动生成对应的输出文件名。​
​
outputs array of string Optional 示例值: ["video", "bbox"]​
输出结果类型列表,支持 video(打码视频)和 bbox(逐帧人脸 bbox JSON),可单独或同时指定,且不能重复。未提供时,根据 blur_mode 自动推断:detect 推断为 bbox,其他模式推断为 video。​
​
blur_mode string Optional 示例值: face​
模糊区域模式,支持 face(脸部椭圆形模糊)、face_oval(贴脸型模糊)、eyes(眼部区域),默认为 face。detect 已弃用,仅为兼容历史请求保留;请改用 outputs=["bbox"],且 detect 模式不支持 video 输出。​
​
blur_type string Optional 示例值: gaussian​
模糊类型,支持 gaussian、mosaic;仅当需要输出打码视频时生效,默认为 gaussian。​
​
preserve_audio boolean Optional 示例值: true​
是否保留输出视频的原始音频;仅当需要输出打码视频时生效,默认 true。​
​
blur_strength integer Optional 示例值: 99​
高斯模糊强度(核大小),仅当需要输出打码视频且 blur_type=gaussian 时生效。值越大模糊越重、匿名化更强,但更糊、边缘更晕且计算更慢;值越小则更清晰更快,但匿名化能力下降。默认值 99,值范围 [3, 151]。​
​
mosaic_scale integer Optional 示例值: 16​
马赛克缩放比例,仅当需要输出打码视频且 blur_type=mosaic 时生效。值越大块越大越粗糙、匿名化更强;值越小块越细更自然,但匿名化更弱。默认值 16,值范围 [2, 64]。​
​
confidence_threshold float Optional 示例值: 0.6​
检测置信度阈值,值越大:更严格,误检少但漏检多,值越小:更宽松,检出多但误检多(可能把非人脸也糊)。默认值0.6,值范围(0, 1]​
​
draw_box boolean Optional 示例值: false​
是否在输出视频中绘制人脸框;仅当需要输出打码视频时生效,默认 false。​
​
​
​
​
返回数据​
metadata metadata​
请求元信息​
task_id string 示例值: task-xxx​
异步模式下的任务 ID,用于作业状态查询。​
​
task_status string 示例值: PENDING​
异步模式下的任务状态。​
  • PENDING, 接收请求​
  • RUNNING, 正在运行​
  • COMPLETED, 已经完成​
  • FAILED, 失败​
  • TIMEOUT, 超时​
​
business_code string 示例值: 0​
业务码。​
​
error_msg string​
如有异常,会返回详细的异常信息。​
​
​
​
示例​
请求示例​
​
# 请将 OUTPUT_PATH_TEMPLATE 设置为本账号上可写入的tos路径​
export OUTPUT_PATH_TEMPLATE="tos://<your_bucket_name>/output/"​
# 发起算子服务请求​
curl --location "https://operator.las.cn-beijing.volces.com/api/v1/submit" \​
--header "Content-Type: application/json" \​
--header "Authorization: Bearer $LAS_API_KEY" \​
--data @- <<JSON​
{​
"operator_id": "las_face_blur",​
"operator_version": "v1",​
"data": {​
"url": "tos://<your_bucket_name>/sample.mp4",​
"output_tos_path": "'$OUTPUT_PATH_TEMPLATE'"​
}​
}​
JSON​
​
返回示例​
​
{​
"metadata": {​
"task_id": "<YOUR_TASK_ID>",​
"task_status": "PENDING",​
"business_code": "0",​
"error_msg": ""​
}​
}​
​
错误码​
​
HttpStatusCode​
错误码​
错误信息​
描述​
400​
Parameter.Invalid​
The parameter is invalid.​
参数不合法​
401​
Authorization.Missing​
Missing Authorization.​
缺少鉴权​
401​
ApiKey.InValid​
The api key is invalid.​
API不合法​
​
Poll​
接口说明​
查询人脸模糊任务的执行状态和结果。​
请求参数​
​
名称​
类型​
是否必选​
示例值​
描述​
operator_id​
string​
是​
las_face_blur​
算子 ID​
operator_version​
string​
是​
v1​
算子版本​
task_id​
string​
是​
task-xxx​
任务 ID​
​
返回数据​
metadata metadata​
请求的元信息。​
task_status string 示例值: COMPLETED​
任务状态。​
  • PENDING, 接收到请求​
  • RUNNING, 正在运行​
  • COMPLETED, 已经完成​
  • FAILED, 失败​
  • TIMEOUT, 任务执行超时​
​
submit_time string 示例值: 2026-07-21T16:04:06+08:00​
任务提交时间,格式为 ISO 8601 时间戳。​
​
end_time string 示例值: 2026-07-21T16:04:06+08:00​
任务结束时间,格式为 ISO 8601 时间戳。​
​
business_code string 示例值: 0​
业务码。​
​
error_msg string 示例值: The api key is invalid.​
如有异常,会返回详细的异常信息。​
​
task_id string 示例值: task-xxx​
异步模式下的任务 ID。​
​
​
data FaceBlurResponse​
返回的数据。​
output_tos_uri string 示例值: tos://bucket/test.mp4​
兼容输出结果路径。输出包含 video 时指向模糊后视频;仅输出 bbox 时指向逐帧人脸 bbox JSON 文件。​
​
output_url string 示例值: https://bucket/xxx&X-Tos-SignedHeaders=xxx​
output_tos_uri 对应的预签名下载链接,有效期 2 小时。​
​
bbox_output_tos_uri string 示例值: tos://bucket/test_face_bbox.json​
bbox JSON 文件路径,仅当生成 bbox 输出时返回。仅输出 bbox 时与 output_tos_uri 相同。​
​
bbox_output_url string 示例值: https://bucket/xxx&X-Tos-SignedHeaders=xxx​
bbox_output_tos_uri 对应的预签名下载链接,有效期 2 小时,仅当生成 bbox 输出时返回。​
​
duration_seconds float 示例值: 123.36​
视频时长,单位秒。​
​
​
​
​
bbox JSON 文件说明​
当 outputs 包含 "bbox" 时,bbox_output_tos_uri 和 bbox_output_url 指向包含输入视频人脸检测结果的 JSON 文件。仅输出 bbox 时,output_tos_uri 和 output_url 也指向该 JSON 文件;同时输出 video 和 bbox 时,通用输出字段指向视频。​
  • JSON 文件的字段结构​
  • ​
    const properties = ({​
    "defaultExpandAllRows": true,​
    "columns": [​
    { "title": "字段", "dataIndex": "column_0", "key": "column_0", "width": 300 },​
    { "title": "类型", "dataIndex": "column_1", "key": "column_1", "width": 150 },​
    { "title": "说明", "dataIndex": "column_2", "key": "column_2" }​
    ],​
    "data": [​
    {​
    "key": "1",​
    "column_0": "video",​
    "column_1": "VideoMeta",​
    "column_2": "输入视频元数据。",​
    "children": [​
    {​
    "key": "1-1",​
    "column_0": "fps",​
    "column_1": "float",​
    "column_2": "输入视频帧率。"​
    },​
    {​
    "key": "1-2",​
    "column_0": "width",​
    "column_1": "int",​
    "column_2": "输入视频宽度,单位为像素。"​
    },​
    {​
    "key": "1-3",​
    "column_0": "height",​
    "column_1": "int",​
    "column_2": "输入视频高度,单位为像素。"​
    },​
    {​
    "key": "1-4",​
    "column_0": "total_frames",​
    "column_1": "int",​
    "column_2": "输入视频总帧数。"​
    },​
    {​
    "key": "1-5",​
    "column_0": "duration_seconds",​
    "column_1": "float",​
    "column_2": "输入视频时长,单位为秒。"​
    }​
    ]​
    },​
    {​
    "key": "2",​
    "column_0": "summary",​
    "column_1": "Summary",​
    "column_2": "人脸检测结果总结。",​
    "children": [​
    {​
    "key": "2-1",​
    "column_0": "total_faces",​
    "column_1": "int",​
    "column_2": "所有帧累计检测到的人脸数量。"​
    },​
    {​
    "key": "2-2",​
    "column_0": "frames_with_faces",​
    "column_1": "int",​
    "column_2": "包含至少一个人脸的帧数。"​
    },​
    {​
    "key": "2-3",​
    "column_0": "max_faces_in_frame",​
    "column_1": "int",​
    "column_2": "单帧检测到的最大人脸数。"​
    }​
    ]​
    },​
    {​
    "key": "3",​
    "column_0": "box_format",​
    "column_1": "string",​
    "column_2": <div>bbox 坐标格式,默认为 <code>&#91;x1, y1, x2, y2&#93;</code>。</div>​
    },​
    {​
    "key": "4",​
    "column_0": "frames",​
    "column_1": "list[Frame]",​
    "column_2": "包含至少一个检测到人脸的帧列表。未检测到人脸的帧不会出现在该列表中。",​
    "children": [​
    {​
    "key": "4-1",​
    "column_0": "frame_index",​
    "column_1": "int",​
    "column_2": "输入视频中的帧索引。"​
    },​
    {​
    "key": "4-2",​
    "column_0": "faces",​
    "column_1": "list[FaceBBox]",​
    "column_2": "当前帧检测到的人脸 bbox 列表。",​
    "children": [​
    {​
    "key": "4-2-1",​
    "column_0": "box",​
    "column_1": "list[int]",​
    "column_2": "bbox 坐标,顺序由 box_format 指定。"​
    },​
    {​
    "key": "4-2-2",​
    "column_0": "confidence",​
    "column_1": "float",​
    "column_2": "当前 bbox 的检测置信度。"​
    }​
    ]​
    }​
    ]​
    }​
    ]​
    }); ​
    return <Table border={{ cell: true, wrapper: true }} pagination={false} {...properties} />;​
    ​
  • 示例​
  • ​
    {​
    "video": {"fps": 30.0, "width": 1280, "height": 960, "total_frames": 5376, "duration_seconds": 179.2},​
    "summary": {"total_faces": 3710, "frames_with_faces": 3710, "max_faces_in_frame": 1},​
    "box_format": "[x1, y1, x2, y2]",​
    "frames": [​
    {"frame_index": 489, "faces": [{"box": [917, 3, 1001, 70], "confidence": 0.644342}]},​
    {"frame_index": 490, "faces": [{"box": [915, 3, 1003, 72], "confidence": 0.807955}]}​
    ]​
    }​
    ​
示例​
请求示例​
​
curl --location "https://operator.las.cn-beijing.volces.com/api/v1/poll" \​
--header "Content-Type: application/json" \​
--header "Authorization: Bearer $LAS_API_KEY" \​
--data '{​
"operator_id": "las_face_blur",​
"operator_version": "v1",​
"task_id": "<YOUR_TASK_ID>"​
}'​
​
返回示例​
​
{​
"metadata": {​
"task_id": "06ecbd66031e7006022d",​
"task_status": "COMPLETED",​
"submit_time": "2026-07-21T16:04:06+08:00",​
"end_time": "2026-07-21T16:04:06+08:00",​
"business_code": "0",​
"error_msg": "Task processed successfully"​
},​
"data": {​
"output_tos_uri": "tos://{bucket}/xxx.mp4",​
"output_url": "https://{bucket}.tos-cn-beijing.volces.com/xxx.mp4?xxx",​
"duration_seconds": 123.36​
}​
}​
​
错误码​
​
HttpStatusCode​
错误码​
错误信息​
描述​
400​
Parameter.Missing​
Missing required parameter.​
请求体中缺少必须的参数​
400​
Parameter.Invalid​
Invalid parameter.​
参数不合法​
400​
Url.Invalid​
Invalid URL.​
视频 URL 无法访问或不存在​
400​
Video.Invalid​
Invalid video file.​
视频格式不支持或文件损坏​
400​
Video.DownloadFailed​
Video download failed.​
下载异常或访问失败​
400​
Ffmpeg.error​
Failed to process video.​
通过FFmpeg处理视频数据失败​
​
​
最近更新时间:2026.10.19 16:26:28
这个页面对您有帮助吗?
有用
有用
无用
无用