Passerby Removal V2
Passerby Removal V2
Description
Passerby Elimination V2. Intelligently identifies and removes passersby from an image, and outputs a clean image with a clean background.
API Specification
Version
1.0
Request Method
API URL
Production environment: https://openapi.meitu.com
Task submission endpoint: https://openapi.meitu.com/api/v1/sdk/sync/push
Task name (task): `/v1/passerby_remove/494684`
Task type (task_type): `formula`Media Requirements
| Parameter | Description |
|---|---|
| Supported media formats | JPG, JPEG, PNG |
| Supported media size | ≤ 20 MB |
Signature Verification
Permissions
Credits cannot be used to pay for API calls. Please visit the MV console to activate this API and purchase or manage resource packages.
HTTP Method
POST
The request header must include: Content-Type: application/json
Required Request Headers
| Required | Parameter | Type | Description |
|---|---|---|---|
| Required | Authorization | String | Signature verification information. See Open Platform API Signature for details. |
| Required | Content-Type | String | Fixed as application/json |
Parameter Description
Request Parameters
| Required | Parameter | Type | Description |
|---|---|---|---|
| Required | task | String | Task path, e.g.: /v1/passerby_remove/494684 |
| Required | task_type | String | Task type, fixed value: formula |
| Required | init_images | Object[] | Input media file parameters |
| Required | params | String | Inference parameters (JSON string). {"parameter":{"rsp_media_type":"url"}} means the media is returned as a URL. |
| Optional | sync_timeout | Int | Defaults to -1, which means no wait. The API returns immediately and the task is processed asynchronously. Please use the Task Query endpoint. |
Description of init_images media file parameters
init_images is an array type, where each element represents a media resource (e.g., an image).
| Required | Parameter | Type | Description |
|---|---|---|---|
| Required | url | String | Access URL of the media file |
| Optional | profile | Object | Multimedia parameter configuration |
Description of profile parameters
| Required | Parameter | Type | Description |
|---|---|---|---|
| Required | media_profiles | object | Descriptive attributes of the media file |
Description of media_profiles parameters
| Required | Parameter | Type | Description |
|---|---|---|---|
| No | media_data_type | String | Defaults to "url", which means media_data is a URL address |
params is a JSON string. Its parsed structure is as follows:
{
"parameter": {
"rsp_media_type": "url"
}
}Description of parameter parameters
| Required | Parameter | Type | Description |
|---|---|---|---|
| No | rsp_media_type | String | Media type of the returned result: jpg means the result image is returned as Base64-encoded data; url means the result image is returned as a URL address. |
Request Example
{
"task": "/v1/passerby_remove/494684",
"task_type": "formula",
"init_images": [
{
"url": "https://mv-openplatform.meitudata.com/product_img/6a8eaec9e1b8b1ks1t77rb9895.jpg",
"profile": {
"media_profiles": {
"media_data_type": "url"
}
}
}
],
"params": "",
"sync_timeout": -1
}Success Response Description
| Field | Type | Description |
|---|---|---|
| request_id | String | Request ID |
| trace_id | String | Distributed tracing ID |
| code | Number | HTTP-level status code. 0 indicates success. |
| error_code | Number | Business error code. 0 indicates success. See API Error Codes for details. |
| message | String | Returned message. success on success. |
| data | Object | Business data returned |
Description of data fields
| Field | Type | Description |
|---|---|---|
| status | Number | Task status. 10 indicates that the task is completed. |
| result | Object | Task processing result |
| progress | Number | Task progress, ranging from 0 to 1. 1 indicates completion. |
| predict_elapsed | Number | Predicted processing time, in milliseconds. |
| create_time | Number | Task creation timestamp, in milliseconds. |
| task_id | String | Task ID |
| custom_task_id | String | Custom task ID |
| trace_id | String | Tracing ID |
| client_info | String | Client information |
| init_images | Array | Initial input media information |
| instance_id | String | Instance ID |
Description of result fields
| Field | Type | Description |
|---|---|---|
| id | String | Unique identifier of the task |
| urls | Array | List of generated image URLs |
| parameters | Object | Algorithm parameter information, including details of task processing |
| images | Array | List of generated image URLs |
| media_info_list | Array | Media information list |
Description of result.parameters fields
| Field | Type | Description |
|---|---|---|
| category | String | Algorithm category |
| formula_id | String | Formula ID |
| rsp_media_type | String | Response media type |
| task_id | String | Task ID |
| trace_id | String | Distributed tracing ID |
Description of media_info_list fields
| Field | Type | Description |
|---|---|---|
| media_data | String | Media data URL |
| media_extra | Object | Extra media information |
| media_profiles | Object | Media configuration information |
Description of media_profiles fields
| Field | Type | Description |
|---|---|---|
| media_data_type | String | Media data type, e.g., "url" |
| media_data_height | Number | Media height (in pixels) |
| media_data_width | Number | Media width (in pixels) |
| media_data_size | Number | Media size (in bytes) |
Success Response Example
{
"request_id": "",
"trace_id": "",
"code": 0,
"error_code": 0,
"message": "success",
"data": {
"status": 9,
"result": {
"id": "t_mt1a3i5n7b7320bde7-9f69-4722-aa1a-bec2a333dc38"
},
"progress": 0,
"predict_elapsed": 10000,
"create_time": 1787737214318,
"task_id": "t_mt1a3i5n7b7320bde7-9f69-4722-aa1a-bec2a333dc38",
"custom_task_id": "",
"trace_id": "381aa78b-52c0-4f45-b199-304c212209e0",
"client_info": "",
"init_images": null,
"instance_id": "7498313349026305833"
}
}Async Success Response Example (Queried by Task ID)
Please use the Task Query endpoint for asynchronous queries.
{
"request_id": "",
"trace_id": "",
"code": 0,
"error_code": 0,
"message": "success",
"data": {
"status": 10,
"result": {
"id": "t_mt1a3i5n7b7320bde7-9f69-4722-aa1a-bec2a333dc38",
"urls": [
"https://oss-open-platform.meitudata.com/mtopen/ff56d688358849259556be0f50065a60/c46d3317-8385-4b2d-6336-b8ae26776709.jpeg"
],
"parameters": {},
"images": [
"https://oss-open-platform.meitudata.com/mtopen/ff56d688358849259556be0f50065a60/c46d3317-8385-4b2d-6336-b8ae26776709.jpeg"
],
"media_info_list": [
{
"media_data": "https://oss-open-platform.meitudata.com/mtopen/ff56d688358849259556be0f50065a60/c46d3317-8385-4b2d-6336-b8ae26776709.jpeg",
"media_extra": null,
"media_profiles": {
"media_data_height": 1512,
"media_data_size": 1481480,
"media_data_type": "url",
"media_data_width": 1280
}
}
]
},
"progress": 1,
"predict_elapsed": 10000,
"create_time": 1787737214318,
"task_id": "t_mt1a3i5n7b7320bde7-9f69-4722-aa1a-bec2a333dc38",
"custom_task_id": "",
"trace_id": "",
"client_info": "",
"init_images": null
}
}Failure Response Description
| Field | Type | Description |
|---|---|---|
| data | String | Returned content |
| message | String | Error message |
| error_code | Number | Error code |
Failure Response Example
Response Status: 400
content-type: application/json; charset=utf-8{
"error_code": 20001,
"message": "PROCESS_ERROR",
"data": null
}API-Specific Error Codes and Messages
| ErrorCode | Error Message | Description |
|---|---|---|
| 20001 | PROCESS_ERROR | Processing error |
Common Error Codes and Messages
See API Error Codes
Example
curl Example
curl --request POST \
--url 'https://openapi.meitu.com/api/v1/sdk/sync/push' \
--header 'Authorization: Bearer YourSignAuthCode' \
--header 'Content-Type: application/json' \
--data '{
"task": "/v1/passerby_remove/494684",
"task_type": "formula",
"init_images": [
{
"url": "https://mv-openplatform.meitudata.com/product_img/6a8eaec9e1b8b1ks1t77rb9895.jpg",
"profile": {
"media_profiles": {
"media_data_type": "url"
}
}
}
],
"params": "",
"sync_timeout": -1
}'