five

Background Removal API — Human, Product & Universal Modes

收藏
RapidAPI2026-04-04 更新2026-04-05 收录
下载链接:
https://rapidapi.com/vindata-vindata-default/api/background-removal-api-human-product-universal-modes
下载链接
链接失效反馈
官方服务:
资源简介:
Remove backgrounds from images using universal, human, or product pipelines. Choose output format: transparent, white background, mask, or cropped subject.
创建时间:
2026-04-04
原始信息汇总

Background Removal API — Human, Product & Universal Modes 数据集概述

数据集名称

Background Removal API — Human, Product & Universal Modes

数据集提供方

APISphere

数据集类别

Video, Images

数据集概述

Remove backgrounds from images using universal, human, or product pipelines. Choose output format: transparent, white background, mask, or cropped subject.

主要功能与特点

  • 三种处理管道:通用(universal)、人像(human)和产品(product),针对不同主体类型优化结果。
  • 四种输出格式:透明背景(transparent)、白色背景(white_bg)、主体掩膜(mask)或主体裁剪(crop)。
  • 单一端点:一个URL覆盖所有管道和格式组合。
  • 直接二进制输出:接收可直接使用的已处理图像。
  • 广泛的格式支持:接受JPEG、PNG、BMP、WEBP和GIF格式。
  • 一致的错误格式:错误时返回标准的metadatawarningserror信封结构。

目标用户

✅ 适用对象

  • 需要自动化产品照片背景移除的电子商务平台。
  • 提供背景移除功能的照片编辑应用。
  • 创建透明背景素材的平面设计师。
  • 需要分离主体的肖像和头像服务。
  • 准备干净视觉素材的营销团队。
  • 构建批量图像处理流程的开发人员。

❌ 不适用对象

  • 用新图像替换背景(此API仅移除,不替换)。
  • 分别分割多个不同的对象。
  • 实时视频背景移除(此为单图像端点)。
  • 仅提取头部区域(请使用头部提取端点)。

端点详情

  • 端点POST /v1/remove-bg/universal
  • 描述:上传图像,选择检测管道和输出格式,接收背景移除后的结果。

请求参数

参数 类型 是否必需 默认值 描述
image file 源图像(JPEG, PNG, BMP, WEBP, GIF)。最大10 MB。
subject string universal 检测管道:universalhumanproduct
output_format string transparent 输出格式:transparentwhite_bgmaskcrop

输出格式详情

  • transparent:主体位于透明背景上(PNG格式)。
  • white_bg:主体位于纯白色背景上。
  • mask:显示检测到的主体区域的二进制掩膜。
  • crop:裁剪至主体边界框。

响应

  • 成功:直接返回二进制图像数据,Content-Typeimage/pngimage/jpeg
  • 错误:返回包含metadatawarningserror字段的标准错误信封。

验证与错误

  • 缺少文件image字段为必填项,缺失则返回400错误。
  • 无效格式:仅接受JPEG、PNG、BMP、WEBP和GIF文件,其他格式返回400错误。
  • 文件过大:超过10 MB的图像将被拒绝,返回400错误。
  • 无效主体类型subject必须为universalhumanproduct,无效值返回400错误。
  • 无效输出格式output_format必须为transparentwhite_bgmaskcrop,无效值返回400错误。
  • 上游错误:如果处理服务超时或失败,则返回502错误。
  • 服务器错误:意外故障返回500状态码,详细信息在error字段中。
  • 所有错误响应均遵循相同的信封结构:{ "meta": {...}, "data": null, "warnings": [], "error": { ... } }

示例请求

curl -X POST "https://your-rapidapi-host/v1/remove-bg/universal" -H "X-RapidAPI-Key: YOUR_API_KEY" -F "image=@product-photo.jpg" -F "subject=product" -F "output_format=white_bg"

示例响应(错误情况)

{ "meta": { "requestId": "e7f8a9b0-c1d2-3456-e012-789012345678", "createdAt": "2026-02-17T17:40:22.456Z", "processingMs": 0 }, "data": null, "warnings": [], "error": { "code": "VALIDATION_ERROR", "message": "Missing or empty image file", "details": [ { "field": "image", "issue": "File is required and cannot be empty" } ] } }

5,000+
优质数据集
54 个
任务类型
进入经典数据集
二维码
社区交流群

面向社区/商业的数据集话题

二维码
科研交流群

面向高校/科研机构的开源数据集话题

数据驱动未来

携手共赢发展

商业合作