summaryrefslogtreecommitdiff
path: root/data/en_us/imageseg/2019-12-30
diff options
context:
space:
mode:
Diffstat (limited to 'data/en_us/imageseg/2019-12-30')
-rw-r--r--data/en_us/imageseg/2019-12-30/api-docs.php2759
1 files changed, 1968 insertions, 791 deletions
diff --git a/data/en_us/imageseg/2019-12-30/api-docs.php b/data/en_us/imageseg/2019-12-30/api-docs.php
index ce6c778..59b84dc 100644
--- a/data/en_us/imageseg/2019-12-30/api-docs.php
+++ b/data/en_us/imageseg/2019-12-30/api-docs.php
@@ -1,40 +1,16 @@
<?php return [
'version' => '1.0',
- 'info' => [
- 'style' => 'RPC',
- 'product' => 'imageseg',
- 'version' => '2019-12-30',
- ],
+ 'info' => ['style' => 'RPC', 'product' => 'imageseg', 'version' => '2019-12-30'],
'directories' => [
[
- 'id' => 64411,
- 'title' => null,
+ 'children' => ['ChangeSky', 'RefineMask', 'SegmentBody', 'SegmentCloth', 'SegmentCommodity', 'SegmentCommonImage', 'SegmentFood', 'SegmentHair', 'SegmentHDBody', 'SegmentHDCommonImage', 'SegmentHDSky', 'SegmentHead', 'SegmentSkin', 'SegmentSky'],
'type' => 'directory',
- 'children' => [
- 'ChangeSky',
- 'ParseFace',
- 'RefineMask',
- 'SegmentBody',
- 'SegmentCloth',
- 'SegmentCommodity',
- 'SegmentCommonImage',
- 'SegmentFood',
- 'SegmentHair',
- 'SegmentHDBody',
- 'SegmentHDCommonImage',
- 'SegmentHDSky',
- 'SegmentHead',
- 'SegmentSkin',
- 'SegmentSky',
- ],
+ 'title' => 'Segmentation',
],
[
- 'id' => 64433,
- 'title' => null,
+ 'children' => ['GetAsyncJobResult'],
+ 'title' => 'Others',
'type' => 'directory',
- 'children' => [
- 'GetAsyncJobResult',
- ],
],
],
'components' => [
@@ -42,14 +18,8 @@
],
'apis' => [
'ChangeSky' => [
- 'methods' => [
- 'post',
- 'get',
- ],
- 'schemes' => [
- 'http',
- 'https',
- ],
+ 'methods' => ['post', 'get'],
+ 'schemes' => ['http', 'https'],
'security' => [
[
'AK' => [],
@@ -57,31 +27,17 @@
],
'operationType' => 'read',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'update',
- ],
+ 'systemTags' => ['operationType' => 'update'],
'parameters' => [
[
'name' => 'ImageURL',
'in' => 'query',
- 'schema' => [
- 'description' => '',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/ChangeSky/ChangeSky2.jpg',
- 'isFileTransferUrl' => true,
- ],
+ 'schema' => ['description' => 'The URL of the target image whose sky you want to replace. We recommend that you use an OSS URL in the Shanghai region. If the file is stored locally or in an OSS bucket outside the Shanghai region, see [File URL processing](~~155645~~).', 'type' => 'string', 'required' => true, 'isFileTransferUrl' => true, 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/ChangeSky/ChangeSky2.jpg', 'title' => ''],
],
[
'name' => 'ReplaceImageURL',
'in' => 'query',
- 'schema' => [
- 'description' => '',
- 'type' => 'string',
- 'required' => true,
- 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/ChangeSky/ChangeSky6.jpg',
- 'isFileTransferUrl' => true,
- ],
+ 'schema' => ['description' => 'The URL of the reference image. We recommend that you use an OSS URL in the Shanghai region. If the file is stored locally or in an OSS bucket outside the Shanghai region, see [File URL processing](~~155645~~).', 'type' => 'string', 'required' => true, 'isFileTransferUrl' => true, 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/ChangeSky/ChangeSky6.jpg', 'title' => ''],
],
],
'responses' => [
@@ -89,140 +45,226 @@
'schema' => [
'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'description' => '',
- 'type' => 'string',
- 'example' => 'F9D60817-EC5A-4BAC-9092-4AD42220CFA8',
- ],
+ 'RequestId' => ['description' => 'The request ID.', 'type' => 'string', 'example' => 'F9D60817-EC5A-4BAC-9092-4AD42220CFA8', 'title' => ''],
'Data' => [
- 'description' => '',
+ 'description' => 'The returned result data.',
'type' => 'object',
'properties' => [
- 'ImageURL' => [
- 'description' => '',
- 'type' => 'string',
- 'example' => 'http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_skySegmentator/2020-7-24/invi_skySegmentator_015955791588111000000_5pn2QM.jpg?Expires=1595580958&OSSAccessKeyId=LTAI4FoLmvQ9urWXgSRp****&Signature=Sq4po8h3WAj%2BBFrCgTP3ghlXn4****',
- ],
+ 'ImageURL' => ['description' => 'The URL of the image after sky replacement.'."\n"
+ .'After segmentation, a four-channel PNG image is returned. The image is uncompressed, the dimensions remain unchanged, and the file size increases.'."\n"
+ .'> This URL is a temporary address that is valid for 30 minutes. After it expires, the URL is no longer accessible. To save the file for a longer period or permanently, access the URL within 30 minutes and download the file to your own OSS bucket or other storage.', 'type' => 'string', 'example' => 'http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_skySegmentator/2020-7-24/invi_skySegmentator_015955791588111000000_5pn2QM.jpg?Expires=1595580958&OSSAccessKeyId=LTAI****************&Signature=Sq4po8h3WAj%2BBFrCgTP3ghlXn4****', 'title' => ''],
],
+ 'title' => '',
+ 'example' => '',
],
],
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
],
],
],
'errorCodes' => [
400 => [
- [
- 'errorCode' => 'ParameterError',
- 'errorMessage' => 'The parameter is invalid. Please check again.',
- ],
+ ['errorCode' => 'ParameterError', 'errorMessage' => 'The parameter is invalid. Please check again.', 'description' => 'The parameter is invalid. Please check again.'],
],
403 => [
- [
- 'errorCode' => 'AuthFailed',
- 'errorMessage' => 'An error occurred while performing authorization. Please check your RAM configuration.',
- ],
+ ['errorCode' => 'AuthFailed', 'errorMessage' => 'An error occurred while performing authorization. Please check your RAM configuration.', 'description' => 'An error occurred while performing authorization. Please check your RAM configuration.'],
],
408 => [
- [
- 'errorCode' => 'Timeout',
- 'errorMessage' => 'The request has timed out.',
- ],
+ ['errorCode' => 'Timeout', 'errorMessage' => 'The request has timed out.', 'description' => 'The request has timed out.'],
],
503 => [
- [
- 'errorCode' => 'ServiceUnavailable',
- 'errorMessage' => 'The service is unavailable.',
+ ['errorCode' => 'ServiceUnavailable', 'errorMessage' => 'The service is unavailable.', 'description' => 'The service is unavailable. '],
+ ],
+ ],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"F9D60817-EC5A-4BAC-9092-4AD42220CFA8\\",\\n \\"Data\\": {\\n \\"ImageURL\\": \\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_skySegmentator/2020-7-24/invi_skySegmentator_015955791588111000000_5pn2QM.jpg?Expires=1595580958&OSSAccessKeyId=LTAI****************&Signature=Sq4po8h3WAj%2BBFrCgTP3ghlXn4****\\"\\n }\\n}","type":"json"}]',
+ 'title' => 'Sky replacement',
+ 'summary' => 'This topic describes the syntax and examples of the ChangeSky operation.',
+ 'description' => '## Feature description'."\n"
+ .'Given two images, the sky replacement feature replaces the sky style in target image A with the sky style from reference image B, thereby changing the sky appearance of target image A.'."\n"
+ .'The following images show examples of this operation:'."\n"
+ ."\n"
+ .'- Target image A'."\n"
+ .'![Sky A](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20230206/xhwb/ChangeSkymubiaoA.jpg" width="500)'."\n"
+ ."\n"
+ .'- Reference image B'."\n"
+ .'![Sky B](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20230206/cjjx/ChangeSkycankaoB.jpg" width="500)'."\n"
+ ."\n"
+ .'- Target image A after replacement'."\n"
+ .'![Sky C](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20230206/sdja/ChangeSkyjieguoA.jpg" width="500)'."\n"
+ ."\n"
+ .'> - You can visit [Online Consultation](https://www.aliyun.com/core/online-consult?from=aZgW6LJHr2) to get online assistance.'."\n"
+ .'- You can try this feature for free on the Visual Intelligence Open Platform. Click [Try Now](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=ChangeSky) to experience this feature or purchase it online.'."\n"
+ .'- For questions about API integration and usage of Alibaba Cloud Visual Intelligence Open Platform, join the DingTalk group (23109592) to contact us.'."\n"
+ ."\n"
+ .'## Integration guide'."\n"
+ .'1. Register an Alibaba Cloud account: Go to the [Alibaba Cloud official website](https://www.aliyun.com), click **Register Now** in the upper-right corner, and follow the instructions to complete the registration.'."\n"
+ .'2. Activate the feature: Make sure you have activated the [Image Segmentation service](https://vision.aliyun.com/imageseg). If you have not activated the service, [activate it now](https://common-buy.aliyun.com/?commodityCode=viapi_imageseg_public_cn#/open).'."\n"
+ .'3. Create an AccessKey pair: Make sure you have [created an AccessKey pair](~~175144~~). If you are using a RAM user AccessKey, grant the AliyunVIAPIFullAccess permission to the RAM user. For more information, see [RAM authorization](~~145025~~).'."\n"
+ .'4. Online debugging (optional): You can use [OpenAPI Explorer](https://next.api.aliyun.com/api/imageseg/2019-12-30/ChangeSky?lang=JAVA&sdkStyle=dara&params=%7B%22ImageURL%22%3A%22http%3A%2F%2Fviapi-test.oss-cn-shanghai.aliyuncs.com%2Fviapi-3.0domepic%2Fimageseg%2FChangeSky%2FChangeSky1.jpg%22%2C%22ReplaceImageURL%22%3A%22http%3A%2F%2Fviapi-test.oss-cn-shanghai.aliyuncs.com%2Fviapi-3.0domepic%2Fimageseg%2FChangeSky%2FChangeSky6.jpg%22%7D&tab=DEMO) to debug this feature online, view complete sample code and SDK dependency information, or download the complete project.'."\n"
+ .'5. Development integration steps:'."\n"
+ .'- Select the SDK language you want to use from the [SDK overview](~~145033~~).'."\n"
+ .'- Find the SDK package for the Image Segmentation (imageseg) AI category in the corresponding SDK documentation and install it.'."\n"
+ .'- Modify the sample code provided in the References as needed and invoke the operation.'."\n"
+ ."\n"
+ .'6. Direct client calls: Common client call methods for this feature include the following:'."\n"
+ .'- [Direct call from web frontend](~~467779~~)'."\n"
+ .'- [Direct call from mini programs](~~467780~~)'."\n"
+ .'- [Direct call from Android](~~467781~~)'."\n"
+ .'- [Direct call from iOS](~~467782~~).'."\n"
+ ."\n"
+ .'## Input limits'."\n"
+ .'- Image format: PNG, JPEG, JPG, or BMP.'."\n"
+ .'- Image size: up to 3 MB.'."\n"
+ .'- Image resolution: greater than 50 × 50 pixels and less than 2000 × 2000 pixels.'."\n"
+ .'- The URL cannot contain Chinese characters.'."\n"
+ ."\n"
+ .'## Billing description'."\n"
+ .'The sky replacement feature is currently in public preview and can be called for free.',
+ 'requestParamsDescription' => ' ',
+ 'responseParamsDescription' => '## SDK reference'."\n"
+ .'To use the sky replacement feature under the Alibaba Cloud Visual AI Image Segmentation category, we recommend that you use the SDK. Multiple programming languages are supported. When calling the operation, select the SDK package for the Image Segmentation (imageseg) AI category. The SDK supports both local files and arbitrary URLs as file parameters. For more information, see [SDK overview](~~145033~~).',
+ 'extraInfo' => '## Error codes'."\n"
+ .'For error codes of the sky replacement feature, see [Common error codes](~~146751~~).'."\n"
+ ."\n"
+ .'## Security notice'."\n"
+ .'- Make sure that the uploaded images or files comply with applicable laws and regulations.'."\n"
+ .'- Temporary files uploaded through the debugging experience are valid for 1 hour and are automatically deleted by the system after 24 hours.',
+ 'changeSet' => [
+ ['createdAt' => '2022-11-18T05:36:20.000Z', 'description' => 'Request parameters changed'],
+ ],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'ChangeSky'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'update',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:ChangeSky',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
],
],
],
- 'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"F9D60817-EC5A-4BAC-9092-4AD42220CFA8\\",\\n \\"Data\\": {\\n \\"ImageURL\\": \\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_skySegmentator/2020-7-24/invi_skySegmentator_015955791588111000000_5pn2QM.jpg?Expires=1595580958&OSSAccessKeyId=LTAI****************&Signature=Sq4po8h3WAj%2BBFrCgTP3ghlXn4****\\"\\n }\\n}","errorExample":""},{"type":"xml","example":"<ChangeSkyResponse>\\n <RequestId>F9D60817-EC5A-4BAC-9092-4AD42220CFA8</RequestId>\\n <Data>\\n <ImageURL>http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_skySegmentator/2020-7-24/invi_skySegmentator_015955791588111000000_5pn2QM.jpg?Expires=1595580958&amp;OSSAccessKeyId=LTAI****************&amp;Signature=Sq4po8h3WAj%2BBFrCgTP3ghlXn4****</ImageURL>\\n </Data>\\n</ChangeSkyResponse>","errorExample":""}]',
- 'requestParamsDescription' => ' ',
],
- 'ParseFace' => [
- 'methods' => [
- 'post',
- 'get',
- ],
- 'schemes' => [
- 'http',
- 'https',
- ],
+ 'GetAsyncJobResult' => [
+ 'methods' => ['post', 'get'],
+ 'schemes' => ['http', 'https'],
'security' => [
[
'AK' => [],
],
],
- 'operationType' => 'readAndWrite',
+ 'operationType' => 'read',
'deprecated' => false,
- 'systemTags' => [],
+ 'systemTags' => ['operationType' => 'get'],
'parameters' => [
[
- 'name' => 'ImageURL',
- 'in' => 'query',
- 'schema' => [
- 'description' => '',
- 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/ParseFace/ParseFace1.jpg',
- 'isFileTransferUrl' => true,
- 'required' => true,
- 'type' => 'string',
- ],
+ 'name' => 'JobId',
+ 'in' => 'formData',
+ 'schema' => ['description' => 'The RequestId returned by the asynchronous operation. You can use this parameter to query the actual result of the asynchronous operation.', 'type' => 'string', 'required' => true, 'example' => 'E75FE679-0303-4DD1-8252-1143B4FA8A27', 'title' => ''],
],
],
'responses' => [
200 => [
'schema' => [
+ 'description' => '1',
+ 'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'description' => '',
- 'example' => 'D6C24839-91A7-41DA-B31F-98F08EF80CC0',
- 'type' => 'string',
- ],
+ 'RequestId' => ['description' => 'The request ID.', 'type' => 'string', 'example' => '43A0AEB6-45F4-4138-8E89-E1A5D63200E3', 'title' => ''],
'Data' => [
- 'description' => '',
+ 'description' => 'The returned result data.',
+ 'type' => 'object',
'properties' => [
- 'Elements' => [
- 'description' => '',
- 'items' => [
- 'properties' => [
- 'ImageURL' => [
- 'description' => '',
- 'example' => 'http://vibktprfx-prod-prod-aic-gd-cn-shanghai.oss-cn-shanghai.aliyuncs.com/fivesensesegmenter/prod/560FA2E7-FDC6-59A5-ABDD-D62A05146734/skin/_18dd_20211231-040658.png?Expires=1640925418&OSSAccessKeyId=LTAI4FoLmvQ9urWXgSRp****&Signature=2g0M88wZl%2Bn4t4gzQX%2BTIskpWB****',
- 'type' => 'string',
- ],
- 'Name' => [
- 'description' => '',
- 'example' => 'skin',
- 'type' => 'string',
- ],
- ],
- 'type' => 'object',
- ],
- 'type' => 'array',
- ],
- 'OriginImageURL' => [
- 'description' => '',
- 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/ParseFace/ParseFace1.jpg',
- 'type' => 'string',
- ],
+ 'Status' => ['description' => 'The status of the asynchronous task. Valid values:'."\n"
+ ."\n"
+ .'- QUEUING: The task is queuing.'."\n"
+ ."\n"
+ .'- PROCESSING: The task is being processed.'."\n"
+ ."\n"
+ .'- PROCESS_SUCCESS: The task was processed.'."\n"
+ ."\n"
+ .'- PROCESS_FAILED: The task failed to be processed.'."\n"
+ ."\n"
+ .'- TIMEOUT_FAILED: The task timed out.'."\n"
+ ."\n"
+ .'- LIMIT_RETRY_FAILED: The maximum number of retries was exceeded.', 'type' => 'string', 'example' => 'PROCESS_SUCCESS', 'title' => ''],
+ 'ErrorMessage' => ['description' => 'The error message of the asynchronous task.', 'type' => 'string', 'example' => 'paramsIllegal', 'title' => ''],
+ 'Result' => ['description' => 'The actual result of the asynchronous task. You must deserialize the result on your own.', 'type' => 'string', 'example' => '{"ImageUrl":"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_/2020-4-2/invi__015858226731531000018_UE7B9p.png?Expires=1585824473&OSSAccessKeyId=LTAI4FoLmvQ9urWXgSR****&Signature=etyeYQQ%2BWAyQTqQKd8Xq0GiOW****"}', 'title' => ''],
+ 'ErrorCode' => ['description' => 'The error code of the asynchronous task.', 'type' => 'string', 'example' => 'InvalidParameter', 'title' => ''],
+ 'JobId' => ['description' => 'The asynchronous task ID.', 'type' => 'string', 'example' => '49E2CC28-ED1D-4CC5-854D-7D0AE2B20976', 'title' => ''],
],
- 'type' => 'object',
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'title' => '',
+ 'example' => '',
],
],
],
- 'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"D6C24839-91A7-41DA-B31F-98F08EF80CC0\\",\\n \\"Data\\": {\\n \\"Elements\\": [\\n {\\n \\"ImageURL\\": \\"http://vibktprfx-prod-prod-aic-gd-cn-shanghai.oss-cn-shanghai.aliyuncs.com/fivesensesegmenter/prod/560FA2E7-FDC6-59A5-ABDD-D62A05146734/skin/_18dd_20211231-040658.png?Expires=1640925418&OSSAccessKeyId=LTAI****************&Signature=2g0M88wZl%2Bn4t4gzQX%2BTIskpWB****\\",\\n \\"Name\\": \\"skin\\"\\n }\\n ],\\n \\"OriginImageURL\\": \\"http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/ParseFace/ParseFace1.jpg\\"\\n }\\n}","errorExample":""},{"type":"xml","example":"<ParseFaceResponse>\\n <RequestId>318E490D-6955-5720-B1B4-31093242D00A</RequestId>\\n <Data>\\n <OriginImageURL>http://viapi-test.oss-cn-shanghai-internal.aliyuncs.com/viapi-3.0domepic/imageseg/ParseFace/ParseFace1.jpg</OriginImageURL>\\n <Elements>\\n <ImageURL>http://vibktprfx-prod-prod-aic-gd-cn-shanghai.oss-cn-shanghai.aliyuncs.com/fivesensesegmenter/prod/318E490D-6955-5720-B1B4-31093242D00A/skin/_e3ab_20211231-040959.png?Expires=1640925599&amp;OSSAccessKeyId=LTAI****************&amp;Signature=68Z1rRQT47o0501Ai5aJWH50ml****</ImageURL>\\n <Name>skin</Name>\\n </Elements>\\n <Elements>\\n <ImageURL>http://vibktprfx-prod-prod-aic-gd-cn-shanghai.oss-cn-shanghai.aliyuncs.com/fivesensesegmenter/prod/318E490D-6955-5720-B1B4-31093242D00A/l_brow/_7f24_20211231-040959.png?Expires=1640925599&amp;OSSAccessKeyId=LTAI****************&amp;Signature=a8MVO5zFhL%2BA93Yce4DucIPGB%2B****</ImageURL>\\n <Name>l_brow</Name>\\n </Elements>\\n <Elements>\\n <ImageURL>http://vibktprfx-prod-prod-aic-gd-cn-shanghai.oss-cn-shanghai.aliyuncs.com/fivesensesegmenter/prod/318E490D-6955-5720-B1B4-31093242D00A/r_brow/_2d2a_20211231-040959.png?Expires=1640925599&amp;OSSAccessKeyId=LTAI****************&amp;Signature=LjwcSshnOV1dhPbx5OjhQkwLaZ****</ImageURL>\\n <Name>r_brow</Name>\\n </Elements>\\n <Elements>\\n <ImageURL>http://vibktprfx-prod-prod-aic-gd-cn-shanghai.oss-cn-shanghai.aliyuncs.com/fivesensesegmenter/prod/318E490D-6955-5720-B1B4-31093242D00A/l_eye/_5ba8_20211231-040959.png?Expires=1640925599&amp;OSSAccessKeyId=LTAI****************&amp;Signature=Ak6hAp5%2BWUiexlyUJSAL7PpC9g****</ImageURL>\\n <Name>l_eye</Name>\\n </Elements>\\n <Elements>\\n <ImageURL>http://vibktprfx-prod-prod-aic-gd-cn-shanghai.oss-cn-shanghai.aliyuncs.com/fivesensesegmenter/prod/318E490D-6955-5720-B1B4-31093242D00A/r_eye/_03f3_20211231-040959.png?Expires=1640925599&amp;OSSAccessKeyId=LTAI****************&amp;Signature=0IfJ%2BXtOLTofKuMyru7G3DYIlU****</ImageURL>\\n <Name>r_eye</Name>\\n </Elements>\\n <Elements>\\n <ImageURL>http://vibktprfx-prod-prod-aic-gd-cn-shanghai.oss-cn-shanghai.aliyuncs.com/fivesensesegmenter/prod/318E490D-6955-5720-B1B4-31093242D00A/l_ear/_2722_20211231-040959.png?Expires=1640925599&amp;OSSAccessKeyId=LTAI****************&amp;Signature=OfvsQuZ4Xb7hgvG6snbSK6%2BoWL****</ImageURL>\\n <Name>l_ear</Name>\\n </Elements>\\n <Elements>\\n <ImageURL>http://vibktprfx-prod-prod-aic-gd-cn-shanghai.oss-cn-shanghai.aliyuncs.com/fivesensesegmenter/prod/318E490D-6955-5720-B1B4-31093242D00A/r_ear/_4c72_20211231-040959.png?Expires=1640925599&amp;OSSAccessKeyId=LTAI****************&amp;Signature=wTvhMOjb7Yxu9TSuysoNqr0Jtx****</ImageURL>\\n <Name>r_ear</Name>\\n </Elements>\\n <Elements>\\n <ImageURL>http://vibktprfx-prod-prod-aic-gd-cn-shanghai.oss-cn-shanghai.aliyuncs.com/fivesensesegmenter/prod/318E490D-6955-5720-B1B4-31093242D00A/nose/_f37f_20211231-040959.png?Expires=1640925599&amp;OSSAccessKeyId=LTAI****************&amp;Signature=kfQPM6LEiZQX7jq6UkDPNsCM3Z****</ImageURL>\\n <Name>nose</Name>\\n </Elements>\\n <Elements>\\n <ImageURL>http://vibktprfx-prod-prod-aic-gd-cn-shanghai.oss-cn-shanghai.aliyuncs.com/fivesensesegmenter/prod/318E490D-6955-5720-B1B4-31093242D00A/mouth/_75d9_20211231-040959.png?Expires=1640925599&amp;OSSAccessKeyId=LTAI****************&amp;Signature=pYe9WwXzhy9008SGx1OiZwdVWl****</ImageURL>\\n <Name>mouth</Name>\\n </Elements>\\n <Elements>\\n <ImageURL>http://vibktprfx-prod-prod-aic-gd-cn-shanghai.oss-cn-shanghai.aliyuncs.com/fivesensesegmenter/prod/318E490D-6955-5720-B1B4-31093242D00A/u_lip/_e7ae_20211231-040959.png?Expires=1640925599&amp;OSSAccessKeyId=LTAI****************&amp;Signature=4prsADyajiJvxud5syDNanBiOr****</ImageURL>\\n <Name>u_lip</Name>\\n </Elements>\\n <Elements>\\n <ImageURL>http://vibktprfx-prod-prod-aic-gd-cn-shanghai.oss-cn-shanghai.aliyuncs.com/fivesensesegmenter/prod/318E490D-6955-5720-B1B4-31093242D00A/l_lip/_35e6_20211231-040959.png?Expires=1640925599&amp;OSSAccessKeyId=LTAI****************&amp;Signature=sFeMY%2B5u0TgyqhHplY4z3qvxVn****</ImageURL>\\n <Name>l_lip</Name>\\n </Elements>\\n </Data>\\n</ParseFaceResponse>","errorExample":""}]',
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"43A0AEB6-45F4-4138-8E89-E1A5D63200E3\\",\\n \\"Data\\": {\\n \\"Status\\": \\"PROCESS_SUCCESS\\",\\n \\"ErrorMessage\\": \\"paramsIllegal\\",\\n \\"Result\\": \\"{\\\\\\"ImageUrl\\\\\\":\\\\\\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_/2020-4-2/invi__015858226731531000018_UE7B9p.png?Expires=1585824473&OSSAccessKeyId=LTAI4FoLmvQ9urWXgSR****&Signature=etyeYQQ%2BWAyQTqQKd8Xq0GiOW****\\\\\\"}\\",\\n \\"ErrorCode\\": \\"InvalidParameter\\",\\n \\"JobId\\": \\"49E2CC28-ED1D-4CC5-854D-7D0AE2B20976\\"\\n }\\n}","type":"json"}]',
+ 'title' => 'Query asynchronous task results',
+ 'summary' => 'This topic describes the syntax and examples of the GetAsyncJobResult operation for querying asynchronous task results.',
+ 'description' => '# Feature description'."\n"
+ ."\n"
+ .'After you invoke an asynchronous API operation, the response does not contain the actual result. Save the RequestId from the response, and then invoke GetAsyncJobResult to obtain the actual result.'."\n"
+ ."\n"
+ .'> - Files generated by asynchronous tasks expire after 30 minutes. To retain them for long-term use, promptly download the files to a local server or store them in Object Storage Service (OSS). For more information about OSS operations, see [Upload objects](~~31886~~).'."\n"
+ .'- To learn more about how to access Alibaba Cloud Vision Intelligence Open Platform visual AI API operations, use the interfaces, or consult on issues, join the DingTalk group (23109592) to contact us.'."\n"
+ ."\n\n"
+ .'Currently, the SegmentHDCommonImage operation in the image segmentation category is an asynchronous operation. You must invoke GetAsyncJobResult to obtain the actual result.',
'requestParamsDescription' => ' ',
+ 'responseParamsDescription' => '## SDK reference'."\n"
+ .'We recommend that you use an SDK to call Alibaba Cloud Vision AI operations. SDKs are available for multiple programming languages. File parameters support both local files and arbitrary URLs when you use an SDK. For more information, see [SDK overview](~~145033~~).',
+ 'extraInfo' => '## Result deserialization'."\n"
+ ."\n"
+ .'The following example shows the deserialized Result.'."\n"
+ ."\n"
+ .'```'."\n"
+ .'{'."\n"
+ .' "ImageUrl": "http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_/2020-4-2/invi__015858228333801000019_zs0HOi.png?Expires=1585824633&OSSAccessKeyId=LTAI4FoLmvQ9urWXgSR*****&Signature=YHSg24oLm3yk********%3D"'."\n"
+ .'}'."\n"
+ .'```'."\n"
+ ."\n"
+ .'## Error codes'."\n"
+ ."\n"
+ .'For more information, see [Common error codes](~~146751~~).'."\n"
+ ."\n"
+ .'## Security notice'."\n"
+ .'- Ensure that the uploaded images or files comply with applicable laws and regulations.'."\n"
+ .'- Temporary files uploaded through the debugging console are valid for 1 hour and are automatically cleaned up and deleted by the system after 24 hours.',
+ 'changeSet' => [
+ ['createdAt' => '2022-04-24T08:11:47.000Z', 'description' => 'Error codes changed'],
+ ],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'GetAsyncJobResult'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'get',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:GetAsyncJobResult',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ ],
],
'RefineMask' => [
- 'methods' => [
- 'post',
- ],
- 'schemes' => [
- 'http',
- 'https',
- ],
+ 'methods' => ['post'],
+ 'schemes' => ['http', 'https'],
'security' => [
[
'AK' => [],
@@ -235,72 +277,136 @@
[
'name' => 'MaskImageURL',
'in' => 'formData',
- 'schema' => [
- 'description' => '',
- 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/RefineMask/RefineMask6.jpg',
- 'isFileTransferUrl' => true,
- 'required' => true,
- 'type' => 'string',
- ],
+ 'schema' => ['description' => 'The coarse mask image that corresponds to the input image.', 'type' => 'string', 'required' => true, 'isFileTransferUrl' => true, 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/RefineMask/RefineMask6.jpg', 'title' => ''],
],
[
'name' => 'ImageURL',
'in' => 'formData',
- 'schema' => [
- 'description' => '',
- 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/RefineMask/RefineMask1.jpg',
- 'isFileTransferUrl' => true,
- 'required' => true,
- 'type' => 'string',
- ],
+ 'schema' => ['description' => 'The URL of the image. We recommend that you use an Object Storage Service (OSS) URL in the Shanghai region. If the file is stored locally or the OSS URL is not in the Shanghai region, see [File URL processing](~~155645~~).', 'type' => 'string', 'required' => true, 'isFileTransferUrl' => true, 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/RefineMask/RefineMask1.jpg', 'title' => ''],
],
],
'responses' => [
200 => [
'schema' => [
+ 'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'description' => '',
- 'example' => 'E948F80B-86D9-54E0-9FF9-ACF3B1DA83C4',
- 'type' => 'string',
- ],
+ 'RequestId' => ['description' => 'The request ID.', 'type' => 'string', 'example' => 'E948F80B-86D9-54E0-9FF9-ACF3B1DA83C4', 'title' => ''],
'Data' => [
- 'description' => '',
+ 'description' => 'The returned data.',
+ 'type' => 'object',
'properties' => [
'Elements' => [
- 'description' => '',
+ 'description' => 'The output images.',
+ 'type' => 'array',
'items' => [
+ 'type' => 'object',
'properties' => [
- 'ImageURL' => [
- 'description' => '',
- 'example' => 'http://algo-app-taobao-mm-cn-shanghai-prod.oss-cn-shanghai.aliyuncs.com/pixelai-portrait-beauty%2F2020_03_04%2F61f544a1a5004c88a2bf29452db494e9.jpeg?OSSAccessKeyId=LTAI4Fmdm1gQonFLrghJ****&Expires=1583406122&Signature=Heet1ivG0xFP3YlO6usvd0pmrH****',
- 'type' => 'string',
- ],
+ 'ImageURL' => ['description' => 'The URL of the output refined mask image.'."\n"
+ .'> This URL is a temporary URL that is valid for 30 minutes. After it expires, the URL is no longer accessible. To save the file for a longer period or permanently, access the URL within 30 minutes and download the file to your own OSS bucket or other storage.', 'type' => 'string', 'example' => 'http://algo-app-taobao-mm-cn-shanghai-prod.oss-cn-shanghai.aliyuncs.com/pixelai-portrait-beauty%2F2020_03_04%2F61f544a1a5004c88a2bf29452db494e9.jpeg?OSSAccessKeyId=LTAI****************&Expires=1583406122&Signature=Heet1ivG0xFP3YlO6usvd0pmrH****', 'title' => ''],
],
- 'type' => 'object',
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
],
- 'type' => 'array',
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
],
],
],
- 'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"E948F80B-86D9-54E0-9FF9-ACF3B1DA83C4\\",\\n \\"Data\\": {\\n \\"Elements\\": [\\n {\\n \\"ImageURL\\": \\"http://algo-app-taobao-mm-cn-shanghai-prod.oss-cn-shanghai.aliyuncs.com/pixelai-portrait-beauty%2F2020_03_04%2F61f544a1a5004c88a2bf29452db494e9.jpeg?OSSAccessKeyId=LTAI****************&Expires=1583406122&Signature=Heet1ivG0xFP3YlO6usvd0pmrH****\\"\\n }\\n ]\\n }\\n}","errorExample":""},{"type":"xml","example":"<RefineMaskResponse>\\n <RequestId>E948F80B-86D9-54E0-9FF9-ACF3B1DA83C4</RequestId>\\n <Data>\\n <Elements>\\n <ImageURL>http://algo-app-taobao-mm-cn-shanghai-prod.oss-cn-shanghai.aliyuncs.com/pixelai-portrait-beauty%2F2020_03_04%2F61f544a1a5004c88a2bf29452db494e9.jpeg?OSSAccessKeyId=LTAI****************&amp;Expires=1583406122&amp;Signature=Heet1ivG0xFP3YlO6usvd0pmrH****</ImageURL>\\n </Elements>\\n </Data>\\n</RefineMaskResponse>","errorExample":""}]',
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"E948F80B-86D9-54E0-9FF9-ACF3B1DA83C4\\",\\n \\"Data\\": {\\n \\"Elements\\": [\\n {\\n \\"ImageURL\\": \\"http://algo-app-taobao-mm-cn-shanghai-prod.oss-cn-shanghai.aliyuncs.com/pixelai-portrait-beauty%2F2020_03_04%2F61f544a1a5004c88a2bf29452db494e9.jpeg?OSSAccessKeyId=LTAI****************&Expires=1583406122&Signature=Heet1ivG0xFP3YlO6usvd0pmrH****\\"\\n }\\n ]\\n }\\n}","type":"json"}]',
+ 'title' => 'Mask refinement segmentation',
+ 'summary' => 'Describes the syntax and provides examples of RefineMask for mask refinement segmentation.',
+ 'description' => '## Feature description'."\n"
+ .'The mask refinement segmentation feature refines an input image and a coarse mask to produce a refined mask.'."\n"
+ .'The following figures show examples of this operation:'."\n"
+ .'Input example screenshots:'."\n"
+ .'![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20230206/ajmp/RefineMask1.png" width="300)'."\n"
+ .'![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20230206/aebc/RefineMask2.png" width="300)'."\n"
+ ."\n"
+ .'Output example screenshot:'."\n"
+ .'![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20230206/hzhh/RefineMaskjieguo.png" width="300)'."\n"
+ ."\n"
+ .'> - You can visit [Online Consultation](https://www.aliyun.com/core/online-consult?from=aZgW6LJHr2) to get online assistance.'."\n"
+ .'- You can try this feature for free on the Vision Intelligence Open Platform. Click [Try Now](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=RefineMask) to experience this feature or purchase it online.'."\n"
+ .'- To consult about accessing Vision AI APIs, using interfaces, or resolving issues on the Alibaba Cloud Vision Intelligence Open Platform, join the DingTalk group (23109592) to contact us.'."\n"
+ ."\n"
+ .'## Access guide'."\n"
+ .'1. Register an Alibaba Cloud account: Go to the [Alibaba Cloud official website](https://www.aliyun.com), click **Register Now** in the upper-right corner, and follow the instructions to complete registration.'."\n"
+ .'2. Activate the feature: Make sure you have activated the [Image Segmentation service](https://vision.aliyun.com/imageseg). If you have not activated the service, [activate it now](https://common-buy.aliyun.com/?commodityCode=viapi_imageseg_public_cn#/open).'."\n"
+ .'3. Create an AccessKey: Make sure you have [created an AccessKey](~~175144~~). If you are using a RAM user AccessKey, grant the AliyunVIAPIFullAccess permission to the RAM user. For more information, see [RAM authorization](~~145025~~).'."\n"
+ .'4. Online debugging (optional): You can use [OpenAPI Explorer](https://next.api.aliyun.com/api/imageseg/2019-12-30/RefineMask?lang=JAVA&sdkStyle=dara&params=%7B%22ImageURL%22%3A%22http%3A%2F%2Fviapi-test.oss-cn-shanghai.aliyuncs.com%2Fviapi-3.0domepic%2Fimageseg%2FRefineMask%2FRefineMask1.jpg%22%2C%22MaskImageURL%22%3A%22http%3A%2F%2Fviapi-test.oss-cn-shanghai.aliyuncs.com%2Fviapi-3.0domepic%2Fimageseg%2FRefineMask%2FRefineMask6.jpg%22%7D&tab=DEMO) to debug this feature online, view complete sample code and SDK dependency information, or download the complete project.'."\n"
+ .'5. Development access steps:'."\n"
+ .'- Select the SDK language you want to use from the [SDK overview](~~145033~~).'."\n"
+ .'- Find the SDK package for the Image Segmentation (imageseg) AI category in the corresponding SDK documentation and install it.'."\n"
+ .'- Modify the sample code provided in the References as needed and invoke the operation.'."\n"
+ ."\n"
+ .'6. Sample code: For sample code in commonly used languages, see [Mask refinement segmentation sample code](~~605126~~).'."\n"
+ ."\n"
+ .'7. Direct client calls: Common client call methods for this feature include the following:'."\n"
+ .'- [Direct call from web frontend](~~467779~~)'."\n"
+ .'- [Direct call from mini programs](~~467780~~)'."\n"
+ .'- [Direct call from Android](~~467781~~)'."\n"
+ .'- [Direct call from iOS](~~467782~~).'."\n"
+ ."\n"
+ .'## Input limits'."\n"
+ .'- Image format: JPG, JPEG, BMP, or PNG.'."\n"
+ .'- Image size: Less than 3 MB.'."\n"
+ .'- Image resolution: Greater than 32 × 32 pixels and less than 2000 × 2000 pixels. The input image and the coarse mask image must have the same resolution.'."\n"
+ .'- The URL cannot contain Chinese characters.'."\n"
+ ."\n"
+ .'## Billing description'."\n"
+ .'For the billable methods and pricing of mask refinement segmentation, see [Billing overview](~~190132~~).'."\n"
+ ."\n"
+ .'> The debugging interface below is a paid interface. To try it for free, go to the [Experience Center](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=RefineMask).',
'requestParamsDescription' => ' ',
+ 'responseParamsDescription' => '## SDK reference'."\n"
+ .'For the mask refinement segmentation feature under the Alibaba Cloud Vision AI Image Segmentation category, we recommend that you use the SDK. The SDK supports multiple programming languages. When calling this operation, select the SDK package for the Image Segmentation (imageseg) AI category. File parameters can be passed as local files or arbitrary URLs through the SDK. For more information, see [SDK overview](~~145033~~).'."\n"
+ ."\n"
+ .'## Sample code'."\n"
+ .'For sample code in commonly used languages, see [Mask refinement segmentation sample code](~~605126~~).',
+ 'extraInfo' => '## Error codes'."\n"
+ .'For error codes of mask refinement segmentation, see [Common error codes](~~146751~~).'."\n"
+ ."\n"
+ .'## SDK reference'."\n"
+ .'Alibaba Cloud Vision AI supports SDK calls. For more information, see [SDK overview](~~145033~~) to download and install the SDK.'."\n"
+ ."\n"
+ .'## Security notice'."\n"
+ .'- Make sure that the uploaded images or files comply with applicable laws and regulations.'."\n"
+ .'- Temporary files uploaded through the experience debugging interface are valid for 1 hour and are automatically deleted by the system after 24 hours.',
+ 'changeSet' => [
+ ['createdAt' => '2022-09-29T08:00:10.000Z', 'description' => 'Request parameters changed'],
+ ],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'RefineMask'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:RefineMask',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ ],
],
'SegmentBody' => [
- 'methods' => [
- 'post',
- 'get',
- ],
- 'schemes' => [
- 'http',
- 'https',
- ],
+ 'methods' => ['post', 'get'],
+ 'schemes' => ['http', 'https'],
'security' => [
[
'AK' => [],
@@ -313,63 +419,157 @@
[
'name' => 'ImageURL',
'in' => 'query',
- 'schema' => [
- 'description' => '',
- 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentBody/SegmentBody1.png',
- 'isFileTransferUrl' => true,
- 'required' => true,
- 'type' => 'string',
- ],
+ 'schema' => ['description' => 'The URL of the image. We recommend that you use an OSS URL in the Shanghai region. If the file is stored locally or in an OSS bucket outside the Shanghai region, see [File URL processing](~~155645~~).'."\n"
+ .'Image format requirements:'."\n"
+ ."\n"
+ .'- Image format: JPEG, JPG, PNG (8-bit, 16-bit, and 64-bit PNG are not supported), BMP, and WEBP.'."\n"
+ .'- Image size: up to 3 MB.'."\n"
+ .'- Image resolution: less than 2000 × 2000 pixels.'."\n"
+ .'- The URL cannot contain Chinese characters.', 'type' => 'string', 'required' => true, 'isFileTransferUrl' => true, 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentBody/SegmentBody1.png', 'title' => ''],
],
[
'name' => 'ReturnForm',
'in' => 'query',
- 'schema' => [
- 'description' => '',
- 'example' => 'mask',
- 'required' => false,
- 'type' => 'string',
- ],
+ 'schema' => ['description' => 'The format of the returned image.'."\n"
+ ."\n"
+ .'- If set to `mask`, a single-channel black-and-white image is returned.'."\n"
+ ."\n"
+ .'- If set to `crop`, a cropped 4-channel PNG image is returned (blank edges are cropped).'."\n"
+ ."\n"
+ .'- If set to `whiteBK`, an image with a white background is returned.'."\n"
+ ."\n"
+ .'- If not set or set to other values, a 4-channel PNG image is returned.', 'type' => 'string', 'required' => false, 'example' => 'mask', 'title' => ''],
],
],
'responses' => [
200 => [
'schema' => [
+ 'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'description' => '',
- 'example' => '30EDCEEA-2806-44C6-AF0B-0988849106FE',
- 'type' => 'string',
- ],
+ 'RequestId' => ['description' => 'The request ID.', 'type' => 'string', 'example' => '30EDCEEA-2806-44C6-AF0B-0988849106FE', 'title' => ''],
'Data' => [
- 'description' => '',
+ 'description' => 'The returned result data.',
+ 'type' => 'object',
'properties' => [
- 'ImageURL' => [
- 'description' => '',
- 'example' => 'http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_humansegmenter/2021-3-31/invi_humansegmenter_016171823500001081370_Ej0WwO.jpg?Expires=1617184150&OSSAccessKeyId=LTAI4FoLmvQ9urWXgSRp****&Signature=ZwaWXpAOMzHar%2B1wVO7zeSD83r****',
- 'type' => 'string',
- ],
+ 'ImageURL' => ['description' => 'The URL of the result image.'."\n"
+ .'The format of the returned image is determined by the request parameters.'."\n"
+ .'- If set to `mask`, a single-channel black-and-white image is returned.'."\n"
+ .'- If set to `crop`, a cropped 4-channel PNG image is returned (blank edges are cropped).'."\n"
+ .'- If set to `whiteBK`, an image with a white background is returned.'."\n"
+ .'- If not set or set to other values, a 4-channel PNG image is returned, uncompressed, with the original image dimensions preserved. The file size will increase.'."\n"
+ ."\n"
+ .'> This URL is a temporary address that is valid for 30 minutes. After it expires, the URL is no longer accessible. To save the file for a longer period or permanently, access the URL within 30 minutes and download the file to your own OSS bucket or other storage.', 'type' => 'string', 'example' => 'http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_humansegmenter/2021-3-31/invi_humansegmenter_016171823500001081370_Ej0WwO.jpg?Expires=1617184150&OSSAccessKeyId=LTAI****************&Signature=ZwaWXpAOMzHar%2B1wVO7zeSD83r****', 'title' => ''],
],
- 'type' => 'object',
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
],
],
],
- 'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"30EDCEEA-2806-44C6-AF0B-0988849106FE\\",\\n \\"Data\\": {\\n \\"ImageURL\\": \\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_humansegmenter/2021-3-31/invi_humansegmenter_016171823500001081370_Ej0WwO.jpg?Expires=1617184150&OSSAccessKeyId=LTAI****************&Signature=ZwaWXpAOMzHar%2B1wVO7zeSD83r****\\"\\n }\\n}","errorExample":""},{"type":"xml","example":"<SegmentBodyResponse>\\n <RequestId>30EDCEEA-2806-44C6-AF0B-0988849106FE</RequestId>\\n <Data>\\n <ImageURL>http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_humansegmenter/2021-3-31/invi_humansegmenter_016171823500001081370_Ej0WwO.jpg?Expires=1617184150&amp;OSSAccessKeyId=LTAI****************&amp;Signature=ZwaWXpAOMzHar%2B1wVO7zeSD83r****</ImageURL>\\n </Data>\\n</SegmentBodyResponse>","errorExample":""}]',
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"30EDCEEA-2806-44C6-AF0B-0988849106FE\\",\\n \\"Data\\": {\\n \\"ImageURL\\": \\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_humansegmenter/2021-3-31/invi_humansegmenter_016171823500001081370_Ej0WwO.jpg?Expires=1617184150&OSSAccessKeyId=LTAI****************&Signature=ZwaWXpAOMzHar%2B1wVO7zeSD83r****\\"\\n }\\n}","type":"json"}]',
+ 'title' => 'Human body segmentation',
+ 'summary' => 'This topic describes the syntax and provides examples of the human body segmentation feature (SegmentBody).',
+ 'description' => '## Feature description'."\n"
+ .'The human body segmentation feature identifies human body contours in an input image, separates them from the background, and returns a segmented foreground portrait image (4-channel). This feature is applicable to real-person photos and is not applicable to cartoon images.'."\n"
+ .'The following figures show examples of this feature:'."\n"
+ ."\n"
+ .'- Input image'."\n"
+ .'![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20221108/uqbc/SegmentBody.png" width="500)'."\n"
+ .'- Output image (4-channel transparent image by default, with the same resolution as the original image)'."\n"
+ .'![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20221108/vuji/SegmentBodyjieguo.png" width="500)'."\n"
+ ."\n"
+ .'You can specify the ReturnForm parameter to define the output format:'."\n"
+ ."\n"
+ .'- Set to **crop** to crop the blank edges'."\n"
+ .'![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20221108/pfxs/SegmentBodycrop.png" width="500)'."\n"
+ .'- Set to **mask** to return a binary mask image'."\n"
+ .'![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20221108/ltcq/SegmentBodymask.png" width="500)'."\n"
+ .'- Set to **whiteBK** to return an image with a white background'."\n"
+ .'![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20221108/qqrj/SegmentBodywhiteBK.png" width="500)'."\n"
+ ."\n"
+ .'> - You can visit [Online Consultation](https://www.aliyun.com/core/online-consult?from=aZgW6LJHr2) to get online assistance.'."\n"
+ .'- You can try this feature for free on the Visual Intelligence Open Platform. Click [Try Now](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=SegmentBody) to experience this feature or purchase it online.'."\n"
+ .'- For questions about API integration and usage of Alibaba Cloud Visual Intelligence Open Platform, join the DingTalk group (23109592) to contact us.'."\n"
+ ."\n"
+ .'## Common scenarios'."\n"
+ ."\n"
+ .'- Portrait photography: The human body segmentation feature separates the subject from the background and blurs the background to achieve a shallow depth of field effect, highlighting the subject.'."\n"
+ ."\n"
+ .'- ID photo creation: Upload or take a casual photo. The feature precisely segments the person from the background. Combined with other background processing capabilities, you can create a standard ID photo.'."\n"
+ ."\n"
+ .'## Advantages'."\n"
+ ."\n"
+ .'- Hair-level precision: Provides higher segmentation accuracy for fine details. Even individual hair strands can be precisely segmented, making the result image look natural and unprocessed.'."\n"
+ ."\n"
+ .'- Complex background adaptation: Even when the subject is in a complex background environment, the feature can accurately segment the human body from the background.'."\n"
+ ."\n"
+ .'## Integration guide'."\n"
+ .'1. Register an Alibaba Cloud account: Go to the [Alibaba Cloud official website](https://www.aliyun.com). In the upper-right corner, click **Register Now** and follow the instructions to complete registration.'."\n"
+ .'2. Activate the feature: Make sure you have activated the [Image Segmentation service](https://vision.aliyun.com/imageseg). If you have not activated the service, [activate it now](https://common-buy.aliyun.com/?commodityCode=viapi_imageseg_public_cn#/open).'."\n"
+ .'3. Create an AccessKey pair: Make sure you have [created an AccessKey pair](~~175144~~). If you are using a RAM user AccessKey, grant the AliyunVIAPIFullAccess permission to the RAM user. For more information, see [RAM authorization](~~145025~~).'."\n"
+ .'4. Online debugging (optional): You can use [OpenAPI Explorer](https://next.api.aliyun.com/api/imageseg/2019-12-30/SegmentBody?lang=JAVA&sdkStyle=dara&params=%7B%22ImageURL%22%3A%22http%3A%2F%2Fviapi-test.oss-cn-shanghai.aliyuncs.com%2Fviapi-3.0domepic%2Fimageseg%2FSegmentBody%2FSegmentBody1.png%22%7D&tab=DEMO) to debug this feature online, view complete sample code and SDK dependency information, or download the complete project.'."\n"
+ .'5. Development and integration steps:'."\n"
+ .'- Select the SDK language you want to use from the [SDK overview](~~145033~~).'."\n"
+ .'- Find the SDK package for the Image Segmentation (imageseg) category in the corresponding SDK documentation and install it.'."\n"
+ .'- Modify the sample code provided in the References as needed and invoke the API.'."\n"
+ ."\n"
+ .'6. Sample code: For sample code in common programming languages and examples of post-processing results, see [Human body segmentation sample code](~~467471~~).'."\n"
+ ."\n"
+ .'7. Direct client calls: Common client-side calling methods for this feature include the following:'."\n"
+ .'- [Direct call from web frontend](~~467779~~)'."\n"
+ .'- [Direct call from mini programs](~~467780~~)'."\n"
+ .'- [Direct call from Android](~~467781~~)'."\n"
+ .'- [Direct call from iOS](~~467782~~).'."\n"
+ ."\n"
+ .'## Input limits'."\n"
+ .'- Image format: JPEG, JPG, PNG (8-bit, 16-bit, and 64-bit PNG are not supported), BMP, and WEBP.'."\n"
+ .'- Image size: up to 3 MB.'."\n"
+ .'- Image resolution: less than 2000 × 2000 pixels.'."\n"
+ .'- The URL cannot contain Chinese characters.'."\n"
+ ."\n"
+ .'## Billing description'."\n"
+ .'For information about the billable methods and pricing of human body segmentation, see [Billing overview](~~190132~~).',
'requestParamsDescription' => ' ',
- 'responseParamsDescription' => ' ',
+ 'responseParamsDescription' => '## SDK reference'."\n"
+ .'For the human body segmentation feature under the Alibaba Cloud Visual AI Image Segmentation category, we recommend that you use the SDK. The SDK supports multiple programming languages. When calling the API, select the SDK package for the Image Segmentation (imageseg) category. The SDK supports local files and arbitrary URLs for file parameters. For more information, see [SDK overview](~~145033~~).'."\n"
+ ."\n"
+ .'## Sample code and best practices'."\n"
+ .'For sample code in common programming languages and examples of post-processing results, see [Human body segmentation sample code](~~467471~~).',
+ 'extraInfo' => '## Error codes'."\n"
+ .'For error codes of human body segmentation, see [Common error codes](~~146751~~).'."\n"
+ ."\n"
+ .'## Security notice'."\n"
+ .'- Ensure that the uploaded images or files comply with applicable laws and regulations.'."\n"
+ .'- Temporary files uploaded through the debugging console are valid for 1 hour and are automatically deleted by the system after 24 hours.',
+ 'changeSet' => [
+ ['createdAt' => '2022-11-01T05:49:48.000Z', 'description' => 'Request parameters changed'],
+ ],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentBody'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentBody',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ ],
],
'SegmentCloth' => [
- 'methods' => [
- 'post',
- 'get',
- ],
- 'schemes' => [
- 'http',
- 'https',
- ],
+ 'methods' => ['post', 'get'],
+ 'schemes' => ['http', 'https'],
'security' => [
[
'AK' => [],
@@ -377,103 +577,211 @@
],
'operationType' => 'read',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'none',
- ],
+ 'systemTags' => ['operationType' => 'none'],
'parameters' => [
[
'name' => 'ImageURL',
'in' => 'query',
- 'schema' => [
- 'description' => '',
- 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentCloth/SegmentCloth1.jpg',
- 'isFileTransferUrl' => true,
- 'required' => true,
- 'type' => 'string',
- ],
+ 'schema' => ['description' => 'The image URL. We recommend using an OSS link in the Shanghai region. If the file is stored locally or in a non-Shanghai region OSS, see [File URL Processing](~~155645~~).', 'type' => 'string', 'required' => true, 'isFileTransferUrl' => true, 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentCloth/SegmentCloth1.jpg', 'title' => ''],
],
[
'name' => 'OutMode',
'in' => 'query',
- 'schema' => [
- 'type' => 'integer',
- 'format' => 'int64',
- ],
+ 'schema' => ['description' => 'The type of segmentation result to return, which affects the content returned in the ImageURL field. This is an optional parameter.'."\n"
+ ."\n"
+ .'- 0 (default): The default main clothing segmentation result.'."\n"
+ ."\n"
+ .'- 1: A combined segmentation result of user-specified class categories.', 'type' => 'integer', 'format' => 'int64', 'required' => false, 'example' => '0或1', 'title' => ''],
],
[
'name' => 'ClothClass',
'in' => 'query',
'style' => 'repeatList',
'schema' => [
+ 'description' => 'The clothing category. Valid values:'."\n"
+ .'- tops: Upper garment'."\n"
+ .'- coat: Outerwear'."\n"
+ .'- skirt: Skirt/Dress'."\n"
+ .'- pants: Trousers'."\n"
+ .'- bag: Bag'."\n"
+ .'- shoes: Shoes'."\n"
+ .'- hat: Hat',
'type' => 'array',
- 'items' => [
- 'type' => 'string',
- ],
+ 'items' => ['description' => 'The clothing category. Multiple values can be passed at a time. Valid values:'."\n"
+ .'- tops: Upper garment'."\n"
+ .'- coat: Outerwear'."\n"
+ .'- skirt: Skirt/Dress'."\n"
+ .'- pants: Trousers'."\n"
+ .'- bag: Bag'."\n"
+ .'- shoes: Shoes'."\n"
+ .'- hat: Hat', 'type' => 'string', 'required' => false, 'example' => 'tops', 'title' => ''],
'required' => false,
'maxItems' => 15,
+ 'title' => '',
+ 'example' => '',
],
],
[
'name' => 'ReturnForm',
'in' => 'query',
- 'schema' => [
- 'type' => 'string',
- ],
+ 'schema' => ['description' => 'Specifies the format of the returned image. Valid values:'."\n"
+ ."\n"
+ .'- whiteBK: Returns a white background image.'."\n"
+ .'- mask: Returns a single-channel mask.'."\n"
+ .'- If not set, a four-channel PNG image is returned.'."\n"
+ .'> - This parameter only applies to the output ImageURL. It does not affect ClassUrl, which always returns a mask channel image.', 'type' => 'string', 'required' => false, 'example' => 'whiteBK', 'title' => ''],
],
],
'responses' => [
200 => [
'schema' => [
+ 'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'description' => '',
- 'example' => 'BCE049A3-FE69-41CF-A870-5970156388A7',
- 'type' => 'string',
- ],
+ 'RequestId' => ['description' => 'The request ID.', 'type' => 'string', 'example' => 'BCE049A3-FE69-41CF-A870-5970156388A7', 'title' => ''],
'Data' => [
- 'description' => '',
+ 'description' => 'The returned result data.',
+ 'type' => 'object',
'properties' => [
'Elements' => [
- 'description' => '',
+ 'description' => 'The array of returned elements.',
+ 'type' => 'array',
'items' => [
+ 'description' => 'The array of returned elements.',
+ 'type' => 'object',
'properties' => [
- 'ImageURL' => [
- 'description' => '',
- 'example' => 'http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/clothingsegmentation-2020-06-17-16-54-40-688c84cbbd-hnqfq/2020-6-18/invi__015924459307821000041_IIVHoM.png?Expires=1592447730&OSSAccessKeyId=LTAI4FoLmvQ9urWXgSRp****&Signature=Hy8pn3IQj8nuKN0LEaC57cee9L****',
- 'type' => 'string',
- ],
+ 'ImageURL' => ['description' => 'The URL of the returned segmentation result image.'."\n"
+ .'After segmentation, a four-channel PNG image is returned without compression. The image dimensions remain the same, but the file size may increase.'."\n"
+ .'> This URL is a temporary address valid for 30 minutes. After expiration, it will no longer be accessible. If you need to store the file for a longer period or permanently, access the URL within 30 minutes and download the file to your own OSS or other storage.', 'type' => 'string', 'example' => 'http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/clothingsegmentation-2020-06-17-16-54-40-688c84cbbd-hnqfq/2020-6-18/invi__015924459307821000041_IIVHoM.png?Expires=1592447730&OSSAccessKeyId=LTAI****************&Signature=Hy8pn3IQj8nuKN0LEaC57cee9L****', 'title' => ''],
'ClassUrl' => [
+ 'description' => 'Returns a URL corresponding to each clothing category based on the user-specified `clothClass` input.'."\n"
+ .'> This URL is a temporary address valid for 30 minutes. After expiration, it will no longer be accessible. If you need to store the file for a longer period or permanently, access the URL within 30 minutes and download the file to your own OSS or other storage.',
'type' => 'object',
- 'additionalProperties' => [
- 'type' => 'string',
- ],
+ 'additionalProperties' => ['description' => 'Returns a URL corresponding to each clothing category based on the user-specified `clothClass` input.'."\n"
+ .'> This URL is a temporary address valid for 30 minutes. After expiration, it will no longer be accessible. If you need to store the file for a longer period or permanently, access the URL within 30 minutes and download the file to your own OSS or other storage.', 'type' => 'string', 'example' => '{\'tops\':http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/..,\'hat\':http://viapi-cn-shanghai-dha-segmenter...,...}', 'title' => ''],
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'title' => '',
+ 'example' => '',
],
- 'type' => 'array',
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
],
],
],
- 'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"BCE049A3-FE69-41CF-A870-5970156388A7\\",\\n \\"Data\\": {\\n \\"Elements\\": [\\n {\\n \\"ImageURL\\": \\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/clothingsegmentation-2020-06-17-16-54-40-688c84cbbd-hnqfq/2020-6-18/invi__015924459307821000041_IIVHoM.png?Expires=1592447730&OSSAccessKeyId=LTAI****************&Signature=Hy8pn3IQj8nuKN0LEaC57cee9L****\\",\\n \\"ClassUrl\\": {\\n \\"key\\": \\"{\'tops\':http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/..,\'hat\':http://viapi-cn-shanghai-dha-segmenter...,...}\\"\\n }\\n }\\n ]\\n }\\n}","errorExample":""},{"type":"xml","example":"<SegmentClothResponse>\\n <RequestId>BCE049A3-FE69-41CF-A870-5970156388A7</RequestId>\\n <Data>\\n <Elements>\\n <ImageURL>http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/clothingsegmentation-2020-06-17-16-54-40-688c84cbbd-hnqfq/2020-6-18/invi__015924459307821000041_IIVHoM.png?Expires=1592447730&amp;OSSAccessKeyId=LTAI****************&amp;Signature=Hy8pn3IQj8nuKN0LEaC57cee9L****</ImageURL>\\n <ClassUrl>\\n <key>{\'tops\':http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/..,\'hat\':http://viapi-cn-shanghai-dha-segmenter...,...}</key>\\n </ClassUrl>\\n </Elements>\\n </Data>\\n</SegmentClothResponse>","errorExample":""}]',
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"BCE049A3-FE69-41CF-A870-5970156388A7\\",\\n \\"Data\\": {\\n \\"Elements\\": [\\n {\\n \\"ImageURL\\": \\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/clothingsegmentation-2020-06-17-16-54-40-688c84cbbd-hnqfq/2020-6-18/invi__015924459307821000041_IIVHoM.png?Expires=1592447730&OSSAccessKeyId=LTAI****************&Signature=Hy8pn3IQj8nuKN0LEaC57cee9L****\\",\\n \\"ClassUrl\\": {\\n \\"key\\": \\"{\'tops\':http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/..,\'hat\':http://viapi-cn-shanghai-dha-segmenter...,...}\\"\\n }\\n }\\n ]\\n }\\n}","type":"json"}]',
+ 'title' => 'Clothing Segmentation',
+ 'summary' => 'This topic describes the syntax and examples of the clothing segmentation feature SegmentCloth.',
+ 'description' => '## Feature Description'."\n"
+ .'The clothing segmentation feature can perform pixel-level segmentation on the main clothing in input images of mannequin outfits, real-person outfits, standalone garments, and virtual character outfits, and return the segmentation result. Clothing segmentation primarily performs fine-grained segmentation of clothing in images. The standard clothing segmentation supports segmentation of outerwear, upper garments (including lining), trousers, skirts, hats, shoes, and bags. For other items such as belts, ties, and other accessories, we recommend using [Product Segmentation](~~151961~~).'."\n"
+ .'The following shows example images of this feature:'."\n"
+ .'Input original image (left) and output result image (right)'."\n"
+ .'- Identified clothing categories: tops (upper garment), skirt (skirt/dress), shoes (shoes)'."\n"
+ .'![](https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20231213/xnvf/SegmentClothtops_skirt_shoes.png" width="400)'."\n"
+ .'- Identified clothing categories: tops (upper garment), pants (trousers), shoes (shoes), bag (bag)'."\n"
+ .'![](https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20231213/hptw/SegmentClothtops_pants_shoes_bag.png" width="400)'."\n"
+ .'- Identified clothing category: hat (hat)'."\n"
+ .'![](https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20231213/guxr/SegmentClothhat.png" width="400)'."\n"
+ ."\n"
+ .'You can pass the ReturnForm parameter to specify the format of the returned result:'."\n"
+ .'- Specify as **mask** to return a binary mask image.'."\n"
+ .'![](https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20231213/zadd/SegmentClothmask.png" width="400)'."\n"
+ .'- Specify as **whiteBK** to return a white background image.'."\n"
+ .'![](https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20231213/nwyz/SegmentClothwhiteBK.png" width="400)'."\n"
+ .'- If no parameter is specified, a transparent background image is returned.'."\n"
+ .'![](https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20231213/mkru/SegmentCloth.png" width="400)'."\n"
+ ."\n"
+ .'> - You can visit [Online Consultation](https://www.aliyun.com/core/online-consult?from=aZgW6LJHr2) to get online assistance.'."\n"
+ .'- This feature is available for free trial on the Vision Intelligence Open Platform. You can click [Try Now](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=SegmentCloth) to try this feature interactively and make online purchases.'."\n"
+ .'- For questions about Alibaba Cloud Vision Intelligence Open Platform Vision AI API access, interface usage, or consultation, please contact us by joining the DingTalk group (23109592).'."\n"
+ ."\n"
+ .'## Use Cases'."\n"
+ .'- E-commerce clothing segmentation: Perform foreground segmentation on e-commerce clothing images to achieve background separation and replacement, enabling batch processing and creation of e-commerce clothing main images.'."\n"
+ .'- Virtual try-on creation: In scenarios such as wedding photography, ethnic costumes, traditional Chinese clothing (Hanfu), and cosplay makeup, perform clothing segmentation as a pre-processing step, then use AIGC generation technology for outfit changing and virtual try-on.'."\n"
+ .'- Personalized intelligent recognition: Perform segmentation processing for specified category masks of outerwear, upper garments (including lining), trousers, skirts, hats, shoes, and bags in images, enabling customized clothing type segmentation.'."\n"
+ ."\n"
+ .'## Key Advantages'."\n"
+ .'- Multi-type automatic recognition: Automatically identifies the main clothing in images without specifying clothing positions, and can return specified category masks.'."\n"
+ .'- Applicable to multiple clothing scenarios: Suitable for fine-grained segmentation scenarios including mannequin outfits, real-person outfits, standalone garments, and virtual character outfits.'."\n"
+ .'- Complex full-category segmentation: Suitable for multi-clothing product and complex background conditions for main clothing segmentation, achieving fine-grained full-category segmentation.'."\n"
+ ."\n"
+ .'## Getting Started'."\n"
+ .'1. Register an Alibaba Cloud account: Go to the [Alibaba Cloud official website](https://www.aliyun.com), click **Register Now** in the upper-right corner, and follow the instructions to complete account registration.'."\n"
+ .'2. Activate the service: Make sure you have activated the [Image Segmentation service](https://vision.aliyun.com/imageseg). If you have not activated the service, [activate it now](https://common-buy.aliyun.com/?commodityCode=viapi_imageseg_public_cn#/open).'."\n"
+ .'3. Create an AccessKey: Make sure you have [created an AccessKey](~~175144~~). If you are using a RAM user AccessKey, you need to grant the AliyunVIAPIFullAccess permission to the RAM user. For detailed instructions, see [RAM Authorization](~~145025~~).'."\n"
+ .'4. Online debugging (optional): You can use [OpenAPI Explorer](https://next.api.aliyun.com/api/imageseg/2019-12-30/SegmentCloth?lang=JAVA&sdkStyle=dara&params=%7B%22ImageURL%22%3A%22http%3A%2F%2Fviapi-test.oss-cn-shanghai.aliyuncs.com%2Fviapi-3.0domepic%2Fimageseg%2FSegmentCloth%2FSegmentCloth1.jpg%22%7D&tab=DEMO) to debug the feature online, view complete sample code and SDK dependency information, or download the complete project.'."\n"
+ .'5. Development integration steps:'."\n"
+ .'- Select the SDK language you want to use from the [SDK Overview](~~145033~~).'."\n"
+ .'- Find the SDK package for the AI category Image Segmentation (imageseg) in the corresponding language SDK documentation and install it.'."\n"
+ .'- Refer to the sample code provided in the documentation, make appropriate modifications, and call the API.'."\n"
+ ."\n"
+ .'6. Sample code: For sample code in commonly used languages for this feature, see [Clothing Segmentation Sample Code](~~605161~~).'."\n"
+ ."\n"
+ .'7. Client-side direct calls: Common client-side call methods for this feature include the following.'."\n"
+ .'- [Web frontend direct call](~~467779~~)'."\n"
+ .'- [Mini program direct call](~~467780~~)'."\n"
+ .'- [Android direct call](~~467781~~)'."\n"
+ .'- [iOS direct call](~~467782~~)'."\n"
+ ."\n"
+ .'## Input Limits'."\n"
+ .'- Image format: PNG, JPEG, JPG, BMP.'."\n"
+ .'- Image size: No more than 3 MB.'."\n"
+ .'- Image resolution: Greater than 50×50 pixels and less than 3000×3000 pixels.'."\n"
+ .'- The URL must not contain Chinese characters.'."\n"
+ ."\n"
+ .'## Billing'."\n"
+ .'For information about the billing methods and pricing of clothing segmentation, see [Billing Overview](~~190132~~).'."\n"
+ ."\n"
+ .'> The debugging interface below is a paid interface. For free trial and debugging, please go to the [Experience Center](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=SegmentCloth).',
'requestParamsDescription' => ' ',
- 'responseParamsDescription' => ' ',
+ 'responseParamsDescription' => '## SDK Reference'."\n"
+ .'For the clothing segmentation feature under the Alibaba Cloud Vision AI Image Segmentation category, we recommend using the SDK for calling. Multiple programming languages are supported. When calling, select the SDK package with the AI category Image Segmentation (imageseg). File parameters can be passed via SDK to support both local files and arbitrary URLs. For details, see [SDK Overview](~~145033~~).'."\n"
+ ."\n"
+ .'## Sample Code'."\n"
+ .'For sample code in commonly used languages for this feature, see [Clothing Segmentation Sample Code](~~605161~~).',
+ 'extraInfo' => '## Error Codes'."\n"
+ .'For error codes related to clothing segmentation, see [Common Error Codes](~~146751~~).'."\n"
+ ."\n"
+ .'## Security Notice'."\n"
+ .'- Please ensure that the uploaded images or files comply with applicable laws and regulations.'."\n"
+ .'- Temporary files uploaded through experience debugging are valid for 1 hour and will be automatically deleted by the system after 24 hours.',
+ 'changeSet' => [
+ ['createdAt' => '2024-07-19T02:14:58.000Z', 'description' => 'Request parameters changed'],
+ ['createdAt' => '2023-12-06T02:08:23.000Z', 'description' => 'Request parameters changed, Response parameters changed'],
+ ['createdAt' => '2022-03-30T06:07:10.000Z', 'description' => 'Error codes changed'],
+ ],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentCloth'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'none',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentCloth',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ ],
],
'SegmentCommodity' => [
- 'methods' => [
- 'post',
- 'get',
- ],
- 'schemes' => [
- 'http',
- 'https',
- ],
+ 'methods' => ['post', 'get'],
+ 'schemes' => ['http', 'https'],
'security' => [
[
'AK' => [],
@@ -486,63 +794,148 @@
[
'name' => 'ImageURL',
'in' => 'query',
- 'schema' => [
- 'description' => '',
- 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentCommodity/SegmentCommodity1.jpg',
- 'isFileTransferUrl' => true,
- 'required' => true,
- 'type' => 'string',
- ],
+ 'schema' => ['description' => 'The URL of the image. We recommend that you use an OSS URL in the Shanghai region. If the file is stored locally or in an OSS bucket outside the Shanghai region, see [File URL processing](~~155645~~).'."\n"
+ .'Image format requirements:'."\n"
+ ."\n"
+ .'- Image format: JPEG, JPG, PNG (8-bit, 16-bit, and 64-bit PNG images are not supported), and BMP.'."\n"
+ .'- Image size: up to 3 MB.'."\n"
+ .'- Image resolution: less than 2000 × 2000 pixels.'."\n"
+ .'- The URL cannot contain Chinese characters.', 'type' => 'string', 'required' => true, 'isFileTransferUrl' => true, 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentCommodity/SegmentCommodity1.jpg', 'title' => ''],
],
[
'name' => 'ReturnForm',
'in' => 'query',
- 'schema' => [
- 'description' => '',
- 'example' => 'mask',
- 'required' => false,
- 'type' => 'string',
- ],
+ 'schema' => ['description' => 'The format of the returned image.'."\n"
+ ."\n"
+ .'- If this parameter is not set, a 4-channel PNG image is returned.'."\n"
+ .'- If this parameter is set to `mask`, a single-channel mask is returned.'."\n"
+ .'- If this parameter is set to `whiteBK`, an image with a white background is returned.'."\n"
+ .'- If this parameter is set to `crop`, a 4-channel PNG image with the blank areas around the edges cropped is returned.', 'type' => 'string', 'required' => false, 'example' => 'mask', 'title' => ''],
],
],
'responses' => [
200 => [
'schema' => [
+ 'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'description' => '',
- 'example' => 'D6C24839-91A7-41DA-B31F-98F08EF80CC0',
- 'type' => 'string',
- ],
+ 'RequestId' => ['description' => 'The request ID.', 'type' => 'string', 'example' => 'D6C24839-91A7-41DA-B31F-98F08EF80CC0', 'title' => ''],
'Data' => [
- 'description' => '',
+ 'description' => 'The returned result data.',
+ 'type' => 'object',
'properties' => [
- 'ImageURL' => [
- 'description' => '',
- 'example' => 'http://luban-vgd-invi.oss-cn-hangzhou.aliyuncs.com/upload/result_segmenter/2019-12-20/invi_segmenter_015768355410261076021_Z3t0fc.png?Expires=1577094741&OSSAccessKeyId=LTAI4Fc5SVvzUQ19K1Cz****&Signature=pkaKK3VlfsTR2r%2BYycJzTVEEos****',
- 'type' => 'string',
- ],
+ 'ImageURL' => ['description' => 'The URL of the result image.'."\n"
+ .'The format of the returned image is specified by the request parameter.'."\n"
+ ."\n"
+ .'- If set to `crop`, a 4-channel PNG image with the blank areas around the edges cropped is returned.'."\n"
+ .'- If set to `mask`, a single-channel mask is returned.'."\n"
+ .'- If set to `whiteBK`, an image with a white background is returned.'."\n"
+ .'- If not set, a 4-channel PNG image is returned without compression. The image dimensions remain unchanged, but the file size increases.'."\n"
+ .'> This URL is a temporary address that is valid for 30 minutes. After it expires, the URL is no longer accessible. To save the file for a longer period or permanently, access the URL within 30 minutes and download the file to your own OSS bucket or other storage.', 'type' => 'string', 'example' => 'http://luban-vgd-invi.oss-cn-hangzhou.aliyuncs.com/upload/result_segmenter/2019-12-20/invi_segmenter_015768355410261076021_Z3t0fc.png?Expires=1577094741&OSSAccessKeyId=LTAI****************&Signature=pkaKK3VlfsTR2r%2BYycJzTVEEos****', 'title' => ''],
],
- 'type' => 'object',
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
],
],
],
- 'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"D6C24839-91A7-41DA-B31F-98F08EF80CC0\\",\\n \\"Data\\": {\\n \\"ImageURL\\": \\"http://luban-vgd-invi.oss-cn-hangzhou.aliyuncs.com/upload/result_segmenter/2019-12-20/invi_segmenter_015768355410261076021_Z3t0fc.png?Expires=1577094741&OSSAccessKeyId=LTAI****************&Signature=pkaKK3VlfsTR2r%2BYycJzTVEEos****\\"\\n }\\n}","errorExample":""},{"type":"xml","example":"<SegmentCommodityResponse>\\n <RequestId>D6C24839-91A7-41DA-B31F-98F08EF80CC0</RequestId>\\n <Data>\\n <ImageURL>http://luban-vgd-invi.oss-cn-hangzhou.aliyuncs.com/upload/result_segmenter/2019-12-20/invi_segmenter_015768355410261076021_Z3t0fc.png?Expires=1577094741&amp;OSSAccessKeyId=LTAI****************&amp;Signature=pkaKK3VlfsTR2r%2BYycJzTVEEos****</ImageURL>\\n </Data>\\n</SegmentCommodityResponse>","errorExample":""}]',
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"D6C24839-91A7-41DA-B31F-98F08EF80CC0\\",\\n \\"Data\\": {\\n \\"ImageURL\\": \\"http://luban-vgd-invi.oss-cn-hangzhou.aliyuncs.com/upload/result_segmenter/2019-12-20/invi_segmenter_015768355410261076021_Z3t0fc.png?Expires=1577094741&OSSAccessKeyId=LTAI****************&Signature=pkaKK3VlfsTR2r%2BYycJzTVEEos****\\"\\n }\\n}","type":"json"}]',
+ 'title' => 'Commodity segmentation',
+ 'summary' => 'This topic describes the syntax and provides examples of the commodity segmentation feature (SegmentCommodity).',
+ 'description' => '## Feature description'."\n"
+ .'The commodity segmentation feature identifies the contours of commodities in an input image, separates them from the background, and returns the segmented foreground commodity image (4-channel). This feature is applicable to real-scene images and is not applicable to cartoon images. Commodity segmentation is designed to segment commodities whose full appearance is captured.'."\n"
+ .'The following figures show examples of this feature:'."\n"
+ ."\n"
+ .'- Input image'."\n"
+ .'![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20230206/irrr/SegmentCommodity.jpg" width="500)'."\n"
+ .'- Output image'."\n"
+ .'![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20230206/mqvn/SegmentCommodityjieguo.png" width="500)'."\n"
+ ."\n"
+ .'You can specify the ReturnForm parameter to specify the format of the returned result:'."\n"
+ ."\n"
+ .'- Set to **crop** to crop the blank areas around the edges.'."\n"
+ .'![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20230206/bzvy/SegmentCommoditycrop.png" width="500)'."\n"
+ .'- Set to **mask** to return a binary mask image.'."\n"
+ .'![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20230206/fdjs/SegmentCommoditymask.png" width="500)'."\n"
+ .'- Set to **whiteBK** to return an image with a pure white background.'."\n"
+ .'![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20230206/snyw/SegmentCommoditywhiteBK.png" width="500)'."\n"
+ ."\n"
+ .'> - You can visit [Online Consultation](https://www.aliyun.com/core/online-consult?from=aZgW6LJHr2) to get online assistance.'."\n"
+ .'- You can try the full product experience for free on the Vision Intelligence Open Platform. Click [Try Now](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=SegmentCommodity) to try this feature or purchase it online.'."\n"
+ .'- For questions about API access, usage, or consultation for Alibaba Cloud Vision Intelligence Open Platform, join the DingTalk group (23109592) to contact us.'."\n"
+ ."\n"
+ .'## Common scenarios'."\n"
+ .'Commodity poster creation: Segment the target commodity from a real-scene product photo, and then perform subsequent graphic design to create promotional images.'."\n"
+ ."\n"
+ .'## Benefits'."\n"
+ ."\n"
+ .'- Automatic commodity recognition: Automatically identifies the main commodity in an image and precisely segments the commodity from the background.'."\n"
+ .'- Support for multiple commodities and complex backgrounds: Supports commodity segmentation with multiple commodities and complex background conditions.'."\n"
+ ."\n"
+ .'## Getting started'."\n"
+ .'1. Register an Alibaba Cloud account: Go to the [Alibaba Cloud official website](https://www.aliyun.com), click **Sign Up** in the upper-right corner, and follow the instructions to complete account registration.'."\n"
+ .'2. Activate the feature: Make sure that you have activated the [Image Segmentation service](https://vision.aliyun.com/imageseg). If you have not activated the service, [activate it now](https://common-buy.aliyun.com/?commodityCode=viapi_imageseg_public_cn#/open).'."\n"
+ .'3. Create an AccessKey pair: Make sure that you have [created an AccessKey pair](~~175144~~). If you are using a RAM user AccessKey, grant the AliyunVIAPIFullAccess permission to the RAM user. For more information, see [RAM authorization](~~145025~~).'."\n"
+ .'4. Online debugging (optional): You can use [OpenAPI Explorer](https://next.api.aliyun.com/api/imageseg/2019-12-30/SegmentCommodity?lang=JAVA&sdkStyle=dara&params=%7B%22ImageURL%22%3A%22http%3A%2F%2Fviapi-test.oss-cn-shanghai.aliyuncs.com%2Fviapi-3.0domepic%2Fimageseg%2FSegmentCommodity%2FSegmentCommodity1.jpg%22%7D&tab=DEMO) to debug the feature online, view complete sample code and SDK dependency information, or download the complete project.'."\n"
+ .'5. Development and integration steps:'."\n"
+ .'- Select the SDK language you want to use from [SDK overview](~~145033~~).'."\n"
+ .'- Find the SDK package for the Image Segmentation (imageseg) category in the corresponding SDK documentation and install it.'."\n"
+ .'- Modify the sample code provided in the references as needed and invoke the API.'."\n"
+ ."\n"
+ .'6. Sample code: For sample code in commonly used languages, see [SegmentCommodity sample code](~~605160~~).'."\n"
+ ."\n"
+ .'7. Direct client calls: Common client call methods for this feature include the following.'."\n"
+ .'- [Direct call from web frontend](~~467779~~)'."\n"
+ .'- [Direct call from mini programs](~~467780~~)'."\n"
+ .'- [Direct call from Android](~~467781~~)'."\n"
+ .'- [Direct call from iOS](~~467782~~).'."\n"
+ ."\n"
+ .'## Input limits'."\n"
+ .'- Image format: JPEG, JPG, PNG (8-bit, 16-bit, and 64-bit PNG images are not supported), and BMP.'."\n"
+ .'- Image size: up to 3 MB.'."\n"
+ .'- Image resolution: less than 2000 × 2000 pixels.'."\n"
+ .'- The URL cannot contain Chinese characters.'."\n"
+ ."\n"
+ .'## Billing description'."\n"
+ .'For information about the billable methods and pricing of commodity segmentation, see [Billing overview](~~190132~~).',
'requestParamsDescription' => ' ',
- 'responseParamsDescription' => ' ',
+ 'responseParamsDescription' => '## SDK reference'."\n"
+ .'For the Image Segmentation category of Alibaba Cloud Vision AI, use the SDK for calling. Multiple programming languages are supported. Select the SDK package for the Image Segmentation (imageseg) category. File parameters can be passed as local files or URLs through the SDK. For more information, see [SDK overview](~~145033~~).'."\n"
+ ."\n"
+ .'## Sample code'."\n"
+ .'For sample code in commonly used languages, see [SegmentCommodity sample code](~~605160~~).',
+ 'extraInfo' => '## Error codes'."\n"
+ .'For error codes of commodity segmentation, see [Common error codes](~~146751~~).'."\n"
+ ."\n"
+ .'## Security notice'."\n"
+ .'- Ensure that the uploaded images or files comply with applicable laws and regulations.'."\n"
+ .'- Temporary files uploaded through the debugging experience are valid for 1 hour and are automatically deleted by the system after 24 hours.',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentCommodity'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentCommodity',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ ],
],
'SegmentCommonImage' => [
- 'methods' => [
- 'post',
- 'get',
- ],
- 'schemes' => [
- 'http',
- 'https',
- ],
+ 'methods' => ['post', 'get'],
+ 'schemes' => ['http', 'https'],
'security' => [
[
'AK' => [],
@@ -555,63 +948,148 @@
[
'name' => 'ImageURL',
'in' => 'query',
- 'schema' => [
- 'description' => '',
- 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentCommonImage/SegmentCommonImage1.jpg',
- 'isFileTransferUrl' => true,
- 'required' => true,
- 'type' => 'string',
- ],
+ 'schema' => ['description' => 'The URL of the image. We recommend that you use an OSS URL in the Shanghai region. If the file is stored locally or in an OSS bucket outside the Shanghai region, see [File URL processing](~~155645~~).'."\n"
+ .'Image format requirements:'."\n"
+ ."\n"
+ .'- Image format: JPEG, JPG, PNG (8-bit, 16-bit, and 64-bit PNG are not supported), BMP, and WEBP.'."\n"
+ .'- Image size: Up to 3 MB.'."\n"
+ .'- Image resolution: Greater than 32 × 32 pixels and less than 2000 × 2000 pixels. The longest side must be less than or equal to 1999 pixels.'."\n"
+ .'- The URL cannot contain Chinese characters.', 'type' => 'string', 'required' => true, 'isFileTransferUrl' => true, 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentCommonImage/SegmentCommonImage1.jpg', 'title' => ''],
],
[
'name' => 'ReturnForm',
'in' => 'query',
- 'schema' => [
- 'description' => '',
- 'example' => 'mask',
- 'required' => false,
- 'type' => 'string',
- ],
+ 'schema' => ['description' => 'The format of the returned image.'."\n"
+ ."\n"
+ .'- If this parameter is not set, a 4-channel PNG image is returned.'."\n"
+ .'- If this parameter is set to `mask`, a single-channel mask is returned.'."\n"
+ .'- If this parameter is set to `whiteBK`, an image with a white background is returned.'."\n"
+ .'- If this parameter is set to `crop`, a cropped 4-channel PNG image is returned (blank edges are removed).', 'type' => 'string', 'required' => false, 'example' => 'mask', 'title' => ''],
],
],
'responses' => [
200 => [
'schema' => [
+ 'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'description' => '',
- 'example' => '1B8BEF02-0672-44CA-A974-4D6FAC392497',
- 'type' => 'string',
- ],
+ 'RequestId' => ['description' => 'The request ID.', 'type' => 'string', 'example' => '1B8BEF02-0672-44CA-A974-4D6FAC392497', 'title' => ''],
'Data' => [
- 'description' => '',
+ 'description' => 'The returned result data.',
+ 'type' => 'object',
'properties' => [
- 'ImageURL' => [
- 'description' => '',
- 'example' => 'http://luban-vgd-invi.oss-cn-hangzhou.aliyuncs.com/upload/result_segmenter/2019-12-20/invi_segmenter_015768355410261076021_Z3t0fc.png?Expires=1577094741&OSSAccessKeyId=LTAI4Fc5SVvzUQ19K1Cz****&Signature=pkaKK3VlfsTR2r%2BYycJzTVEEos****',
- 'type' => 'string',
- ],
+ 'ImageURL' => ['description' => 'The URL of the result image.'."\n"
+ .'The format of the returned image is specified by the request parameter.'."\n"
+ .'- If the parameter is not set, a 4-channel PNG image is returned. The image is uncompressed, the dimensions remain unchanged, and the file size increases.'."\n"
+ .'- If the parameter is set to `mask`, a single-channel mask is returned.'."\n"
+ .'- If the parameter is set to `whiteBK`, an image with a white background is returned.'."\n"
+ .'- If the parameter is set to `crop`, a cropped 4-channel PNG image is returned (blank edges are removed).'."\n"
+ .'> This URL is a temporary address that is valid for 30 minutes. After it expires, the URL is no longer accessible. To save the file for a longer period or permanently, access the URL within 30 minutes and download the file to your own OSS bucket or other storage.', 'type' => 'string', 'example' => 'http://luban-vgd-invi.oss-cn-hangzhou.aliyuncs.com/upload/result_segmenter/2019-12-20/invi_segmenter_015768355410261076021_Z3t0fc.png?Expires=1577094741&OSSAccessKeyId=LTAI****************&Signature=pkaKK3VlfsTR2r%2BYycJzTVEEos****', 'title' => ''],
],
- 'type' => 'object',
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
],
],
],
- 'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"1B8BEF02-0672-44CA-A974-4D6FAC392497\\",\\n \\"Data\\": {\\n \\"ImageURL\\": \\"http://luban-vgd-invi.oss-cn-hangzhou.aliyuncs.com/upload/result_segmenter/2019-12-20/invi_segmenter_015768355410261076021_Z3t0fc.png?Expires=1577094741&OSSAccessKeyId=LTAI****************&Signature=pkaKK3VlfsTR2r%2BYycJzTVEEos****\\"\\n }\\n}","errorExample":""},{"type":"xml","example":"<SegmentCommonImageResponse>\\n <RequestId>1B8BEF02-0672-44CA-A974-4D6FAC392497</RequestId>\\n <Data>\\n <ImageURL>http://luban-vgd-invi.oss-cn-hangzhou.aliyuncs.com/upload/result_segmenter/2019-12-20/invi_segmenter_015768355410261076021_Z3t0fc.png?Expires=1577094741&amp;OSSAccessKeyId=LTAI****************&amp;Signature=pkaKK3VlfsTR2r%2BYycJzTVEEos****</ImageURL>\\n </Data>\\n</SegmentCommonImageResponse>","errorExample":""}]',
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"1B8BEF02-0672-44CA-A974-4D6FAC392497\\",\\n \\"Data\\": {\\n \\"ImageURL\\": \\"http://luban-vgd-invi.oss-cn-hangzhou.aliyuncs.com/upload/result_segmenter/2019-12-20/invi_segmenter_015768355410261076021_Z3t0fc.png?Expires=1577094741&OSSAccessKeyId=LTAI****************&Signature=pkaKK3VlfsTR2r%2BYycJzTVEEos****\\"\\n }\\n}","type":"json"}]',
+ 'title' => 'General-purpose image segmentation',
+ 'summary' => 'This topic describes the syntax and provides examples of the SegmentCommonImage operation for general-purpose image segmentation.',
+ 'description' => '## Feature description'."\n"
+ .'The general-purpose image segmentation feature identifies the contour of the visually central object in an input image, separates the object from the background, and returns the segmented foreground object image (4-channel).'."\n"
+ .'The following figures show examples of this operation:'."\n"
+ ."\n"
+ .'- Input image'."\n"
+ .'![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20230206/irrr/SegmentCommodity.jpg" width="500)'."\n"
+ .'- Output image'."\n"
+ .'![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20230206/mqvn/SegmentCommodityjieguo.png" width="500)'."\n"
+ ."\n"
+ .'You can specify the ReturnForm parameter to specify the format of the returned result:'."\n"
+ ."\n"
+ .'- Set to **crop** to crop the blank edges'."\n"
+ .'![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20230206/bzvy/SegmentCommoditycrop.png" width="500)'."\n"
+ .'- Set to **mask** to return a binary mask image'."\n"
+ .'![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20230206/fdjs/SegmentCommoditymask.png" width="500)'."\n"
+ .'- Set to **whiteBK** to return an image with a white background'."\n"
+ .'![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20230206/snyw/SegmentCommoditywhiteBK.png" width="500)'."\n"
+ ."\n"
+ .'> - You can visit [Online Consultation](https://www.aliyun.com/core/online-consult?from=aZgW6LJHr2) to get online assistance.'."\n"
+ .'- You can try this feature for free on the Vision Intelligence Open Platform. Click [Try Now](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=SegmentCommonImage) to try this feature or purchase it online.'."\n"
+ .'- For questions about Alibaba Cloud Vision Intelligence Open Platform visual AI API access or usage, join the DingTalk group (23109592) to contact us.'."\n"
+ ."\n"
+ .'## Common scenarios'."\n"
+ ."\n"
+ .'Image editing: Intelligently separate the foreground and background of images in batches for subsequent image editing.'."\n"
+ ."\n"
+ .'## Advantages'."\n"
+ ."\n"
+ .'- Automatic subject recognition: Automatically identifies the main object in an image without additional specification.'."\n"
+ .'- Multiple scenarios: Applicable to segmentation scenarios involving people, animals, food, objects, and furniture. Not applicable to cartoon images.'."\n"
+ ."\n"
+ .'## Getting started'."\n"
+ .'1. Create an Alibaba Cloud account: Go to the [Alibaba Cloud official website](https://www.aliyun.com). In the upper-right corner, click **Register Now** and follow the instructions to create an account.'."\n"
+ .'2. Activate the service: Make sure you have activated the [Image Segmentation service](https://vision.aliyun.com/imageseg). If you have not activated the service, [activate it now](https://common-buy.aliyun.com/?commodityCode=viapi_imageseg_public_cn#/open).'."\n"
+ .'3. Create an AccessKey: Make sure you have [created an AccessKey](~~175144~~). If you are using a RAM user AccessKey, grant the AliyunVIAPIFullAccess permission to the RAM user. For more information, see [RAM authorization](~~145025~~).'."\n"
+ .'4. Online debugging (optional): You can use [OpenAPI Explorer](https://next.api.aliyun.com/api/imageseg/2019-12-30/SegmentCommonImage?lang=JAVA&sdkStyle=dara&params=%7B%22ImageURL%22%3A%22http%3A%2F%2Fviapi-test.oss-cn-shanghai.aliyuncs.com%2Fviapi-3.0domepic%2Fimageseg%2FSegmentCommonImage%2FSegmentCommonImage1.jpg%22%7D&tab=DEMO) to debug this feature online, view complete sample code and SDK dependency information, or download the complete project.'."\n"
+ .'5. Development steps:'."\n"
+ .'- Select the SDK language you want to use from the [SDK overview](~~145033~~).'."\n"
+ .'- Find and install the SDK package for the Image Segmentation (imageseg) AI category in the corresponding SDK documentation.'."\n"
+ .'- Modify the sample code provided in the References as needed and invoke the operation.'."\n"
+ ."\n"
+ .'6. Sample code and best practices: For sample code in common languages and examples of post-processing results, see [General-purpose image segmentation sample code](~~467470~~).'."\n"
+ ."\n"
+ .'7. Client-side direct calls: Common client-side call methods for this feature include the following.'."\n"
+ .'- [Direct call from web frontend](~~467779~~)'."\n"
+ .'- [Direct call from mini programs](~~467780~~)'."\n"
+ .'- [Direct call from Android](~~467781~~)'."\n"
+ .'- [Direct call from iOS](~~467782~~).'."\n"
+ ."\n"
+ .'## Input limits'."\n"
+ .'- Image format: JPEG, JPG, PNG (8-bit, 16-bit, and 64-bit PNG are not supported), BMP, and WEBP.'."\n"
+ .'- Image size: Up to 3 MB.'."\n"
+ .'- Image resolution: Greater than 32 × 32 pixels and less than 2000 × 2000 pixels. The longest side must be less than or equal to 1999 pixels.'."\n"
+ .'- The URL cannot contain Chinese characters.'."\n"
+ ."\n"
+ .'## Billing description'."\n"
+ .'For information about the billable methods and pricing of general-purpose image segmentation, see [Billing overview](~~190132~~).',
'requestParamsDescription' => ' ',
- 'responseParamsDescription' => ' ',
+ 'responseParamsDescription' => '## SDK reference'."\n"
+ .'For the general-purpose image segmentation feature under the Alibaba Cloud Vision AI Image Segmentation category, we recommend that you use the SDK. Multiple programming languages are supported. Select the SDK package for the Image Segmentation (imageseg) AI category. File parameters support local files and arbitrary URLs when called through the SDK. For more information, see [SDK overview](~~145033~~).'."\n"
+ ."\n"
+ .'## Sample code and best practices'."\n"
+ .'For sample code in common languages and examples of post-processing results, see [General-purpose image segmentation sample code](~~467470~~).',
+ 'extraInfo' => '## Error codes'."\n"
+ .'For error codes of general-purpose image segmentation, see [Common error codes](~~146751~~).'."\n"
+ ."\n"
+ .'## Security notice'."\n"
+ .'- Make sure that the uploaded images or files comply with applicable laws and regulations.'."\n"
+ .'- Temporary files uploaded through the debugging experience are valid for 1 hour and are automatically deleted by the system after 24 hours.',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentCommonImage'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentCommonImage',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ ],
],
'SegmentFood' => [
- 'methods' => [
- 'post',
- 'get',
- ],
- 'schemes' => [
- 'http',
- 'https',
- ],
+ 'methods' => ['post', 'get'],
+ 'schemes' => ['http', 'https'],
'security' => [
[
'AK' => [],
@@ -624,155 +1102,250 @@
[
'name' => 'ImageURL',
'in' => 'query',
- 'schema' => [
- 'description' => '',
- 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentFood/SegmentFood5.jpg',
- 'isFileTransferUrl' => true,
- 'required' => true,
- 'type' => 'string',
- ],
+ 'schema' => ['description' => 'The URL of the image. We recommend that you use an OSS URL in the Shanghai region. If the file is stored locally or in an OSS bucket outside the Shanghai region, see [File URL processing](~~155645~~).', 'type' => 'string', 'required' => true, 'isFileTransferUrl' => true, 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentFood/SegmentFood5.jpg', 'title' => ''],
],
[
'name' => 'ReturnForm',
'in' => 'query',
- 'schema' => [
- 'description' => '',
- 'example' => 'mask',
- 'required' => false,
- 'type' => 'string',
- ],
+ 'schema' => ['description' => 'The format of the returned image.'."\n"
+ ."\n"
+ .'- If this parameter is not set, a four-channel PNG image is returned.'."\n"
+ .'- If this parameter is set to `mask`, a single-channel mask is returned.'."\n"
+ .'- If this parameter is set to `whiteBK`, an image with a white background is returned.', 'type' => 'string', 'required' => false, 'example' => 'mask', 'title' => ''],
],
],
'responses' => [
200 => [
'schema' => [
+ 'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'description' => '',
- 'example' => '38265D08-AD0F-4752-8E96-D1D9FB96C3D9',
- 'type' => 'string',
- ],
+ 'RequestId' => ['description' => 'The request ID.', 'type' => 'string', 'example' => '38265D08-AD0F-4752-8E96-D1D9FB96C3D9', 'title' => ''],
'Data' => [
- 'description' => '',
+ 'description' => 'The returned result data.',
+ 'type' => 'object',
'properties' => [
- 'ImageURL' => [
- 'description' => '',
- 'example' => 'http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/foodsegmenter-2020-06-17-15-24-00-8658fc85b8-8ds8k/2020-6-18/invi__015924442076191000002_WqJ99N.png?Expires=1592446007&OSSAccessKeyId=LTAI4FoLmvQ9urWXgSRp****&Signature=5ITSd6ndSuP7pUfoDFpgLPUOGg****',
- 'type' => 'string',
- ],
+ 'ImageURL' => ['description' => 'The URL of the segmentation result image.'."\n"
+ .'The segmentation result is returned as a four-channel PNG image without compression. The image dimensions remain unchanged, but the file size increases.'."\n"
+ .'> This URL is a temporary address that is valid for 30 minutes. After it expires, the URL is no longer accessible. To save the file for a longer period or permanently, access the URL within 30 minutes and download the file to your own OSS bucket or other storage.', 'type' => 'string', 'example' => 'http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/foodsegmenter-2020-06-17-15-24-00-8658fc85b8-8ds8k/2020-6-18/invi__015924442076191000002_WqJ99N.png?Expires=1592446007&OSSAccessKeyId=LTAI****************&Signature=5ITSd6ndSuP7pUfoDFpgLPUOGg****', 'title' => ''],
],
- 'type' => 'object',
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
],
],
],
- 'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"38265D08-AD0F-4752-8E96-D1D9FB96C3D9\\",\\n \\"Data\\": {\\n \\"ImageURL\\": \\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/foodsegmenter-2020-06-17-15-24-00-8658fc85b8-8ds8k/2020-6-18/invi__015924442076191000002_WqJ99N.png?Expires=1592446007&OSSAccessKeyId=LTAI****************&Signature=5ITSd6ndSuP7pUfoDFpgLPUOGg****\\"\\n }\\n}","errorExample":""},{"type":"xml","example":"<SegmentFoodResponse>\\n <RequestId>38265D08-AD0F-4752-8E96-D1D9FB96C3D9</RequestId>\\n <Data>\\n <ImageURL>http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/foodsegmenter-2020-06-17-15-24-00-8658fc85b8-8ds8k/2020-6-18/invi__015924442076191000002_WqJ99N.png?Expires=1592446007&amp;OSSAccessKeyId=LTAI****************&amp;Signature=5ITSd6ndSuP7pUfoDFpgLPUOGg****</ImageURL>\\n </Data>\\n</SegmentFoodResponse>","errorExample":""}]',
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"38265D08-AD0F-4752-8E96-D1D9FB96C3D9\\",\\n \\"Data\\": {\\n \\"ImageURL\\": \\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/foodsegmenter-2020-06-17-15-24-00-8658fc85b8-8ds8k/2020-6-18/invi__015924442076191000002_WqJ99N.png?Expires=1592446007&OSSAccessKeyId=LTAI****************&Signature=5ITSd6ndSuP7pUfoDFpgLPUOGg****\\"\\n }\\n}","type":"json"}]',
+ 'title' => 'Food segmentation',
+ 'summary' => 'This topic describes the syntax and provides examples of the food segmentation feature (SegmentFood).',
+ 'description' => '## Feature description'."\n"
+ .'The food segmentation feature performs pixel-level segmentation on food items in images and returns the segmentation results.'."\n"
+ ."\n"
+ .'> - You can join [online consultation](https://www.aliyun.com/core/online-consult?from=aZgW6LJHr2) to get help from our support team.'."\n"
+ .'- You can try this feature for free on the China site (Chinese). Click [China site (Chinese)](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=SegmentFood) to try this feature or purchase it online.'."\n"
+ .'- To get help with Visual Intelligence API integration, usage, or other questions, join the DingTalk group (23109592).'."\n"
+ ."\n"
+ .'## Common scenarios'."\n"
+ .'- Restaurant menus: After photographing dishes, use food segmentation to extract the dishes from cluttered backgrounds and add them to menus.'."\n"
+ .'- Food advertising: In food industry promotions, extract food photos and process them into advertising materials.'."\n"
+ ."\n"
+ .'## Advantages'."\n"
+ .'Wide adaptability: Supports automatic segmentation for most Chinese and Western dishes, bread, cakes, pastries, and more.'."\n"
+ ."\n"
+ .'## Getting started'."\n"
+ .'1. Create an Alibaba Cloud account: Go to the [Alibaba Cloud official website](https://www.aliyun.com), click **China site (Chinese)** in the upper-right corner, and follow the instructions to create an account.'."\n"
+ .'2. Activate the feature: Make sure that you have activated the [Image Segmentation service](https://vision.aliyun.com/imageseg). If you have not activated the service, [activate it now](https://common-buy.aliyun.com/?commodityCode=viapi_imageseg_public_cn#/open).'."\n"
+ .'3. Create an AccessKey pair: Make sure that you have [created an AccessKey pair](~~175144~~). If you are using a RAM user AccessKey, grant the AliyunVIAPIFullAccess permission to the RAM user. For more information, see [RAM authorization](~~145025~~).'."\n"
+ .'4. Online debugging (optional): You can use [OpenAPI Explorer](https://next.api.aliyun.com/api/imageseg/2019-12-30/SegmentFood?spm=a2c4g.171485.0.i3) to debug this feature online, view complete sample code and SDK dependency information, or download the complete project.'."\n"
+ .'5. Development and integration steps:'."\n"
+ .'- Select the SDK language you want to use from the [SDK overview](~~145033~~).'."\n"
+ .'- Find the SDK package for the Image Segmentation (imageseg) category in the corresponding SDK documentation and install it.'."\n"
+ .'- Modify the sample code provided in the references as needed and invoke it.'."\n"
+ ."\n"
+ .'6. Direct client calls: Common client call methods for this feature include the following.'."\n"
+ .'- [Direct call from web frontend](~~467779~~)'."\n"
+ .'- [Direct call from a mini program](~~467780~~)'."\n"
+ .'- [Direct call from Android](~~467781~~)'."\n"
+ .'- [Direct call from iOS](~~467782~~).'."\n"
+ ."\n"
+ .'## Input limits'."\n"
+ .'- Image format: PNG, JPEG, JPG, or BMP.'."\n"
+ .'- Image size: up to 4 MB.'."\n"
+ .'- Image resolution: greater than 40 × 40 pixels and less than 1999 × 1999 pixels.'."\n"
+ .'- The URL cannot contain Chinese characters.'."\n"
+ ."\n"
+ .'## Billing description'."\n"
+ .'For information about the billable methods and pricing of food segmentation, see [Billing overview](~~190132~~).'."\n"
+ ."\n"
+ .'> The debugging API below is a paid API. To try it for free, go to the [China site (Chinese)](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=SegmentFood).',
'requestParamsDescription' => ' ',
- 'responseParamsDescription' => ' ',
- ],
- 'SegmentHair' => [
- 'methods' => [
- 'post',
- 'get',
- ],
- 'schemes' => [
- 'http',
- 'https',
+ 'responseParamsDescription' => '## SDK reference'."\n"
+ .'We recommend that you use an SDK to call the food segmentation feature under the Visual AI Image Segmentation category. The SDK supports multiple programming languages. When making calls, select the SDK package for the Image Segmentation (imageseg) category. File parameters can be passed as local files or arbitrary URLs through the SDK. For more information, see [SDK overview](~~145033~~).',
+ 'extraInfo' => '## Error codes'."\n"
+ .'For information about error codes of food segmentation, see [Common error codes](~~146751~~).'."\n"
+ ."\n"
+ .'## Security notice'."\n"
+ .'- Make sure that the uploaded images or files comply with applicable laws and regulations.'."\n"
+ .'- Temporary files uploaded through the debugging console are valid for 1 hour and are automatically deleted by the system after 24 hours.',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentFood'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentFood',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ ],
+ 'SegmentHDBody' => [
+ 'methods' => ['post', 'get'],
+ 'schemes' => ['http', 'https'],
'security' => [
[
'AK' => [],
],
],
- 'operationType' => 'readAndWrite',
+ 'operationType' => 'read',
'deprecated' => false,
'systemTags' => [],
'parameters' => [
[
'name' => 'ImageURL',
'in' => 'query',
- 'schema' => [
- 'description' => '',
- 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentHair/SegmentHair1.jpg',
- 'isFileTransferUrl' => true,
- 'required' => true,
- 'type' => 'string',
- ],
+ 'schema' => ['description' => 'The URL of the image. We recommend that you use an Object Storage Service (OSS) URL in the Shanghai region. If the file is stored locally or in an OSS bucket outside the Shanghai region, see [File URL processing](~~155645~~).'."\n"
+ .'Image requirements:'."\n"
+ .'- Image format: JPG, JPEG, BMP, or PNG (transparent images).'."\n"
+ .'- Image size: Up to 40 MB.'."\n"
+ .'- Image resolution: Greater than 32 × 32 pixels and less than 6000 × 6000 pixels. The longest side must be 6000 pixels or less.'."\n"
+ .'- The URL cannot contain Chinese characters.', 'type' => 'string', 'required' => true, 'isFileTransferUrl' => true, 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentHDBody/SegmentHDBody1.jpg', 'title' => ''],
],
],
'responses' => [
200 => [
'schema' => [
+ 'description' => '1',
+ 'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'description' => '',
- 'example' => 'D6C24839-91A7-41DA-B31F-98F08EF80CC0',
- 'type' => 'string',
- ],
+ 'RequestId' => ['description' => 'The request ID.', 'type' => 'string', 'example' => 'A8D3F5C3-E414-4981-8D84-E2CADF0B7CBC', 'title' => ''],
'Data' => [
- 'description' => '',
+ 'description' => 'The returned data.',
+ 'type' => 'object',
'properties' => [
- 'Elements' => [
- 'description' => '',
- 'items' => [
- 'properties' => [
- 'ImageURL' => [
- 'description' => '',
- 'example' => 'http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_HeadSegmenter/2021-12-31/invi_HeadSegmenter_016409228383064285967296_iPLUXA.png?Expires=1640924638&OSSAccessKeyId=LTAI4FoLmvQ9urWXgSRp****&Signature=wpKOqSar1bYvGmlTMryfEH2Q9I****',
- 'type' => 'string',
- ],
- 'Width' => [
- 'description' => '',
- 'example' => '113',
- 'format' => 'int32',
- 'type' => 'integer',
- ],
- 'Height' => [
- 'description' => '',
- 'example' => '180',
- 'format' => 'int32',
- 'type' => 'integer',
- ],
- 'Y' => [
- 'description' => '',
- 'example' => '102',
- 'format' => 'int32',
- 'type' => 'integer',
- ],
- 'X' => [
- 'description' => '',
- 'example' => '446',
- 'format' => 'int32',
- 'type' => 'integer',
- ],
- ],
- 'type' => 'object',
- ],
- 'type' => 'array',
- ],
+ 'ImageURL' => ['description' => 'The URL of the result image.'."\n"
+ .'The output image adds an alpha channel to the 3-channel original image to generate a 4-channel PNG image without compression. The image dimensions remain unchanged, but the file size increases.'."\n"
+ .'> This URL is a temporary URL that is valid for 30 minutes. After the URL expires, you can no longer access it. To save the file for a longer period or permanently, access the URL within 30 minutes and download the file to your own OSS bucket or other storage.', 'type' => 'string', 'example' => 'http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/segmenthdbody-2020-05-18-16-27-45-675d9884d7-kd9dz/2020-5-18/invi_humansegmenter_015897914589851000001_wQbLq9.png?Expires=1589793259&OSSAccessKeyId=LTAI****************&Signature=Lx6xSS0t7lqEvy5Qd1keccIAjL****', 'title' => ''],
],
- 'type' => 'object',
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'title' => '',
+ 'example' => '',
],
],
],
- 'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"D6C24839-91A7-41DA-B31F-98F08EF80CC0\\",\\n \\"Data\\": {\\n \\"Elements\\": [\\n {\\n \\"ImageURL\\": \\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_HeadSegmenter/2021-12-31/invi_HeadSegmenter_016409228383064285967296_iPLUXA.png?Expires=1640924638&OSSAccessKeyId=LTAI****************&Signature=wpKOqSar1bYvGmlTMryfEH2Q9I****\\",\\n \\"Width\\": 113,\\n \\"Height\\": 180,\\n \\"Y\\": 102,\\n \\"X\\": 446\\n }\\n ]\\n }\\n}","errorExample":""},{"type":"xml","example":"<SegmentHairResponse>\\n <RequestId>D6C24839-91A7-41DA-B31F-98F08EF80CC0</RequestId>\\n <Data>\\n <Elements>\\n <ImageURL>http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_HeadSegmenter/2021-12-31/invi_HeadSegmenter_016409228383064285967296_iPLUXA.png?Expires=1640924638&amp;OSSAccessKeyId=LTAI****************&amp;Signature=wpKOqSar1bYvGmlTMryfEH2Q9I****</ImageURL>\\n <Width>113</Width>\\n <Height>180</Height>\\n <Y>102</Y>\\n <X>446</X>\\n </Elements>\\n </Data>\\n</SegmentHairResponse>","errorExample":""}]',
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"A8D3F5C3-E414-4981-8D84-E2CADF0B7CBC\\",\\n \\"Data\\": {\\n \\"ImageURL\\": \\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/segmenthdbody-2020-05-18-16-27-45-675d9884d7-kd9dz/2020-5-18/invi_humansegmenter_015897914589851000001_wQbLq9.png?Expires=1589793259&OSSAccessKeyId=LTAI****************&Signature=Lx6xSS0t7lqEvy5Qd1keccIAjL****\\"\\n }\\n}","type":"json"}]',
+ 'title' => 'HD human body segmentation',
+ 'summary' => 'This topic describes the syntax and provides examples of the HD human body segmentation feature (SegmentHDBody).',
+ 'description' => '## Feature description'."\n"
+ .'The HD human body segmentation feature automatically identifies human body contours in an image, separates the human body from the background, and returns the segmented foreground human image. This feature is applicable to real human photos and is not applicable to cartoon images.'."\n"
+ .'The following figures show examples of this feature:'."\n"
+ .'- Input image'."\n"
+ .'![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20221108/kgdi/SegmentHDBody.jpg" width="500)'."\n"
+ .'- Output image'."\n"
+ .'![](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20221108/phjn/SegmentHDBodyjieguo.png" width="500)'."\n"
+ ."\n"
+ .'> - Compared with the SegmentBody operation, this operation supports segmentation of higher-resolution images, up to 40 MB.'."\n"
+ .'- You can visit [Online Consultation](https://www.aliyun.com/core/online-consult?from=aZgW6LJHr2) to get online assistance.'."\n"
+ .'- You can try this feature for free on the Vision Intelligence Open Platform. Click [Try Now](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=SegmentHDBody) to experience this feature or purchase it online.'."\n"
+ .'- For questions about Alibaba Cloud Vision Intelligence Open Platform visual AI API access or usage, join the DingTalk group (23109592) to contact us.'."\n"
+ ."\n"
+ .'## Common scenarios'."\n"
+ ."\n"
+ .'- Portrait photography: Human body segmentation separates the subject from the background and blurs the background to achieve a shallow depth of field effect with a large aperture, highlighting the subject.'."\n"
+ .'- ID photo creation: Upload or take a portrait photo. The feature precisely segments the person from the background. Combined with other background processing capabilities, you can create a standard ID photo.'."\n"
+ ."\n"
+ .'## Advantages'."\n"
+ ."\n"
+ .'- Hair-level precision: Achieves higher segmentation accuracy at edge details. Even individual strands of hair can be precisely segmented, making the result image look natural and difficult to identify as processed.'."\n"
+ .'- Complex background adaptation: Even when the subject is in a complex background environment, the human body can be accurately segmented from the background.'."\n"
+ .'- Multi-person support: Applicable to single-person, multi-person, complex background, and various body pose scenarios.'."\n"
+ .'- HD image support: Supports segmentation of high resolution images, up to 40 MB.'."\n"
+ ."\n"
+ .'## Getting started'."\n"
+ .'1. Create an Alibaba Cloud account: Go to the [Alibaba Cloud official website](https://www.aliyun.com), click **Sign Up** in the upper-right corner, and follow the instructions to create an account.'."\n"
+ .'2. Activate the feature: Make sure you have activated the [Image Segmentation service](https://vision.aliyun.com/imageseg). If you have not activated the service, [activate it now](https://common-buy.aliyun.com/?commodityCode=viapi_imageseg_public_cn#/open).'."\n"
+ .'3. Create an AccessKey pair: Make sure you have [created an AccessKey pair](~~175144~~). If you are using a RAM user AccessKey, grant the AliyunVIAPIFullAccess permission to the RAM user. For more information, see [RAM authorization](~~145025~~).'."\n"
+ .'4. Online debugging (optional): You can use [OpenAPI Explorer](https://next.api.aliyun.com/api/imageseg/2019-12-30/SegmentHDBody?lang=JAVA&sdkStyle=dara&params=%7B%22ImageURL%22%3A%22http%3A%2F%2Fviapi-test.oss-cn-shanghai.aliyuncs.com%2Fviapi-3.0domepic%2Fimageseg%2FSegmentHDBody%2FSegmentHDBody1.jpg%22%7D&tab=DEMO) to debug this feature online, view complete sample code and SDK dependency information, or download the complete project.'."\n"
+ .'5. Development steps:'."\n"
+ .'- Select the SDK language you want to use from the [SDK overview](~~145033~~).'."\n"
+ .'- Find the SDK package for the Image Segmentation (imageseg) AI category in the corresponding SDK documentation and install it.'."\n"
+ .'- Modify the sample code provided in the References as needed and invoke the operation.'."\n"
+ ."\n"
+ .'6. Sample code: For sample code in commonly used languages, see [HD human body segmentation sample code](~~605134~~).'."\n"
+ ."\n"
+ .'7. Direct client calls: Common client call methods for this feature include the following:'."\n"
+ .'- [Direct call from web frontend](~~467779~~)'."\n"
+ .'- [Direct call from mini programs](~~467780~~)'."\n"
+ .'- [Direct call from Android](~~467781~~)'."\n"
+ .'- [Direct call from iOS](~~467782~~).'."\n"
+ ."\n"
+ .'## Input limits'."\n"
+ .'- Image format: JPG, JPEG, BMP, or PNG (transparent images).'."\n"
+ .'- Image size: Up to 40 MB.'."\n"
+ .'- Image resolution: Greater than 32 × 32 pixels and less than 6000 × 6000 pixels. The longest side must be 6000 pixels or less.'."\n"
+ .'- The URL cannot contain Chinese characters.'."\n"
+ ."\n"
+ .'## Billing description'."\n"
+ .'For information about the billable methods and pricing of HD human body segmentation, see [Billing overview](~~190132~~).',
'requestParamsDescription' => ' ',
- 'responseParamsDescription' => ' ',
- ],
- 'SegmentHDBody' => [
- 'methods' => [
- 'post',
- 'get',
- ],
- 'schemes' => [
- 'http',
- 'https',
+ 'responseParamsDescription' => '## SDK reference'."\n"
+ .'For the HD human body segmentation feature under the Alibaba Cloud Vision AI Image Segmentation category, we recommend that you use the SDK. Multiple programming languages are supported. When calling the operation, select the SDK package for the Image Segmentation (imageseg) AI category. The SDK supports local files and arbitrary URLs for file parameters. For more information, see [SDK overview](~~145033~~).'."\n"
+ ."\n"
+ .'## Sample code'."\n"
+ .'For sample code in commonly used languages, see [HD human body segmentation sample code](~~605134~~).',
+ 'extraInfo' => '## Error codes'."\n"
+ .'For error codes of HD human body segmentation, see [Common error codes](~~146751~~).'."\n"
+ ."\n"
+ .'## Security notice'."\n"
+ .'- Make sure that the uploaded images or files comply with applicable laws and regulations.'."\n"
+ .'- Temporary files uploaded through the debugging experience are valid for 1 hour and are automatically deleted by the system after 24 hours.',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentHDBody'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentHDBody',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ ],
+ 'SegmentHDCommonImage' => [
+ 'methods' => ['post', 'get'],
+ 'schemes' => ['http', 'https'],
'security' => [
[
'AK' => [],
@@ -783,56 +1356,136 @@
'systemTags' => [],
'parameters' => [
[
- 'name' => 'ImageURL',
- 'in' => 'query',
- 'schema' => [
- 'description' => '',
- 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentHDBody/SegmentHDBody1.jpg',
- 'isFileTransferUrl' => true,
- 'required' => true,
- 'type' => 'string',
- ],
+ 'name' => 'ImageUrl',
+ 'in' => 'formData',
+ 'schema' => ['description' => 'The URL of the image. We recommend that you use an OSS URL in the Shanghai region. If the file is stored locally or in an OSS bucket outside the Shanghai region, see [File URL processing](~~155645~~).', 'type' => 'string', 'required' => true, 'isFileTransferUrl' => true, 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentHDCommonImage/SegmentHDCommonImage1.jpg', 'title' => ''],
],
],
'responses' => [
200 => [
'schema' => [
'description' => '1',
+ 'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'description' => '',
- 'example' => 'A8D3F5C3-E414-4981-8D84-E2CADF0B7CBC',
- 'type' => 'string',
- ],
+ 'RequestId' => ['description' => 'The request ID.', 'type' => 'string', 'example' => 'EC994171-7964-44B3-85AF-A715CB56747D', 'title' => ''],
'Data' => [
- 'description' => '',
+ 'description' => 'The returned result data.'."\n"
+ .'This data is obtained after the asynchronous task executes successfully by invoking the [GetAsyncJobResult](~~607824~~) operation and performing JSON deserialization on the Result field.',
+ 'type' => 'object',
'properties' => [
- 'ImageURL' => [
- 'description' => '',
- 'example' => 'http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/segmenthdbody-2020-05-18-16-27-45-675d9884d7-kd9dz/2020-5-18/invi_humansegmenter_015897914589851000001_wQbLq9.png?Expires=1589793259&OSSAccessKeyId=LTAI4FoLmvQ9urWXgSRp****&Signature=Lx6xSS0t7lqEvy5Qd1keccIAjL****',
- 'type' => 'string',
- ],
+ 'ImageUrl' => ['description' => 'The URL of the result image.'."\n"
+ .'After segmentation, a four-channel PNG image is returned without compression. The image dimensions remain unchanged, but the file size increases.'."\n"
+ .'> This URL is a temporary address that is valid for 30 minutes. After it expires, the URL is no longer accessible. To save the file for a longer period or permanently, access the URL within 30 minutes and download the file to your own OSS bucket or other storage.', 'type' => 'string', 'example' => 'http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_commoditysegmenter/2020-10-27/invi_commoditysegmenter_016037842193171000000_5pn2QM.png?Expires=1603786019&OSSAccessKeyId=LTAI****************&Signature=HwUztguGBYXmXGEmuTh%2FL3ztoh****', 'title' => ''],
],
- 'type' => 'object',
+ 'title' => '',
+ 'example' => '',
],
+ 'Message' => ['description' => 'The message returned after the asynchronous task is submitted.', 'type' => 'string', 'example' => '该调用为异步调用,任务已提交成功,请以requestId的值作为jobId参数调用同类目下GetAsyncJobResult接口查询任务执行状态和结果。', 'title' => ''],
],
- 'type' => 'object',
+ 'title' => '',
+ 'example' => '',
],
],
],
- 'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"A8D3F5C3-E414-4981-8D84-E2CADF0B7CBC\\",\\n \\"Data\\": {\\n \\"ImageURL\\": \\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/segmenthdbody-2020-05-18-16-27-45-675d9884d7-kd9dz/2020-5-18/invi_humansegmenter_015897914589851000001_wQbLq9.png?Expires=1589793259&OSSAccessKeyId=LTAI****************&Signature=Lx6xSS0t7lqEvy5Qd1keccIAjL****\\"\\n }\\n}","errorExample":""},{"type":"xml","example":"<SegmentHDBodyResponse>\\n <RequestId>A8D3F5C3-E414-4981-8D84-E2CADF0B7CBC</RequestId>\\n <Data>\\n <ImageURL>http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/segmenthdbody-2020-05-18-16-27-45-675d9884d7-kd9dz/2020-5-18/invi_humansegmenter_015897914589851000001_wQbLq9.png?Expires=1589793259&amp;OSSAccessKeyId=LTAI****************&amp;Signature=Lx6xSS0t7lqEvy5Qd1keccIAjL****</ImageURL>\\n </Data>\\n</SegmentHDBodyResponse>","errorExample":""}]',
+ 'errorCodes' => [
+ 400 => [
+ ['errorCode' => 'ParameterError', 'errorMessage' => 'The parameter is invalid. Please check again.', 'description' => 'The parameter is invalid. Please check again.'],
+ ],
+ 403 => [
+ ['errorCode' => 'AuthFailed', 'errorMessage' => 'An error occurred while performing authorization. Please check your RAM configuration.', 'description' => 'An error occurred while performing authorization. Please check your RAM configuration.'],
+ ],
+ 408 => [
+ ['errorCode' => 'Timeout', 'errorMessage' => 'The request has timed out.', 'description' => 'The request has timed out.'],
+ ],
+ 503 => [
+ ['errorCode' => 'ServiceUnavailable', 'errorMessage' => 'The service is unavailable.', 'description' => 'The service is unavailable. '],
+ ],
+ ],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"EC994171-7964-44B3-85AF-A715CB56747D\\",\\n \\"Data\\": {\\n \\"ImageUrl\\": \\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_commoditysegmenter/2020-10-27/invi_commoditysegmenter_016037842193171000000_5pn2QM.png?Expires=1603786019&OSSAccessKeyId=LTAI****************&Signature=HwUztguGBYXmXGEmuTh%2FL3ztoh****\\"\\n },\\n \\"Message\\": \\"该调用为异步调用,任务已提交成功,请以requestId的值作为jobId参数调用同类目下GetAsyncJobResult接口查询任务执行状态和结果。\\"\\n}","type":"json"}]',
+ 'title' => 'HD common image segmentation',
+ 'summary' => 'This topic describes the syntax and provides examples of the SegmentHDCommonImage operation for HD common image segmentation.',
+ 'description' => '## Feature description'."\n"
+ .'The HD common image segmentation feature segments the subject in an image and outputs a corresponding transparent image in PNG format.'."\n"
+ ."\n"
+ .'>- Compared with common segmentation, HD common image segmentation supports images with a resolution of up to 10,000 × 10,000 pixels, whereas common segmentation supports images with a resolution of up to only 2,000 × 2,000 pixels. Use HD common image segmentation for high-resolution images.'."\n"
+ .'- You can visit [Online Consultation](https://www.aliyun.com/core/online-consult?from=aZgW6LJHr2) for online assistance.'."\n"
+ .'- You can try this feature for free on the Visual Intelligence Open Platform. Click [Try Now](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=SegmentHDCommonImage) to experience this feature or purchase it online.'."\n"
+ .'- To get help with API integration, usage, or other questions about the Alibaba Cloud Visual Intelligence Open Platform, join the DingTalk group (23109592) to contact us.'."\n"
+ ."\n"
+ .'## Integration guide'."\n"
+ .'1. Register an Alibaba Cloud account: Go to the [Alibaba Cloud official website](https://www.aliyun.com), click **Register Now** in the upper-right corner, and follow the instructions to complete the registration.'."\n"
+ .'2. Activate the feature: Make sure that you have activated the [Image Segmentation service](https://vision.aliyun.com/imageseg). If you have not activated the service, [activate it now](https://common-buy.aliyun.com/?commodityCode=viapi_imageseg_public_cn#/open).'."\n"
+ .'3. Create an AccessKey pair: Make sure that you have [created an AccessKey pair](~~175144~~). If you are using an AccessKey pair of a RAM user, grant the AliyunVIAPIFullAccess permission to the RAM user. For more information, see [RAM authorization](~~145025~~).'."\n"
+ .'4. Online debugging (optional): You can use [OpenAPI Explorer](https://next.api.aliyun.com/api/imageseg/2019-12-30/SegmentHDCommonImage?lang=JAVA&sdkStyle=dara&params=%7B%22ImageUrl%22%3A%22http%3A%2F%2Fviapi-test.oss-cn-shanghai.aliyuncs.com%2Fviapi-3.0domepic%2Fimageseg%2FSegmentHDCommonImage%2FSegmentHDCommonImage1.jpg%22%7D&tab=DEMO) to debug this feature online, view complete sample code and SDK dependency information, or download the complete project.'."\n"
+ .'5. Development and integration steps:'."\n"
+ .'- Select the SDK language you want to use from the [SDK overview](~~145033~~).'."\n"
+ .'- Find the SDK package for the Image Segmentation (imageseg) category in the corresponding SDK documentation and install it.'."\n"
+ .'- Modify the sample code provided in the References as needed and invoke the operation.'."\n"
+ ."\n"
+ .'6. Sample code: For sample code in common programming languages, see [HD common image segmentation sample code](~~605128~~). For sample code for querying asynchronous task results, see [Query asynchronous task results sample code](~~607974~~).'."\n"
+ ."\n"
+ .'7. Direct client calls: Common client call methods for this feature include the following:'."\n"
+ .'- [Direct call from web frontend](~~467779~~)'."\n"
+ .'- [Direct call from mini programs](~~467780~~)'."\n"
+ .'- [Direct call from Android](~~467781~~)'."\n"
+ .'- [Direct call from iOS](~~467782~~).'."\n"
+ ."\n"
+ .'## Input limits'."\n"
+ ."\n"
+ .'- Image format: PNG, JPEG, JPG, or BMP.'."\n"
+ .'- Image size: up to 40 MB.'."\n"
+ .'- Image resolution: greater than 32 × 32 pixels and less than 10,000 × 10,000 pixels.'."\n"
+ .'- The URL cannot contain Chinese characters.'."\n"
+ ."\n"
+ .'## Billing description'."\n"
+ .'For information about the billable methods and pricing of HD common image segmentation, see [Billing overview](~~190132~~).'."\n"
+ ."\n"
+ .'> The debugging operation below is a paid operation. To try it for free, go to the [Experience Center](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=SegmentHDCommonImage).'."\n"
+ ."\n"
+ .'## Call procedure'."\n"
+ .'This is an asynchronous operation that requires two steps.'."\n"
+ .'Step 1: Call the SegmentHDCommonImage operation to submit a task. If the request is successful, a task ID is returned.'."\n"
+ .'Step 2: Call the [GetAsyncJobResult](~~607824~~) operation to query the result based on the task ID. If the task is still being processed, wait a moment and then query again. Do not submit duplicate tasks while the same task is still being processed.',
'requestParamsDescription' => ' ',
- 'responseParamsDescription' => ' ',
- ],
- 'SegmentHDCommonImage' => [
- 'methods' => [
- 'post',
- 'get',
- ],
- 'schemes' => [
- 'http',
- 'https',
+ 'responseParamsDescription' => '## Query results'."\n"
+ .'This is an asynchronous operation that does not return the actual result. You must call the GetAsyncJobResult operation with the returned RequestId to obtain the actual result. For more information, see [GetAsyncJobResult](~~607824~~).'."\n"
+ ."\n"
+ .'## SDK reference'."\n"
+ .'We recommend that you use an SDK to call the HD common image segmentation feature under the Visual AI Image Segmentation category. Multiple programming languages are supported. When calling this operation, select the SDK package for the Image Segmentation (imageseg) category. The SDK supports local files and arbitrary URLs for file parameters. For more information, see [SDK overview](~~145033~~).'."\n"
+ ."\n"
+ .'## Sample code'."\n"
+ .'For sample code in common programming languages, see [HD common image segmentation sample code](~~605128~~). For sample code for querying asynchronous task results, see [Query asynchronous task results sample code](~~607974~~).',
+ 'extraInfo' => '## Error codes'."\n"
+ .'For error codes of HD common image segmentation, see [Common error codes](~~146751~~).'."\n"
+ ."\n"
+ .'## Security notice'."\n"
+ .'- Ensure that the uploaded images or files comply with applicable laws and regulations.'."\n"
+ .'- Temporary files uploaded through the debugging experience are valid for 1 hour and are automatically deleted by the system after 24 hours.',
+ 'changeSet' => [
+ ['createdAt' => '2022-10-17T02:04:01.000Z', 'description' => 'Response parameters changed'],
+ ],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentHDCommonImage'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentHDCommonImage',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
],
+ ],
+ 'SegmentHDSky' => [
+ 'methods' => ['post', 'get'],
+ 'schemes' => ['http', 'https'],
'security' => [
[
'AK' => [],
@@ -843,171 +1496,279 @@
'systemTags' => [],
'parameters' => [
[
- 'name' => 'ImageUrl',
+ 'name' => 'ImageURL',
'in' => 'formData',
- 'schema' => [
- 'description' => '',
- 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentHDCommonImage/SegmentHDCommonImage1.jpg',
- 'isFileTransferUrl' => true,
- 'required' => true,
- 'type' => 'string',
- ],
+ 'schema' => ['description' => 'The URL of the target image for sky segmentation. We recommend that you use an Object Storage Service (OSS) URL in the Shanghai region. If the file is stored locally or in an OSS bucket outside the Shanghai region, see [File URL processing](~~155645~~).', 'type' => 'string', 'required' => true, 'isFileTransferUrl' => true, 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentHDSky/SegmentHDSky4.jpg', 'title' => ''],
],
],
'responses' => [
200 => [
'schema' => [
- 'description' => '1',
+ 'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'description' => '',
- 'example' => 'EC994171-7964-44B3-85AF-A715CB56747D',
- 'type' => 'string',
- ],
+ 'RequestId' => ['description' => 'The request ID.', 'type' => 'string', 'example' => '1173F38F-B4F4-4A07-AB2E-D490C01347E5', 'title' => ''],
'Data' => [
- 'description' => '',
+ 'description' => 'The returned data.',
+ 'type' => 'object',
'properties' => [
- 'ImageUrl' => [
- 'description' => '',
- 'example' => 'http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_commoditysegmenter/2020-10-27/invi_commoditysegmenter_016037842193171000000_5pn2QM.png?Expires=1603786019&OSSAccessKeyId=LTAI4FoLmvQ9urWXgSRp****&Signature=HwUztguGBYXmXGEmuTh%2FL3ztoh****',
- 'type' => 'string',
- ],
+ 'ImageURL' => ['description' => 'The URL of the segmented image.'."\n"
+ .'The returned image is a four-channel PNG image without compression. The image dimensions remain unchanged, but the file size increases.'."\n"
+ .'> This URL is a temporary address that is valid for 30 minutes. After it expires, the URL is no longer accessible. To save the file for a longer period or permanently, access the URL within 30 minutes and download the file to your own OSS bucket or other storage.', 'type' => 'string', 'example' => 'http://vibktprfx-prod-prod-aic-gd-cn-shanghai.oss-cn-shanghai.aliyuncs.com/sky-segmentation-hd/res/1173F38F-B4F4-4A07-AB2E-D490C01347E5_0d56_20201027-061858.jpg?Expires=1603781339&OSSAccessKeyId=LTAI****************&Signature=2F8%2Bj%2FWruWOMqDezwpnJOkcNJD****', 'title' => ''],
],
- 'type' => 'object',
- ],
- 'Message' => [
- 'description' => '',
+ 'title' => '',
'example' => '',
- 'type' => 'string',
],
],
- 'type' => 'object',
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
],
],
],
'errorCodes' => [
400 => [
- [
- 'errorCode' => 'ParameterError',
- 'errorMessage' => 'The parameter is invalid. Please check again.',
- ],
+ ['errorCode' => 'ParameterError', 'errorMessage' => 'The parameter is invalid. Please check again.', 'description' => 'The parameter is invalid. Please check again.'],
],
403 => [
- [
- 'errorCode' => 'AuthFailed',
- 'errorMessage' => 'An error occurred while performing authorization. Please check your RAM configuration.',
- ],
+ ['errorCode' => 'AuthFailed', 'errorMessage' => 'An error occurred while performing authorization. Please check your RAM configuration.', 'description' => 'An error occurred while performing authorization. Please check your RAM configuration.'],
],
408 => [
- [
- 'errorCode' => 'Timeout',
- 'errorMessage' => 'The request has timed out.',
- ],
+ ['errorCode' => 'Timeout', 'errorMessage' => 'The request has timed out.', 'description' => 'The request has timed out.'],
],
503 => [
- [
- 'errorCode' => 'ServiceUnavailable',
- 'errorMessage' => 'The service is unavailable.',
+ ['errorCode' => 'ServiceUnavailable', 'errorMessage' => 'The service is unavailable.', 'description' => 'The service is unavailable. '],
+ ],
+ ],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"1173F38F-B4F4-4A07-AB2E-D490C01347E5\\",\\n \\"Data\\": {\\n \\"ImageURL\\": \\"http://vibktprfx-prod-prod-aic-gd-cn-shanghai.oss-cn-shanghai.aliyuncs.com/sky-segmentation-hd/res/1173F38F-B4F4-4A07-AB2E-D490C01347E5_0d56_20201027-061858.jpg?Expires=1603781339&OSSAccessKeyId=LTAI****************&Signature=2F8%2Bj%2FWruWOMqDezwpnJOkcNJD****\\"\\n }\\n}","type":"json"}]',
+ 'title' => 'HD sky segmentation',
+ 'summary' => 'This topic describes the syntax and provides examples of SegmentHDSky.',
+ 'description' => '## Feature description'."\n"
+ .'The HD sky segmentation feature performs pixel-level matting on the sky in an input image to achieve segmentation. The following examples show the results.'."\n"
+ .'Examples of this feature are as follows:'."\n"
+ ."\n"
+ .'- Original image'."\n"
+ .'![Original image](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20230206/ztyf/SegmentHDSky.jpg" width="600)'."\n"
+ ."\n"
+ .'- HD sky segmentation result'."\n"
+ .'![HD sky segmentation result](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20230206/cpob/SegmentHDSkygaoqing.png" width="600)'."\n"
+ ."\n"
+ .'- Sky segmentation result'."\n"
+ .'![Sky segmentation result](https://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/file-manage-files/zh-CN/20230206/darb/SegmentHDSkyfenge.png" width="600)'."\n"
+ ."\n"
+ .'> - You can visit [Online Consultation](https://www.aliyun.com/core/online-consult?from=aZgW6LJHr2) to get online assistance.'."\n"
+ .'- You can try this feature for free on the Visual Intelligence Open Platform. Click [Try Now](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=SegmentHDSky) to experience this feature or purchase it online.'."\n"
+ .'- For questions about API integration, usage, or consultation regarding Alibaba Cloud Visual Intelligence Open Platform, join the DingTalk group (23109592) to contact us.'."\n"
+ ."\n"
+ .'## Common scenarios'."\n"
+ .'Outdoor photography: When the sky in your outdoor photos is not blue or clear enough, the HD sky segmentation feature can extract the sky from any complex scene. You can then replace it with a beautiful sky to achieve the desired visual effect.'."\n"
+ ."\n"
+ .'## Advantages'."\n"
+ .'- Higher resolution support: HD sky segmentation can process images with a resolution of up to 5000 × 5000 pixels, making it suitable for high-quality post-processing in commercial photography.'."\n"
+ .'- More details: HD sky segmentation produces finer images with more details.'."\n"
+ ."\n"
+ .'## Integration guide'."\n"
+ .'1. Register an Alibaba Cloud account: Go to the [Alibaba Cloud official website](https://www.aliyun.com), click **Register Now** in the upper-right corner, and follow the instructions to complete registration.'."\n"
+ .'2. Activate the feature: Make sure that you have activated the [Image Segmentation service](https://vision.aliyun.com/imageseg). If you have not activated the service, [activate it now](https://common-buy.aliyun.com/?commodityCode=viapi_imageseg_public_cn#/open).'."\n"
+ .'3. Create an AccessKey pair: Make sure that you have [created an AccessKey pair](~~175144~~). If you are using a RAM user AccessKey, grant the AliyunVIAPIFullAccess permission to the RAM user. For more information, see [RAM authorization](~~145025~~).'."\n"
+ .'4. Online debugging (optional): You can use [OpenAPI Explorer](https://next.api.aliyun.com/api/imageseg/2019-12-30/SegmentHDSky?lang=JAVA&sdkStyle=dara&params=%7B%22ImageURL%22%3A%22http%3A%2F%2Fviapi-test.oss-cn-shanghai.aliyuncs.com%2Fviapi-3.0domepic%2Fimageseg%2FSegmentHDSky%2FSegmentHDSky1.jpg%22%7D&tab=DEMO) to debug this feature online, view complete sample code and SDK dependency information, or download the complete project.'."\n"
+ .'5. Development integration steps:'."\n"
+ .'- Select the SDK language you want to use from the [SDK overview](~~145033~~).'."\n"
+ .'- Find the SDK package for the Image Segmentation (imageseg) category in the corresponding SDK documentation and install it.'."\n"
+ .'- Modify the sample code provided in the references as needed and invoke the API.'."\n"
+ ."\n"
+ .'6. Sample code: For sample code in commonly used languages, see [SegmentHDSky sample code](~~605169~~).'."\n"
+ ."\n"
+ .'7. Direct client calls: Common client call methods for this feature include the following.'."\n"
+ .'- [Direct call from web frontend](~~467779~~)'."\n"
+ .'- [Direct call from mini programs](~~467780~~)'."\n"
+ .'- [Direct call from Android](~~467781~~)'."\n"
+ .'- [Direct call from iOS](~~467782~~).'."\n"
+ ."\n"
+ .'## Input limits'."\n"
+ .'- Image format: PNG, JPEG, or JPG.'."\n"
+ .'- Image size: up to 9.5 MB.'."\n"
+ .'- Image resolution: greater than 50 × 50 pixels and less than 5000 × 5000 pixels.'."\n"
+ .'- The URL cannot contain Chinese characters.'."\n"
+ ."\n"
+ .'## Billing description'."\n"
+ .'For information about the billable methods and pricing of HD sky segmentation, see [Billing overview](~~190132~~).'."\n"
+ ."\n"
+ .'> The API debugging section below is a paid feature. For a free trial, go to the [Experience Center](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=SegmentHDSky).',
+ 'requestParamsDescription' => ' ',
+ 'responseParamsDescription' => '## SDK reference'."\n"
+ .'For the HD sky segmentation feature under the Alibaba Cloud Visual AI Image Segmentation category, we recommend that you use the SDK. Multiple programming languages are supported. When calling the API, select the SDK package for the Image Segmentation (imageseg) category. The SDK supports local files and arbitrary URLs for file parameters. For more information, see [SDK overview](~~145033~~).'."\n"
+ ."\n"
+ .'## Sample code'."\n"
+ .'For sample code in commonly used languages, see [SegmentHDSky sample code](~~605169~~).',
+ 'extraInfo' => '## Error codes'."\n"
+ .'For error codes of HD sky segmentation, see [Common error codes](~~146751~~).'."\n"
+ ."\n"
+ .'## Security notice'."\n"
+ .'- Make sure that the uploaded images or files comply with applicable laws and regulations.'."\n"
+ .'- Temporary files uploaded through the debugging experience are valid for 1 hour and are automatically deleted by the system after 24 hours.',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentHDSky'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentHDSky',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
],
],
],
- 'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"EC994171-7964-44B3-85AF-A715CB56747D\\",\\n \\"Data\\": {\\n \\"ImageUrl\\": \\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_commoditysegmenter/2020-10-27/invi_commoditysegmenter_016037842193171000000_5pn2QM.png?Expires=1603786019&OSSAccessKeyId=LTAI****************&Signature=HwUztguGBYXmXGEmuTh%2FL3ztoh****\\"\\n },\\n \\"Message\\": \\"该调用为异步调用,任务已提交成功,请以requestId的值作为jobId参数调用同类目下GetAsyncJobResult接口查询任务执行状态和结果。\\"\\n}","errorExample":""},{"type":"xml","example":"<SegmentHDCommonImageResponse>\\n <RequestId>EC994171-7964-44B3-85AF-A715CB56747D</RequestId>\\n <Message>该调用为异步调用,任务已提交成功,请以requestId的值作为jobId参数调用同类目下GetAsyncJobResult接口查询任务执行状态和结果。</Message>\\n</SegmentHDCommonImageResponse>","errorExample":""}]',
- 'requestParamsDescription' => ' ',
- 'responseParamsDescription' => ' ',
],
- 'SegmentHDSky' => [
- 'methods' => [
- 'post',
- 'get',
- ],
- 'schemes' => [
- 'http',
- 'https',
- ],
+ 'SegmentHair' => [
+ 'methods' => ['post', 'get'],
+ 'schemes' => ['http', 'https'],
'security' => [
[
'AK' => [],
],
],
- 'operationType' => 'read',
+ 'operationType' => 'readAndWrite',
'deprecated' => false,
'systemTags' => [],
'parameters' => [
[
'name' => 'ImageURL',
- 'in' => 'formData',
- 'schema' => [
- 'description' => '',
- 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentHDSky/SegmentHDSky4.jpg',
- 'isFileTransferUrl' => true,
- 'required' => true,
- 'type' => 'string',
- ],
+ 'in' => 'query',
+ 'schema' => ['description' => 'The URL of the image. We recommend that you use an OSS URL in the Shanghai region. If the file is stored locally or in an OSS bucket outside the Shanghai region, see [File URL processing](~~155645~~).', 'type' => 'string', 'required' => true, 'isFileTransferUrl' => true, 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentHair/SegmentHair1.jpg', 'title' => ''],
],
],
'responses' => [
200 => [
'schema' => [
+ 'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'description' => '',
- 'example' => '1173F38F-B4F4-4A07-AB2E-D490C01347E5',
- 'type' => 'string',
- ],
+ 'RequestId' => ['description' => 'The request ID.', 'type' => 'string', 'example' => 'D6C24839-91A7-41DA-B31F-98F08EF80CC0', 'title' => ''],
'Data' => [
- 'description' => '',
+ 'description' => 'The returned data.',
+ 'type' => 'object',
'properties' => [
- 'ImageURL' => [
- 'description' => '',
- 'example' => 'http://vibktprfx-prod-prod-aic-gd-cn-shanghai.oss-cn-shanghai.aliyuncs.com/sky-segmentation-hd/res/1173F38F-B4F4-4A07-AB2E-D490C01347E5_0d56_20201027-061858.jpg?Expires=1603781339&OSSAccessKeyId=LTAI4FoLmvQ9urWXgSRp****&Signature=2F8%2Bj%2FWruWOMqDezwpnJOkcNJD****',
- 'type' => 'string',
+ 'Elements' => [
+ 'description' => 'The segmentation results of each element.',
+ 'type' => 'array',
+ 'items' => [
+ 'type' => 'object',
+ 'properties' => [
+ 'ImageURL' => ['description' => 'The URL of the result image.'."\n"
+ .'The segmented image is returned as a four-channel PNG image without compression. The image dimensions remain unchanged, but the file size increases.'."\n"
+ .'> This URL is a temporary address that is valid for 30 minutes. After it expires, the URL is no longer accessible. To save the file for a longer period or permanently, access the URL within 30 minutes and download the file to your own OSS bucket or other storage.', 'type' => 'string', 'example' => 'http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_HeadSegmenter/2021-12-31/invi_HeadSegmenter_016409228383064285967296_iPLUXA.png?Expires=1640924638&OSSAccessKeyId=LTAI****************&Signature=wpKOqSar1bYvGmlTMryfEH2Q9I****', 'title' => ''],
+ 'Width' => ['description' => 'The width of the result image.', 'type' => 'integer', 'format' => 'int32', 'example' => '113', 'title' => ''],
+ 'Height' => ['description' => 'The height of the result image.', 'type' => 'integer', 'format' => 'int32', 'example' => '180', 'title' => ''],
+ 'Y' => ['description' => 'The y-coordinate of the upper-left corner of the result image in the original image.', 'type' => 'integer', 'format' => 'int32', 'example' => '102', 'title' => ''],
+ 'X' => ['description' => 'The x-coordinate of the upper-left corner of the result image in the original image.', 'type' => 'integer', 'format' => 'int32', 'example' => '446', 'title' => ''],
+ ],
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
+ ],
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
],
],
],
- 'errorCodes' => [
- 400 => [
- [
- 'errorCode' => 'ParameterError',
- 'errorMessage' => 'The parameter is invalid. Please check again.',
- ],
- ],
- 403 => [
- [
- 'errorCode' => 'AuthFailed',
- 'errorMessage' => 'An error occurred while performing authorization. Please check your RAM configuration.',
- ],
- ],
- 408 => [
- [
- 'errorCode' => 'Timeout',
- 'errorMessage' => 'The request has timed out.',
- ],
- ],
- 503 => [
- [
- 'errorCode' => 'ServiceUnavailable',
- 'errorMessage' => 'The service is unavailable.',
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"D6C24839-91A7-41DA-B31F-98F08EF80CC0\\",\\n \\"Data\\": {\\n \\"Elements\\": [\\n {\\n \\"ImageURL\\": \\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_HeadSegmenter/2021-12-31/invi_HeadSegmenter_016409228383064285967296_iPLUXA.png?Expires=1640924638&OSSAccessKeyId=LTAI****************&Signature=wpKOqSar1bYvGmlTMryfEH2Q9I****\\",\\n \\"Width\\": 113,\\n \\"Height\\": 180,\\n \\"Y\\": 102,\\n \\"X\\": 446\\n }\\n ]\\n }\\n}","type":"json"}]',
+ 'title' => 'Hair segmentation',
+ 'summary' => 'This topic describes the syntax and provides examples of the SegmentHair operation.',
+ 'description' => '## Feature description'."\n"
+ .'The hair segmentation feature identifies human portraits in images, parses the portrait regions for matting, and outputs a rectangular transparent PNG image of the hair.'."\n"
+ ."\n"
+ .'> - You can access [online consultation](https://www.aliyun.com/core/online-consult?from=aZgW6LJHr2) for human assistance.'."\n"
+ .'- You can try this feature for free on the Vision Intelligence Open Platform. Click [Try Now](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=SegmentHair) to experience the feature or purchase it online.'."\n"
+ .'- For questions about API integration or usage of Alibaba Cloud Vision Intelligence Open Platform, join the DingTalk group (23109592) to contact us.'."\n"
+ ."\n"
+ .'## Common scenarios'."\n"
+ ."\n"
+ .'- Online wig try-on: After segmenting the hair from a selfie, replace it with a wig image to preview the try-on effect, eliminating the hassle of returns after online purchases.'."\n"
+ .'- Hairstyle preview at salons: A stylist guides customers to take a selfie with a tablet or phone, then swaps in various hairstyles for a more intuitive preview. Customers can choose their favorite hairstyle for the stylist to create.'."\n"
+ ."\n"
+ .'## Advantages'."\n"
+ .'Precise segmentation of hair edges: Hair edges are segmented with high precision, producing seamless image editing results.'."\n"
+ ."\n"
+ .'## Integration guide'."\n"
+ .'1. Register an Alibaba Cloud account: Go to the [Alibaba Cloud official website](https://www.aliyun.com), click **Register Now** in the upper-right corner, and follow the instructions to complete registration.'."\n"
+ .'2. Activate the feature: Make sure you have activated the [Image Segmentation service](https://vision.aliyun.com/imageseg). If you have not activated the service, [activate it now](https://common-buy.aliyun.com/?commodityCode=viapi_imageseg_public_cn#/open).'."\n"
+ .'3. Create an AccessKey: Make sure you have [created an AccessKey](~~175144~~). If you are using a RAM user AccessKey, grant the AliyunVIAPIFullAccess permission to the RAM user. For more information, see [RAM authorization](~~145025~~).'."\n"
+ .'4. Online debugging (optional): You can use [OpenAPI Explorer](https://next.api.aliyun.com/api/imageseg/2019-12-30/SegmentHair?lang=JAVA&sdkStyle=dara&params=%7B%22ImageURL%22%3A%22http%3A%2F%2Fviapi-test.oss-cn-shanghai.aliyuncs.com%2Fviapi-3.0domepic%2Fimageseg%2FSegmentHair%2FSegmentHair1.jpg%22%7D&tab=DEMO) to debug the feature online, view complete sample code and SDK dependency information, or download the complete project.'."\n"
+ .'5. Development and integration steps:'."\n"
+ .'- Select the SDK language you want to use from the [SDK overview](~~145033~~).'."\n"
+ .'- Find the SDK package for the Image Segmentation (imageseg) category in the corresponding SDK documentation and install it.'."\n"
+ .'- Modify the sample code provided in the References as needed and invoke it.'."\n"
+ ."\n"
+ .'6. Sample code: For sample code in commonly used languages, see [Hair segmentation sample code](~~605130~~).'."\n"
+ ."\n"
+ .'7. Direct client calls: Common client-side call methods for this feature include the following.'."\n"
+ .'- [Direct call from web frontend](~~467779~~)'."\n"
+ .'- [Direct call from mini programs](~~467780~~)'."\n"
+ .'- [Direct call from Android](~~467781~~)'."\n"
+ .'- [Direct call from iOS](~~467782~~).'."\n"
+ ."\n"
+ .'## Input limits'."\n"
+ .'- Image format: JPEG, JPG, PNG, or BMP.'."\n"
+ .'- Image size: Up to 3 MB.'."\n"
+ .'- Image resolution: Greater than 32 × 32 pixels and less than 2000 × 2000 pixels.'."\n"
+ .'- The URL cannot contain Chinese characters.'."\n"
+ ."\n"
+ .'## Billing description'."\n"
+ .'For the billable methods and pricing of hair segmentation, see [Billing overview](~~190132~~).'."\n"
+ ."\n"
+ .'> The API debugging interface below is a paid interface. For a free trial, go to the [Experience Center](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=SegmentHair).',
+ 'requestParamsDescription' => ' ',
+ 'responseParamsDescription' => '## SDK reference'."\n"
+ .'For the hair segmentation feature under the Alibaba Cloud Vision AI Image Segmentation category, we recommend that you use the SDK. Multiple programming languages are supported. When making calls, select the SDK package for the Image Segmentation (imageseg) category. File parameters passed through the SDK support both local files and arbitrary URLs. For more information, see [SDK overview](~~145033~~).'."\n"
+ ."\n"
+ .'## Sample code'."\n"
+ .'For sample code in commonly used languages, see [Hair segmentation sample code](~~605130~~).',
+ 'extraInfo' => '## Error codes'."\n"
+ .'For error codes of hair segmentation, see [Common error codes](~~146751~~).'."\n"
+ ."\n"
+ .'## Security notice'."\n"
+ .'- Make sure that the uploaded images or files comply with applicable laws and regulations.'."\n"
+ .'- Temporary files uploaded through the debugging interface are valid for 1 hour and are automatically deleted by the system after 24 hours.',
+ 'changeSet' => [
+ ['createdAt' => '2022-03-30T06:07:10.000Z', 'description' => 'Error codes changed'],
+ ],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentHair'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentHair',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
],
],
],
- 'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"1173F38F-B4F4-4A07-AB2E-D490C01347E5\\",\\n \\"Data\\": {\\n \\"ImageURL\\": \\"http://vibktprfx-prod-prod-aic-gd-cn-shanghai.oss-cn-shanghai.aliyuncs.com/sky-segmentation-hd/res/1173F38F-B4F4-4A07-AB2E-D490C01347E5_0d56_20201027-061858.jpg?Expires=1603781339&OSSAccessKeyId=LTAI****************&Signature=2F8%2Bj%2FWruWOMqDezwpnJOkcNJD****\\"\\n }\\n}","errorExample":""},{"type":"xml","example":"<SegmentHDSkyResponse>\\n <RequestId>1173F38F-B4F4-4A07-AB2E-D490C01347E5</RequestId>\\n <Data>\\n <ImageURL>http://vibktprfx-prod-prod-aic-gd-cn-shanghai.oss-cn-shanghai.aliyuncs.com/sky-segmentation-hd/res/1173F38F-B4F4-4A07-AB2E-D490C01347E5_0d56_20201027-061858.jpg?Expires=1603781339&amp;OSSAccessKeyId=LTAI****************&amp;Signature=2F8%2Bj%2FWruWOMqDezwpnJOkcNJD****</ImageURL>\\n </Data>\\n</SegmentHDSkyResponse>","errorExample":""}]',
- 'requestParamsDescription' => ' ',
],
'SegmentHead' => [
- 'methods' => [
- 'post',
- 'get',
- ],
- 'schemes' => [
- 'http',
- 'https',
- ],
+ 'methods' => ['post', 'get'],
+ 'schemes' => ['http', 'https'],
'security' => [
[
'AK' => [],
@@ -1020,96 +1781,134 @@
[
'name' => 'ImageURL',
'in' => 'query',
- 'schema' => [
- 'description' => '',
- 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentHead/SegmentHead1.jpg',
- 'isFileTransferUrl' => true,
- 'required' => true,
- 'type' => 'string',
- ],
+ 'schema' => ['description' => 'The URL of the image. We recommend that you use an Object Storage Service (OSS) link in the Shanghai region. If the file is stored locally or in an OSS bucket outside the Shanghai region, see [File URL processing](~~155645~~).', 'type' => 'string', 'required' => true, 'isFileTransferUrl' => true, 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentHead/SegmentHead1.jpg', 'title' => ''],
],
[
'name' => 'ReturnForm',
'in' => 'query',
- 'schema' => [
- 'description' => '',
- 'example' => 'mask',
- 'required' => false,
- 'type' => 'string',
- ],
+ 'schema' => ['description' => 'The format of the returned image.'."\n"
+ ."\n"
+ .'- If you set this parameter to `mask`, a single-channel mask is returned.'."\n"
+ .'- If you leave this parameter empty or set it to any value other than mask, a four-channel PNG image is returned.', 'type' => 'string', 'required' => false, 'example' => 'mask', 'title' => ''],
],
],
'responses' => [
200 => [
'schema' => [
+ 'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'description' => '',
- 'example' => '89BBDA42-E1CA-426E-9A46-C703D8DBB1E2',
- 'type' => 'string',
- ],
+ 'RequestId' => ['description' => 'The request ID.', 'type' => 'string', 'example' => '89BBDA42-E1CA-426E-9A46-C703D8DBB1E2', 'title' => ''],
'Data' => [
- 'description' => '',
+ 'description' => 'The returned data.',
+ 'type' => 'object',
'properties' => [
'Elements' => [
- 'description' => '',
+ 'description' => 'The segmentation results of each element.',
+ 'type' => 'array',
'items' => [
+ 'type' => 'object',
'properties' => [
- 'ImageURL' => [
- 'description' => '',
- 'example' => 'http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_headsegmenter/2020-6-2/invi_headsegmenter_015910809094981099086_TAamhR.png?Expires=1591082709&OSSAccessKeyId=LTAI4FoLmvQ9urWXgSRp****&Signature=xuUE%2FbYeB9LpR18VXawOVeutQU****',
- 'type' => 'string',
- ],
- 'Width' => [
- 'description' => '',
- 'example' => '116',
- 'format' => 'int32',
- 'type' => 'integer',
- ],
- 'Height' => [
- 'description' => '',
- 'example' => '180',
- 'format' => 'int32',
- 'type' => 'integer',
- ],
- 'Y' => [
- 'description' => '',
- 'example' => '102',
- 'format' => 'int32',
- 'type' => 'integer',
- ],
- 'X' => [
- 'description' => '',
- 'example' => '445',
- 'format' => 'int32',
- 'type' => 'integer',
- ],
+ 'ImageURL' => ['description' => 'The URL of the result image.'."\n"
+ .'A four-channel PNG image without compression is returned after segmentation, so the file size may increase.'."\n"
+ .'> This URL is a temporary URL that is valid for 30 minutes. After it expires, the URL is no longer accessible. To save the file for a longer period or permanently, access the URL within 30 minutes, download the file, and store it in your own OSS bucket or other storage.', 'type' => 'string', 'example' => 'http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_headsegmenter/2020-6-2/invi_headsegmenter_015910809094981099086_TAamhR.png?Expires=1591082709&OSSAccessKeyId=LTAI****************&Signature=xuUE%2FbYeB9LpR18VXawOVeutQU****', 'title' => ''],
+ 'Width' => ['description' => 'The width of the result image.', 'type' => 'integer', 'format' => 'int32', 'example' => '116', 'title' => ''],
+ 'Height' => ['description' => 'The height of the result image.', 'type' => 'integer', 'format' => 'int32', 'example' => '180', 'title' => ''],
+ 'Y' => ['description' => 'The y-coordinate of the upper-left corner.', 'type' => 'integer', 'format' => 'int32', 'example' => '102', 'title' => ''],
+ 'X' => ['description' => 'The x-coordinate of the upper-left corner.', 'type' => 'integer', 'format' => 'int32', 'example' => '445', 'title' => ''],
],
- 'type' => 'object',
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
],
- 'type' => 'array',
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
],
],
],
- 'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"89BBDA42-E1CA-426E-9A46-C703D8DBB1E2\\",\\n \\"Data\\": {\\n \\"Elements\\": [\\n {\\n \\"ImageURL\\": \\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_headsegmenter/2020-6-2/invi_headsegmenter_015910809094981099086_TAamhR.png?Expires=1591082709&OSSAccessKeyId=LTAI****************&Signature=xuUE%2FbYeB9LpR18VXawOVeutQU****\\",\\n \\"Width\\": 116,\\n \\"Height\\": 180,\\n \\"Y\\": 102,\\n \\"X\\": 445\\n }\\n ]\\n }\\n}","errorExample":""},{"type":"xml","example":"<SegmentHeadResponse>\\n <RequestId>89BBDA42-E1CA-426E-9A46-C703D8DBB1E2</RequestId>\\n <Data>\\n <Elements>\\n <ImageURL>http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_headsegmenter/2020-6-2/invi_headsegmenter_015910809094981099086_TAamhR.png?Expires=1591082709&amp;OSSAccessKeyId=LTAI****************&amp;Signature=xuUE%2FbYeB9LpR18VXawOVeutQU****</ImageURL>\\n <Width>116</Width>\\n <Height>180</Height>\\n <Y>102</Y>\\n <X>445</X>\\n </Elements>\\n </Data>\\n</SegmentHeadResponse>","errorExample":""}]',
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"89BBDA42-E1CA-426E-9A46-C703D8DBB1E2\\",\\n \\"Data\\": {\\n \\"Elements\\": [\\n {\\n \\"ImageURL\\": \\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_headsegmenter/2020-6-2/invi_headsegmenter_015910809094981099086_TAamhR.png?Expires=1591082709&OSSAccessKeyId=LTAI****************&Signature=xuUE%2FbYeB9LpR18VXawOVeutQU****\\",\\n \\"Width\\": 116,\\n \\"Height\\": 180,\\n \\"Y\\": 102,\\n \\"X\\": 445\\n }\\n ]\\n }\\n}","type":"json"}]',
+ 'title' => 'Head segmentation',
+ 'summary' => 'This topic describes the syntax and provides examples of SegmentHead.',
+ 'description' => '## Feature description'."\n"
+ .'The head segmentation feature identifies human heads in images, performs matting on the detected heads, and outputs transparent PNG images of the heads.'."\n"
+ ."\n"
+ .'> - You can join [online consultation](https://www.aliyun.com/core/online-consult?from=aZgW6LJHr2) to get help from our support team.'."\n"
+ .'- You can try this feature for free on the Vision Intelligence Open Platform. Click [Try Now](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=SegmentHead) to experience this feature or purchase it online.'."\n"
+ .'- To consult about API integration, usage, or issues related to Alibaba Cloud Vision Intelligence Open Platform, contact us by joining the DingTalk group (23109592).'."\n"
+ ."\n"
+ .'## Integration guide'."\n"
+ .'1. Create an Alibaba Cloud account: Go to the [Alibaba Cloud official website](https://www.aliyun.com), click **Register Now** in the upper-right corner, and follow the instructions to create an account.'."\n"
+ .'2. Activate the feature: Make sure you have activated the [Image Segmentation service](https://vision.aliyun.com/imageseg). If you have not activated the service, [activate it now](https://common-buy.aliyun.com/?commodityCode=viapi_imageseg_public_cn#/open).'."\n"
+ .'3. Create an AccessKey pair: Make sure you have [created an AccessKey pair](~~175144~~). If you are using a RAM user AccessKey, grant the AliyunVIAPIFullAccess permission to the RAM user. For more information, see [RAM authorization](~~145025~~).'."\n"
+ .'4. Online debugging (optional): You can use [OpenAPI Explorer](https://next.api.aliyun.com/api/imageseg/2019-12-30/SegmentHead?lang=JAVA&sdkStyle=dara&params=%7B%22ImageURL%22%3A%22http%3A%2F%2Fviapi-test.oss-cn-shanghai.aliyuncs.com%2Fviapi-3.0domepic%2Fimageseg%2FSegmentHead%2FSegmentHead1.jpg%22%7D&tab=DEMO) to debug this feature online, view complete sample code and SDK dependency information, or download the complete project.'."\n"
+ .'5. Development and integration steps:'."\n"
+ .'- Select the SDK language you want to use from the [SDK overview](~~145033~~).'."\n"
+ .'- Find the SDK package for the Image Segmentation (imageseg) category in the corresponding SDK documentation and install it.'."\n"
+ .'- Modify the sample code provided in the References as needed and invoke the API.'."\n"
+ ."\n"
+ .'6. Sample code: For sample code in commonly used languages, see [Head segmentation sample code](~~605157~~).'."\n"
+ ."\n"
+ .'7. Direct client calls: Common client call methods for this feature include the following.'."\n"
+ .'- [Direct call from web frontend](~~467779~~)'."\n"
+ .'- [Direct call from mini programs](~~467780~~)'."\n"
+ .'- [Direct call from Android](~~467781~~)'."\n"
+ .'- [Direct call from iOS](~~467782~~).'."\n"
+ ."\n"
+ .'## Input limits'."\n"
+ .'- Image format: JPEG, JPG, PNG, or BMP.'."\n"
+ .'- Image size: up to 3 MB.'."\n"
+ .'- Image resolution: greater than 32 × 32 pixels and less than 2000 × 2000 pixels.'."\n"
+ .'- The URL cannot contain Chinese characters.'."\n"
+ .'- Images with multiple faces may cause service timeout errors. We recommend that the image contain no more than 5 faces.'."\n"
+ ."\n"
+ .'## Billing description'."\n"
+ .'For information about the billable methods and pricing of head segmentation, see [Billing overview](~~190132~~).'."\n"
+ ."\n"
+ .'> The debugging API below is a paid API. To try it for free, go to the [Experience Center](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=SegmentHead).',
'requestParamsDescription' => ' ',
+ 'responseParamsDescription' => '## SDK reference'."\n"
+ .'We recommend that you use an SDK to call the head segmentation feature under the Vision AI Image Segmentation category. SDKs are available in multiple programming languages. Select the SDK package for the Image Segmentation (imageseg) category. File parameters support both local files and URLs when called through the SDK. For more information, see [SDK overview](~~145033~~).'."\n"
+ ."\n"
+ .'## Sample code'."\n"
+ .'For sample code in commonly used languages, see [Head segmentation sample code](~~605157~~).',
+ 'extraInfo' => '## Error codes'."\n"
+ .'For error codes of head segmentation, see [Common error codes](~~146751~~).'."\n"
+ ."\n"
+ .'## Security notice'."\n"
+ .'- Make sure that the uploaded images or files comply with applicable laws and regulations.'."\n"
+ .'- Temporary files uploaded through the debugging feature are valid for 1 hour and are automatically deleted by the system after 24 hours.',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '500', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentHead'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentHead',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ ],
],
'SegmentSkin' => [
- 'summary' => '皮肤分割',
- 'methods' => [
- 'post',
- 'get',
- ],
- 'schemes' => [
- 'http',
- 'https',
- ],
+ 'summary' => 'This topic describes the syntax and provides examples of the skin segmentation feature (SegmentSkin).',
+ 'methods' => ['post', 'get'],
+ 'schemes' => ['http', 'https'],
'security' => [
[
'AK' => [],
@@ -1117,89 +1916,120 @@
],
'operationType' => 'read',
'deprecated' => false,
- 'systemTags' => [
- 'operationType' => 'none',
- 'riskType' => 'none',
- 'chargeType' => 'paid',
- 'tenantRelevance' => 'publicInformation',
- ],
+ 'systemTags' => ['operationType' => 'none', 'riskType' => 'none', 'chargeType' => 'paid', 'tenantRelevance' => 'publicInformation'],
'parameters' => [
[
'name' => 'URL',
'in' => 'formData',
- 'schema' => [
- 'description' => '',
- 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentSkin/SegmentSkin2.jpg',
- 'isFileTransferUrl' => true,
- 'required' => true,
- 'type' => 'string',
- ],
+ 'schema' => ['description' => 'The URL of the image. We recommend that you use an Object Storage Service (OSS) URL in the Shanghai region. If the file is stored locally or in an OSS bucket outside the Shanghai region, see [File URL processing](~~155645~~).', 'type' => 'string', 'required' => true, 'isFileTransferUrl' => true, 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentSkin/SegmentSkin2.jpg', 'title' => ''],
],
],
'responses' => [
200 => [
'schema' => [
+ 'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'description' => '',
- 'example' => 'DA007354-6CF5-45BE-8333-E06318D848C0',
- 'type' => 'string',
- ],
+ 'RequestId' => ['description' => 'The request ID.', 'type' => 'string', 'example' => 'DA007354-6CF5-45BE-8333-E06318D848C0', 'title' => ''],
'Data' => [
- 'description' => '',
+ 'description' => 'The returned result data.',
+ 'type' => 'object',
'properties' => [
- 'URL' => [
- 'description' => '',
- 'example' => 'http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_skinsegmenter/2020-9-27/invi_skinsegmenter_016011971641871000001_wQbLq9.jpg?Expires=1601198964&OSSAccessKeyId=LTAI4FoLmvQ9urWXgSRp****&Signature=xjKc%2BScprmB86cxtI%2B1T0R6TlE****',
- 'type' => 'string',
- ],
+ 'URL' => ['description' => 'The URL of the segmentation result image.'."\n"
+ .'After segmentation, a four-channel PNG image is returned without compression. The image dimensions remain unchanged, but the file size increases.'."\n"
+ .'> This URL is a temporary address that is valid for 30 minutes. After it expires, the URL is no longer accessible. To save the file for a longer period or permanently, access the URL within 30 minutes and download the file to your own OSS bucket or other storage.', 'type' => 'string', 'example' => 'http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_skinsegmenter/2020-9-27/invi_skinsegmenter_016011971641871000001_wQbLq9.jpg?Expires=1601198964&OSSAccessKeyId=LTAI****************&Signature=xjKc%2BScprmB86cxtI%2B1T0R6TlE****', 'title' => ''],
],
- 'type' => 'object',
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
],
],
],
'errorCodes' => [
400 => [
- [
- 'errorCode' => 'ParameterError',
- 'errorMessage' => 'The parameter is invalid. Please check again.',
- ],
+ ['errorCode' => 'ParameterError', 'errorMessage' => 'The parameter is invalid. Please check again.', 'description' => 'The parameter is invalid. Please check again.'],
],
403 => [
- [
- 'errorCode' => 'AuthFailed',
- 'errorMessage' => 'An error occurred while performing authorization. Please check your RAM configuration.',
- ],
+ ['errorCode' => 'AuthFailed', 'errorMessage' => 'An error occurred while performing authorization. Please check your RAM configuration.', 'description' => 'An error occurred while performing authorization. Please check your RAM configuration.'],
],
408 => [
- [
- 'errorCode' => 'Timeout',
- 'errorMessage' => 'The request has timed out.',
- ],
+ ['errorCode' => 'Timeout', 'errorMessage' => 'The request has timed out.', 'description' => 'The request has timed out.'],
],
503 => [
- [
- 'errorCode' => 'ServiceUnavailable',
- 'errorMessage' => 'The service is unavailable.',
+ ['errorCode' => 'ServiceUnavailable', 'errorMessage' => 'The service is unavailable.', 'description' => 'The service is unavailable. '],
+ ],
+ ],
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"DA007354-6CF5-45BE-8333-E06318D848C0\\",\\n \\"Data\\": {\\n \\"URL\\": \\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_skinsegmenter/2020-9-27/invi_skinsegmenter_016011971641871000001_wQbLq9.jpg?Expires=1601198964&OSSAccessKeyId=LTAI****************&Signature=xjKc%2BScprmB86cxtI%2B1T0R6TlE****\\"\\n }\\n}","type":"json"}]',
+ 'title' => 'Skin segmentation',
+ 'description' => '## Feature description'."\n"
+ .'The skin segmentation feature identifies human skin in images and segments the skin regions, outputting the corresponding mask image.'."\n"
+ ."\n"
+ .'> - You can visit [Online Consultation](https://www.aliyun.com/core/online-consult?from=aZgW6LJHr2) for online assistance.'."\n"
+ .'- This feature is available for a full free trial on the Visual Intelligence Open Platform. Click [Try Now](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=SegmentSkin) to try this feature or purchase it online.'."\n"
+ .'- For questions about API integration or usage of Alibaba Cloud Visual Intelligence Open Platform, join the DingTalk group (23109592) to contact us.'."\n"
+ ."\n"
+ .'## Integration guide'."\n"
+ .'1. Register an Alibaba Cloud account: Go to the [Alibaba Cloud official website](https://www.aliyun.com), click **Register Now** in the upper-right corner, and follow the instructions to complete registration.'."\n"
+ .'2. Activate the feature: Make sure you have activated the [Image Segmentation service](https://vision.aliyun.com/imageseg). If you have not activated the service, [activate it now](https://common-buy.aliyun.com/?commodityCode=viapi_imageseg_public_cn#/open).'."\n"
+ .'3. Create an AccessKey pair: Make sure you have [created an AccessKey pair](~~175144~~). If you are using a RAM user AccessKey, grant the AliyunVIAPIFullAccess permission to the RAM user. For more information, see [RAM authorization](~~145025~~).'."\n"
+ .'4. Online debugging (optional): You can use [OpenAPI Explorer](https://next.api.aliyun.com/api/imageseg/2019-12-30/SegmentSkin?lang=JAVA&sdkStyle=dara&params=%7B%22URL%22%3A%22http%3A%2F%2Fviapi-test.oss-cn-shanghai.aliyuncs.com%2Fviapi-3.0domepic%2Fimageseg%2FSegmentSkin%2FSegmentSkin1.jpg%22%7D&tab=DEMO) to debug the feature online, view complete sample code and SDK dependency information, or download the complete project.'."\n"
+ .'5. Development integration steps:'."\n"
+ .'- Select the SDK language you want to use from the [SDK overview](~~145033~~).'."\n"
+ .'- Find and install the SDK package for the Image Segmentation (imageseg) category in the corresponding SDK documentation.'."\n"
+ .'- Modify the sample code provided in the References as needed and invoke it.'."\n"
+ ."\n"
+ .'6. Direct client calls: Common client call methods for this feature include the following.'."\n"
+ .'- [Direct call from web frontend](~~467779~~)'."\n"
+ .'- [Direct call from a mini program](~~467780~~)'."\n"
+ .'- [Direct call from Android](~~467781~~)'."\n"
+ .'- [Direct call from iOS](~~467782~~).'."\n"
+ ."\n"
+ .'## Input limits'."\n"
+ .'- Image format: PNG (8-bit, 16-bit, and 64-bit PNG are not supported), JPEG, JPG, and BMP.'."\n"
+ .'- Image size: up to 3 MB.'."\n"
+ .'- Image resolution: greater than 32 × 32 pixels and less than 2000 × 2000 pixels.'."\n"
+ .'- The URL cannot contain Chinese characters.'."\n"
+ ."\n"
+ .'## Billing description'."\n"
+ .'For information about the billable methods and pricing of skin segmentation, see [Billing overview](~~190132~~).'."\n"
+ ."\n"
+ .'> The API operation below is a paid operation. For a free trial, go to the [Experience Center](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=SegmentSkin).',
+ 'requestParamsDescription' => ' ',
+ 'responseParamsDescription' => '## SDK reference'."\n"
+ .'For the skin segmentation feature under the Alibaba Cloud Visual AI Image Segmentation category, we recommend that you use the SDK. The SDK supports multiple programming languages. When making calls, select the SDK package for the Image Segmentation (imageseg) category. File parameters passed through the SDK support both local files and arbitrary URLs. For more information, see [SDK overview](~~145033~~).',
+ 'extraInfo' => '## Error codes'."\n"
+ .'For error codes of skin segmentation, see [Common error codes](~~146751~~).'."\n"
+ ."\n"
+ .'## Security notice'."\n"
+ ."\n"
+ .'- Make sure that the uploaded images or files comply with applicable laws and regulations.'."\n"
+ .'- Temporary files uploaded through the trial debugging are valid for 1 hour and are automatically deleted by the system after 24 hours.',
+ 'changeSet' => [],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentSkin'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => 'none',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentSkin',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
],
],
],
- 'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"DA007354-6CF5-45BE-8333-E06318D848C0\\",\\n \\"Data\\": {\\n \\"URL\\": \\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_skinsegmenter/2020-9-27/invi_skinsegmenter_016011971641871000001_wQbLq9.jpg?Expires=1601198964&OSSAccessKeyId=LTAI****************&Signature=xjKc%2BScprmB86cxtI%2B1T0R6TlE****\\"\\n }\\n}","errorExample":""},{"type":"xml","example":"<SegmentSkinResponse>\\n <RequestId>DA007354-6CF5-45BE-8333-E06318D848C0</RequestId>\\n <Data>\\n <URL>http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_skinsegmenter/2020-9-27/invi_skinsegmenter_016011971641871000001_wQbLq9.jpg?Expires=1601198964&amp;OSSAccessKeyId=LTAI****************&amp;Signature=xjKc%2BScprmB86cxtI%2B1T0R6TlE****</URL>\\n </Data>\\n</SegmentSkinResponse>","errorExample":""}]',
- 'requestParamsDescription' => ' ',
- 'responseParamsDescription' => ' ',
],
'SegmentSky' => [
- 'methods' => [
- 'post',
- 'get',
- ],
- 'schemes' => [
- 'http',
- 'https',
- ],
+ 'methods' => ['post', 'get'],
+ 'schemes' => ['http', 'https'],
'security' => [
[
'AK' => [],
@@ -1212,130 +2042,477 @@
[
'name' => 'ImageURL',
'in' => 'query',
- 'schema' => [
- 'description' => '',
- 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentSky/SegmentSky5.jpg',
- 'isFileTransferUrl' => true,
- 'required' => true,
- 'type' => 'string',
- ],
+ 'schema' => ['description' => 'The URL of the image. We recommend that you use an Object Storage Service (OSS) link in the Shanghai region. If the file is stored locally or in an OSS bucket outside the Shanghai region, see [File URL processing](~~155645~~).', 'type' => 'string', 'required' => true, 'isFileTransferUrl' => true, 'example' => 'http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/imageseg/SegmentSky/SegmentSky5.jpg', 'title' => ''],
],
],
'responses' => [
200 => [
'schema' => [
+ 'type' => 'object',
'properties' => [
- 'RequestId' => [
- 'description' => '',
- 'example' => '80E9D0A0-0330-4210-9986-CAC50C922FF0',
- 'type' => 'string',
- ],
+ 'RequestId' => ['description' => 'The request ID.', 'type' => 'string', 'example' => '80E9D0A0-0330-4210-9986-CAC50C922FF0', 'title' => ''],
'Data' => [
- 'description' => '',
+ 'description' => 'The returned result data.',
+ 'type' => 'object',
'properties' => [
- 'ImageURL' => [
- 'description' => '',
- 'example' => 'http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/skysegmentation-2020-05-18-10-44-16-5bc8dc79f9-92b7z/2020-5-18/invi_skySegmentator_015897703560961000003_SqZLDv.png?Expires=1589772156&OSSAccessKeyId=LTAI4FoLmvQ9urWXgSRp****&Signature=gXrzAUl%2BvIdYbQ9XKdho54MlkX****',
- 'type' => 'string',
- ],
+ 'ImageURL' => ['description' => 'The URL of the result image.'."\n"
+ .'After segmentation, a four-channel PNG image is returned without compression. The image dimensions remain unchanged, but the file size increases.'."\n"
+ .'> This URL is a temporary address that is valid for 30 minutes. After it expires, the URL is no longer accessible. To save the file for a longer period or permanently, access the URL within 30 minutes and download the file to your own OSS bucket or other storage.', 'type' => 'string', 'example' => 'http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/skysegmentation-2020-05-18-10-44-16-5bc8dc79f9-92b7z/2020-5-18/invi_skySegmentator_015897703560961000003_SqZLDv.png?Expires=1589772156&OSSAccessKeyId=LTAI****************&Signature=gXrzAUl%2BvIdYbQ9XKdho54MlkX****', 'title' => ''],
],
- 'type' => 'object',
+ 'title' => '',
+ 'example' => '',
],
],
- 'type' => 'object',
+ 'description' => '',
+ 'title' => '',
+ 'example' => '',
],
],
],
- 'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"80E9D0A0-0330-4210-9986-CAC50C922FF0\\",\\n \\"Data\\": {\\n \\"ImageURL\\": \\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/skysegmentation-2020-05-18-10-44-16-5bc8dc79f9-92b7z/2020-5-18/invi_skySegmentator_015897703560961000003_SqZLDv.png?Expires=1589772156&OSSAccessKeyId=LTAI****************&Signature=gXrzAUl%2BvIdYbQ9XKdho54MlkX****\\"\\n }\\n}","errorExample":""},{"type":"xml","example":"<SegmentSkyResponse>\\n <RequestId>80E9D0A0-0330-4210-9986-CAC50C922FF0</RequestId>\\n <Data>\\n <ImageURL>http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/skysegmentation-2020-05-18-10-44-16-5bc8dc79f9-92b7z/2020-5-18/invi_skySegmentator_015897703560961000003_SqZLDv.png?Expires=1589772156&amp;OSSAccessKeyId=LTAI****************&amp;Signature=gXrzAUl%2BvIdYbQ9XKdho54MlkX****</ImageURL>\\n </Data>\\n</SegmentSkyResponse>","errorExample":""}]',
+ 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"80E9D0A0-0330-4210-9986-CAC50C922FF0\\",\\n \\"Data\\": {\\n \\"ImageURL\\": \\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/skysegmentation-2020-05-18-10-44-16-5bc8dc79f9-92b7z/2020-5-18/invi_skySegmentator_015897703560961000003_SqZLDv.png?Expires=1589772156&OSSAccessKeyId=LTAI****************&Signature=gXrzAUl%2BvIdYbQ9XKdho54MlkX****\\"\\n }\\n}","type":"json"}]',
+ 'title' => 'Sky segmentation',
+ 'summary' => 'This topic describes the syntax and provides examples of the sky segmentation feature (SegmentSky).',
+ 'description' => '## Feature description'."\n"
+ .'The sky segmentation feature identifies sky regions in an input image, separates them from the background, and returns the segmented foreground image.'."\n"
+ ."\n"
+ .'> - You can visit [Online Consultation](https://www.aliyun.com/core/online-consult?from=aZgW6LJHr2) for online assistance.'."\n"
+ .'- You can try this feature for free on the Vision Intelligence Open Platform. Click [Try Now](https://vision.aliyun.com/experience/detail?&tagName=imageseg&children=SegmentSky) to experience this feature or purchase it online.'."\n"
+ .'- For questions about API integration or usage of visual AI features on the Alibaba Cloud Vision Intelligence Open Platform, join the DingTalk group (23109592) to contact us.'."\n"
+ ."\n"
+ .'## Integration guide'."\n"
+ .'1. Register an Alibaba Cloud account: Go to the [Alibaba Cloud official website](https://www.aliyun.com), click **Register Now** in the upper-right corner, and follow the instructions to complete registration.'."\n"
+ .'2. Activate the feature: Make sure you have activated the [Image Segmentation service](https://vision.aliyun.com/imageseg). If you have not activated the service, [activate it now](https://common-buy.aliyun.com/?commodityCode=viapi_imageseg_public_cn#/open).'."\n"
+ .'3. Create an AccessKey: Make sure you have [created an AccessKey](~~175144~~). If you are using a RAM user AccessKey, grant the AliyunVIAPIFullAccess permission to the RAM user. For more information, see [RAM authorization](~~145025~~).'."\n"
+ .'4. Online debugging (optional): You can use [OpenAPI Explorer](https://next.api.aliyun.com/api/imageseg/2019-12-30/SegmentSky?lang=JAVA&sdkStyle=dara&params=%7B%22ImageURL%22%3A%22http%3A%2F%2Fviapi-test.oss-cn-shanghai.aliyuncs.com%2Fviapi-3.0domepic%2Fimageseg%2FSegmentSky%2FSegmentSky1.jpg%22%7D&tab=DEMO) to debug this feature online, view complete sample code and SDK dependency information, or download the complete project.'."\n"
+ .'5. Development integration steps:'."\n"
+ .'- Select the SDK language you want to use from the [SDK overview](~~145033~~).'."\n"
+ .'- Find and install the SDK package for the Image Segmentation (imageseg) AI category in the corresponding SDK documentation.'."\n"
+ .'- Modify the sample code provided in the references as needed and invoke the API.'."\n"
+ ."\n"
+ .'6. Direct client calls: Common client call methods for this feature include the following.'."\n"
+ .'- [Direct call from web frontend](~~467779~~)'."\n"
+ .'- [Direct call from mini programs](~~467780~~)'."\n"
+ .'- [Direct call from Android](~~467781~~)'."\n"
+ .'- [Direct call from iOS](~~467782~~).'."\n"
+ ."\n"
+ .'## Input limits'."\n"
+ .'- Image format: JPG, JPEG, BMP, or PNG.'."\n"
+ .'- Image size: Up to 3 MB.'."\n"
+ .'- Image resolution: Greater than 50 × 50 pixels and less than 3000 × 3000 pixels.'."\n"
+ .'- The URL cannot contain Chinese characters.'."\n"
+ ."\n"
+ .'## Billing description'."\n"
+ .'The sky segmentation feature is currently in public preview and can be called for free.',
'requestParamsDescription' => ' ',
- 'responseParamsDescription' => ' ',
+ 'responseParamsDescription' => '## SDK reference'."\n"
+ .'For the sky segmentation feature under the Alibaba Cloud Vision AI Image Segmentation category, we recommend that you use the SDK. The SDK supports multiple programming languages. When making calls, select the SDK package for the Image Segmentation (imageseg) AI category. The SDK supports both local files and arbitrary URLs for file parameters. For more information, see [SDK overview](~~145033~~).',
+ 'extraInfo' => '## Error codes'."\n"
+ .'For error codes of the sky segmentation feature, see [Common error codes](~~146751~~).'."\n"
+ ."\n"
+ .'## Security notice'."\n"
+ .'- Make sure that the uploaded images or files comply with applicable laws and regulations.'."\n"
+ .'- Temporary files uploaded through the debugging experience are valid for 1 hour and are automatically deleted by the system after 24 hours.',
+ 'changeSet' => [
+ ['createdAt' => '2022-03-30T06:07:10.000Z', 'description' => 'Error codes changed'],
+ ],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentSky'],
+ ],
+ ],
+ 'ramActions' => [
+ [
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentSky',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ ],
],
- 'GetAsyncJobResult' => [
- 'methods' => [
- 'post',
- 'get',
+ ],
+ 'endpoints' => [
+ ['regionId' => 'cn-shanghai', 'regionName' => 'China (Shanghai)', 'areaId' => 'asiaPacific', 'areaName' => 'Asia Pacific', 'public' => 'imageseg.cn-shanghai.aliyuncs.com', 'endpoint' => 'imageseg.cn-shanghai.aliyuncs.com', 'vpc' => 'imageseg-vpc.cn-shanghai.aliyuncs.com'],
+ ],
+ 'errorCodes' => [
+ ['code' => 'AuthFailed', 'message' => 'An error occurred while performing authorization. Please check your RAM configuration.', 'http_code' => 403, 'description' => 'An error occurred while performing authorization. Please check your RAM configuration.'],
+ ['code' => 'ClientError.IllegalArgument', 'message' => '请检查参数,如参数值所代表的数据库是否存在', 'http_code' => 400, 'description' => ''],
+ ['code' => 'EntityNotExist.Role', 'message' => '没有Ram权限,请联系主账号给你添加AliyunVIAPIFullAccess权限,操作流程可参考https://help.aliyun.com/document_detail/145025.htm', 'http_code' => 400, 'description' => ''],
+ ['code' => 'IllegalUrlParameter', 'message' => 'parameter url is illegal', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InternalError', 'message' => 'An error occurred to the algorithm service.', 'http_code' => 500, 'description' => ''],
+ ['code' => 'InternalError.Algo', 'message' => 'An algorithm error occurred.', 'http_code' => 500, 'description' => ''],
+ ['code' => 'InternalError.Busy', 'message' => 'Server busy.', 'http_code' => 500, 'description' => ''],
+ ['code' => 'InternalError.Env', 'message' => 'Failed to initilize the environment.', 'http_code' => 500, 'description' => ''],
+ ['code' => 'InternalError.Model', 'message' => 'Failed to load the model.', 'http_code' => 500, 'description' => ''],
+ ['code' => 'InternalError.Process', 'message' => 'An error occurred during inference.', 'http_code' => 500, 'description' => ''],
+ ['code' => 'InternalError.Remote', 'message' => 'The request processing has failed due to some unknown error.', 'http_code' => 500, 'description' => ''],
+ ['code' => 'InternalError.Server', 'message' => 'The request processing has failed due to some unknown error.', 'http_code' => 500, 'description' => ''],
+ ['code' => 'InternalError.Timeout', 'message' => '算法服务报错,请稍后重试', 'http_code' => 500, 'description' => ''],
+ ['code' => 'InternalServerError', 'message' => 'A server error occurred while processing your request.', 'http_code' => 500, 'description' => ''],
+ ['code' => 'InvalidAccessKeyId.Inactive', 'message' => 'AccessKeyId非法,请检查AccessKeyId是否被禁用,或者AccessKeyId和AccessKeySecret是否填写正确。', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidAccessKeyId.NotFound', 'message' => 'access key not found', 'http_code' => 404, 'description' => ''],
+ ['code' => 'InvalidAccessKeySecret', 'message' => 'AccessKeyId或AccessKeySecret填写错误,请检查AccessKeyId和AccessKeySecret是否填写正确。', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidAction.NotFound', 'message' => '能力未找到,请检查类目与能力是否匹配,检查访问域名与能力是否匹配,关于访问域名可参考:https://help.aliyun.com/document_detail/143103.htm。SDK接入请参考:https://help.aliyun.com/document_detail/145033.html,选择合适编程语言根据实例代码作相关修改进行接入。', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidApi.ForbiddenInvoke', 'message' => '调用受限,请检查您调用的能力是否为受限能力,受限能力需要在控制台https://vision.console.aliyun.com/找到相应能力申请经过审批之后才能调用。如非上述情况,请检查账号是否欠费', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidApi.NotPurchase', 'message' => 'specified api is not purchase', 'http_code' => 403, 'description' => ''],
+ ['code' => 'InvalidApi.OutOfService', 'message' => '产品未开通,请开通产品:https://common-buy.aliyun.com/?commodityCode=viapi_imageseg_public_cn#/open', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidFile.Content', 'message' => '请参考算法文档检查文件内容,更换包含符合算法要求的', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidFile.Decode', 'message' => 'Failed to decode the image.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidFile.Download', 'message' => '文件无法下载,请检查链接是否可访问和本地网络情况 - 非上海OSS文件链接请参考:https://help.aliyun.com/document_detail/155645.html', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidFile.REGION', 'message' => '文件链接地域不对,非上海OSS文件链接请参考:https://help.aliyun.com/document_detail/155645.html', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidFile.Resolution', 'message' => '文件分辨率超出限制,请检查文件分辨率和内容,修改文件分辨率后重试', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidFile.Type', 'message' => '文件类型错误,请检查文件类型 - 请参考算法API文档,使用算法支持的文件类型', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidFile.Unsafe', 'message' => 'Risky file URL.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidFile.URL', 'message' => '文件无法下载,请检查链接是否可访问和本地网络情况 - 非上海OSS文件链接请参考:https://help.aliyun.com/document_detail/155645.html', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImage.Content', 'message' => 'Invalid content value.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImage.Content', 'message' => 'invalid image content', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImage.Decode', 'message' => '请检查图片是否能够正常打开', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImage.Download', 'message' => 'Failed to download the file.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImage.NotFoundFace', 'message' => '图像中没找到人脸,请检查您的图像中是否包含人脸或人脸太小', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImage.Region', 'message' => 'The URL format of the file is invalid.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImage.Resolution', 'message' => 'The resolution of the image or video is invalid.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImage.Timeout', 'message' => '图片下载超时,请检查链接是否可访问和本地网络情况 - 非上海OSS图片链接请参考:https://help.aliyun.com/document_detail/155645.html。请检查OSS链接是否过期等。', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImage.Type', 'message' => '图片类型错误,请检查图片类型 - 请参考算法API文档,使用算法支持的图片类型', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImage.Unsafe', 'message' => 'Risky file URL.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImage.URL', 'message' => 'The URL format of the file is invalid or URL access has failed.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidImageType', 'message' => 'Invalid image type.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidParameter', 'message' => 'Invalid parameter value.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidParameter.BadRequest', 'message' => '参数错误,请根据算法API文档和报错Message检查参数值。是否参数值前后多了空格或者其他特殊字符等。', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidParameter.Convert', 'message' => 'Invalid convert value.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidParameter.NotFound', 'message' => '参数错误,请根据算法API文档和报错Message检查参数值。是否参数值前后多了空格或者其他特殊字符等。', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidParameter.TooLarge', 'message' => 'The file size exceeds the limit.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidParameter.Transfer', 'message' => 'Invalid transfer value.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidParameter.Unsuitable', 'message' => 'Invalid unsuitable value.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidRamRole', 'message' => '没有Ram权限,请联系主账号给你添加AliyunVIAPIFullAccess权限,操作流程可参考https://help.aliyun.com/document_detail/145025.htm', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidResult', 'message' => '参数错误,请参考文档检查参数值,检查文件内容。请检查是否图片内容不完整或者太模糊等。', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidSide', 'message' => 'Specified parameter Side is not valid. 请参考文档填写正确的Side参数', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidTimeStamp.Expired', 'message' => 'timestamp expired', 'http_code' => 400, 'description' => ''],
+ ['code' => 'InvalidVersion', 'message' => 'Specified parameter Version is not valid', 'http_code' => 400, 'description' => ''],
+ ['code' => 'MissingAccessKeyId', 'message' => 'AccessKeyId未填写,请检查AccessKeyId和AccessKeySecret是否填写正确。', 'http_code' => 400, 'description' => ''],
+ ['code' => 'MissingFileURL', 'message' => 'FileURL is required for this operation.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'MissingImageURL', 'message' => 'ImageURL is required for this operation.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'MissingLimit', 'message' => 'Limit is required for this operation', 'http_code' => 400, 'description' => ''],
+ ['code' => 'MissingParameter', 'message' => 'A required parameter is not specified.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'MissingTasks', 'message' => 'Tasks is required for this operation.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'ParameterError', 'message' => 'The parameter is invalid. Please check again.', 'http_code' => 400, 'description' => 'The parameter is invalid. Please check again.'],
+ ['code' => 'ServiceUnavailable', 'message' => 'The service is unavailable.', 'http_code' => 503, 'description' => 'The service is unavailable. '],
+ ['code' => 'SignatureDoesNotMatch', 'message' => 'signature not match', 'http_code' => 400, 'description' => ''],
+ ['code' => 'SignatureNonceUsed', 'message' => 'signature nonce error', 'http_code' => 400, 'description' => ''],
+ ['code' => 'Throttling', 'message' => 'The request was denied due to QPS limits.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'Throttling.User', 'message' => 'The request was denied due to QPS limits.', 'http_code' => 400, 'description' => ''],
+ ['code' => 'Timeout', 'message' => 'The request has timed out.', 'http_code' => 408, 'description' => 'The request has timed out.'],
+ ['code' => 'Unauthorized', 'message' => 'RAM authentication failed.', 'http_code' => 403, 'description' => ''],
+ ],
+ 'changeSet' => [
+ [
+ 'apis' => [
+ ['description' => 'Request parameters changed', 'api' => 'SegmentCloth'],
],
- 'schemes' => [
- 'http',
- 'https',
+ 'createdAt' => '2024-07-19T02:15:05.000Z',
+ 'description' => '',
+ ],
+ [
+ 'apis' => [
+ ['description' => 'Request parameters changed, Response parameters changed', 'api' => 'SegmentCloth'],
],
- 'security' => [
- [
- 'AK' => [],
+ 'createdAt' => '2023-12-06T02:08:29.000Z',
+ 'description' => '',
+ ],
+ [
+ 'apis' => [
+ ['description' => 'Request parameters changed', 'api' => 'ChangeSky'],
+ ],
+ 'createdAt' => '2022-11-18T05:37:37.000Z',
+ 'description' => '支持本地文件上传',
+ ],
+ [
+ 'apis' => [
+ ['description' => 'Request parameters changed', 'api' => 'SegmentBody'],
+ ],
+ 'createdAt' => '2022-11-01T05:50:12.000Z',
+ 'description' => '设置SegmentBody的入参async为不可见',
+ ],
+ [
+ 'apis' => [
+ ['description' => 'Response parameters changed', 'api' => 'SegmentHDCommonImage'],
+ ],
+ 'createdAt' => '2022-10-17T02:04:15.000Z',
+ 'description' => '修改异步任务Message为可见',
+ ],
+ [
+ 'apis' => [
+ ['description' => 'Request parameters changed', 'api' => 'RefineMask'],
+ ],
+ 'createdAt' => '2022-09-29T08:00:16.000Z',
+ 'description' => '多url参数支持本地文件上传',
+ ],
+ [
+ 'apis' => [
+ ['description' => 'Error codes changed', 'api' => 'GetAsyncJobResult'],
+ ],
+ 'createdAt' => '2022-04-24T08:16:08.000Z',
+ 'description' => '调整GetAsyncJobResult单用户调用频率',
+ ],
+ [
+ 'apis' => [
+ ['description' => 'Error codes changed', 'api' => 'ParseFace'],
+ ],
+ 'createdAt' => '2022-03-30T09:08:48.000Z',
+ 'description' => '调整用户调用频率',
+ ],
+ [
+ 'apis' => [
+ ['description' => 'Error codes changed', 'api' => 'SegmentCloth'],
+ ['description' => 'Error codes changed', 'api' => 'SegmentFace'],
+ ['description' => 'Error codes changed', 'api' => 'SegmentFurniture'],
+ ['description' => 'Error codes changed', 'api' => 'SegmentHair'],
+ ['description' => 'Error codes changed', 'api' => 'SegmentSky'],
+ ['description' => 'Error codes changed', 'api' => 'SegmentVehicle'],
+ ],
+ 'createdAt' => '2022-03-30T09:08:05.000Z',
+ 'description' => '调整单用户调用频率',
+ ],
+ ],
+ 'flowControl' => [
+ 'flowControlList' => [
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentBody'],
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentHDSky'],
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentHair'],
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentSky'],
+ ['threshold' => '500', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentHead'],
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentFood'],
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentHDCommonImage'],
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'RefineMask'],
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentSkin'],
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentCommonImage'],
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'GetAsyncJobResult'],
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'ParseFace'],
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentCommodity'],
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentHDBody'],
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'SegmentCloth'],
+ ['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'ChangeSky'],
+ ],
+ ],
+ 'ram' => [
+ 'productCode' => 'VisualIntelligenceAPI',
+ 'productName' => 'Visual Intelligence API',
+ 'ramCodes' => ['viapi-imageseg', 'viapi-imageaudit', 'viapi-ocr', 'viapi-objectdet', 'viapi-imageenhan', 'viapi-videorecog', 'viapi-imageprocess', 'viapi', 'viapi-ekyc', 'viapi-imgsearch', 'viapi-goodstech', 'viapi-facebody', 'viapi-threedvision', 'viapi-videoenhan', 'viapi-imagerecog', 'viapi-videoseg', 'viapi-regen', 'viapi-aigen'],
+ 'ramLevel' => 'SERVICE',
+ 'ramConditions' => [],
+ 'ramActions' => [
+ [
+ 'apiName' => 'SegmentHDSky',
+ 'description' => '',
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentHDSky',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
],
],
- 'operationType' => 'read',
- 'deprecated' => false,
- 'systemTags' => [
+ [
+ 'apiName' => 'GetAsyncJobResult',
+ 'description' => '',
'operationType' => 'get',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:GetAsyncJobResult',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
],
- 'parameters' => [
- [
- 'name' => 'JobId',
- 'in' => 'formData',
- 'schema' => [
- 'description' => '',
- 'example' => 'E75FE679-0303-4DD1-8252-1143B4FA8A27',
- 'required' => true,
- 'type' => 'string',
+ [
+ 'apiName' => 'SegmentCloth',
+ 'description' => '',
+ 'operationType' => 'none',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentCloth',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
],
],
],
- 'responses' => [
- 200 => [
- 'schema' => [
- 'description' => '1',
- 'properties' => [
- 'RequestId' => [
- 'description' => '',
- 'example' => '43A0AEB6-45F4-4138-8E89-E1A5D63200E3',
- 'type' => 'string',
- ],
- 'Data' => [
- 'description' => '',
- 'properties' => [
- 'Status' => [
- 'description' => '',
- 'example' => 'PROCESS_SUCCESS',
- 'type' => 'string',
- ],
- 'ErrorMessage' => [
- 'description' => '',
- 'example' => 'paramsIllegal',
- 'type' => 'string',
- ],
- 'Result' => [
- 'description' => '',
- 'example' => '{"ImageUrl":"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_/2020-4-2/invi__015858226731531000018_UE7B9p.png?Expires=1585824473&OSSAccessKeyId=LTAI4FoLmvQ9urWXgSR****&Signature=etyeYQQ%2BWAyQTqQKd8Xq0GiOW****"}',
- 'type' => 'string',
- ],
- 'ErrorCode' => [
- 'description' => '',
- 'example' => 'InvalidParameter',
- 'type' => 'string',
- ],
- 'JobId' => [
- 'description' => '',
- 'example' => '49E2CC28-ED1D-4CC5-854D-7D0AE2B20976',
- 'type' => 'string',
- ],
- ],
- 'type' => 'object',
- ],
- ],
- 'type' => 'object',
+ [
+ 'apiName' => 'SegmentHDBody',
+ 'description' => '',
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentHDBody',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'ParseFace',
+ 'description' => '',
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:ParseFace',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'SegmentFood',
+ 'description' => '',
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentFood',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'SegmentHair',
+ 'description' => '',
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentHair',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'ChangeSky',
+ 'description' => '',
+ 'operationType' => 'update',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:ChangeSky',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'SegmentSkin',
+ 'description' => '',
+ 'operationType' => 'none',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentSkin',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'SegmentBody',
+ 'description' => '',
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentBody',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'RefineMask',
+ 'description' => '',
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:RefineMask',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'SegmentHead',
+ 'description' => '',
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentHead',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'SegmentCommonImage',
+ 'description' => '',
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentCommonImage',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'SegmentSky',
+ 'description' => '',
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentSky',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'SegmentCommodity',
+ 'description' => '',
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentCommodity',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
+ ],
+ ],
+ ],
+ [
+ 'apiName' => 'SegmentHDCommonImage',
+ 'description' => '',
+ 'operationType' => '',
+ 'ramAction' => [
+ 'action' => 'viapi-imageseg:SegmentHDCommonImage',
+ 'authLevel' => 'operate',
+ 'actionConditions' => [],
+ 'resources' => [
+ ['validationType' => 'always', 'product' => 'VisualIntelligenceAPI', 'resourceType' => 'All Resource', 'arn' => '*'],
],
],
],
- 'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"43A0AEB6-45F4-4138-8E89-E1A5D63200E3\\",\\n \\"Data\\": {\\n \\"Status\\": \\"PROCESS_SUCCESS\\",\\n \\"ErrorMessage\\": \\"paramsIllegal\\",\\n \\"Result\\": \\"{\\\\\\"ImageUrl\\\\\\":\\\\\\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_/2020-4-2/invi__015858226731531000018_UE7B9p.png?Expires=1585824473&OSSAccessKeyId=LTAI4FoLmvQ9urWXgSR****&Signature=etyeYQQ%2BWAyQTqQKd8Xq0GiOW****\\\\\\"}\\",\\n \\"ErrorCode\\": \\"InvalidParameter\\",\\n \\"JobId\\": \\"49E2CC28-ED1D-4CC5-854D-7D0AE2B20976\\"\\n }\\n}","errorExample":""},{"type":"xml","example":"<GetAsyncJobResultResponse>\\n <RequestId>43A0AEB6-45F4-4138-8E89-E1A5D63200E3</RequestId>\\n <Data>\\n <Status>PROCESS_SUCCESS</Status>\\n <JobId>186AC396-0EEC-46F1-AAA1-BF3585227427</JobId>\\n <Result>{\\"ImageUrl\\":\\"http://viapi-cn-shanghai-dha-segmenter.oss-cn-shanghai.aliyuncs.com/upload/result_/2020-4-2/invi__015858228333801000019_zs0HOi.png?Expires=1585824633&amp;OSSAccessKeyId=LTAI4FoLmvQ9urWXgSR*****&amp;Signature=YHSg24oLm3yk*****%3D\\"}</Result>\\n <status>PROCESS_SUCCESS</status>\\n </Data>\\n</GetAsyncJobResultResponse>","errorExample":""}]',
- 'requestParamsDescription' => ' ',
- 'responseParamsDescription' => ' ',
- ],
- ],
- 'endpoints' => [
- [
- 'regionId' => 'cn-shanghai',
- 'endpoint' => 'imageseg.cn-shanghai.aliyuncs.com',
],
+ 'resourceTypes' => [],
],
];