参数名 | 类型 | 是否必填 | 说明 |
---|---|---|---|
file | file | ✅ 是(若未提供base64_str则必填) | 待处理的输入图像文件(需以文件形式提供,如.jpg、.png格式)。 |
base64_str (≤ 1MB) | string | ✅ 是(若未提供file则必填) | 图像文件的Base64编码字符串(在请求中直接发送图像数据时使用)。 |
source | string | ✅ 是 | 输入图像中文字的语言(例如:"中文"、"英语"、"西班牙语")。 |
target | string | ✅ 是 | 图像中文字需翻译到的目标语言(例如:"阿拉伯语"、"德语"、"法语")。 |
return_info | int | ✅ 是 | 定义需返回的信息类型:0:返回翻译后的图像及结构化信息1:仅返回翻译后的图像2:仅返回翻译后的结构化信息 |
阿拉伯语
、孟加拉语
、捷克语
、德语
、英语
、西班牙语
、波斯语
、法语
、希伯来语
、印地语
、印度尼西亚语
、意大利语
、日语
、高棉语
、韩语
、老挝语
、马来语
、缅甸语
、荷兰语
、波兰语
、葡萄牙语
、俄语
、泰语
、他加禄语
、土耳其语
、乌尔都语
、越南语
、中文
{
"code": 200, // 状态码(200表示成功)
"image": "data:image/webp;base64,...", // 翻译后图像的Base64编码
"text_info": {
"texts": [ // 图像中的原文文本列表
"关于物流",
"快准优是我们合作物流的准则",
"物流服务打造品牌服务",
"默认发申通快递,如有快递送不到的,请联系客服补运费补差价。",
"售后保障购物零风险",
"所有产品都是100%检验合格出,如万遇到破损或其它问题,请放第时间联系我们。",
"送运费险无忧退货",
"送",
"本店免费为客户投保,订单运费险服务,如发生退货,按照交易规则流程理赔。"
],
"translations": [ // 对应的翻译后文本列表
"About Logistics",
"Fast, accurate and efficient is the principle of our logistics cooperation.",
"Building a brand of logistics services",
"Default is SF Express, If the courier can’t deliver it, Please contact customer service to make up the difference in shipping fee.",
"Zero risk of shopping after-sales protection",
"All products are 100% inspected and qualified, If the product is damaged or has other problems, Please contact us in time.",
"Free shipping and worry-free return",
"Send",
"Our store will provide free insurance for customers, Order shipping insurance service, If there is a return, Follow the process of claim settlement according to the rules of the transaction."
],
"texts_rgb_colors": [ // 文本的RGB颜色信息(共9项,与文本数量对应)
"Array(9)"
],
"bbox_coordinates": [ // 文本的边界框坐标(共9项,与文本数量对应)
"Array(9)"
],
"fontsizes": [ // 文本的字体大小(共9项,与文本数量对应)
"Array(9)"
],
"background": "data:image/webp;base64,..." // 背景图的Base64编码
},
"response_time": 3.891 // 响应时间(单位:秒)
}
HTTP状态码 | JSON中的code字段 | 说明 |
---|---|---|
422 | 422 | 输入参数无效 |
429 | 429 | 请求次数过多或超时 |
500 | 500 | 服务器内部错误 |
{
"code": <错误码>, // 对应上表中的错误码
"msg": "<错误简要说明>" // 错误原因的简要描述
}
示例:
{
"code": 429,
"msg": "请求次数过多。"
}
如遇问题或需要支持,请通过联系页面与我们的团队取得联系。
我们还为企业客户提供专用服务器部署服务——提供包含完整API功能的私有独立环境,且无请求限制。
定价基于部署的服务器数量,每台服务器均以最大吞吐量运行。腾讯可内网互联网api
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。