调用ImagePredict同步图片预测。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String ImagePredict

系统规定参数。取值:ImagePredict

DataUrl String https://xxxxx

预测OSS文件URL

ModelId String c8e2b6418f5

模型ID

返回数据

名称 类型 示例值 描述
ImagePredict

返回结果

Code String OK

响应码

DataUrl String https://ivision-demo.oss-cn-beijing.aliyuncs.com/demo/predict/23.jpg

输入的OSS图片URL

Message String

响应信息

ModelId String c8e2b6418f564576bf2cd9974a48a548

模型ID

PredictId String 50a78d3fe02f433289454dda3c9d28d9

预测ID

PredictResult String {\"objects\":[{\"rect\":{\"top\":144,\"left\":902,\"width\":131,\"height\":317},\"tagId\":\"1\",\"probability\":0.44434074,\"properties\":{\"gloves\":{\"result\":true,\"probability\":0.014203418046236038}}},{\"rect\":{\"top\":207,\"left\":1308,\"width\":90,\"height\":350},\"tagId\":\"1\",\"probability\":0.43234333,\"properties\":{\"gloves\":{\"result\":true,\"probability\":0.5115339159965515}}},{\"rect\":{\"top\":198,\"left\":1212,\"width\":108,\"height\":356},\"tagId\":\"1\",\"probability\":0.4100843,\"properties\":{\"gloves\":{\"result\":false,\"probability\":0.993920087814331}}},{\"rect\":{\"top\":464,\"left\":503,\"width\":367,\"height\":447},\"tagId\":\"1\",\"probability\":0.2605576,\"properties\":{\"gloves\":{\"result\":false,\"probability\":0.9955440163612366}}},{\"rect\":{\"top\":23,\"left\":1320,\"width\":52,\"height\":171},\"tagId\":\"1\",\"probability\":0.18526281,\"properties\":{\"gloves\":{\"result\":true,\"probability\":0.017729753628373146}}}]}

模型类型不同,返回结构不同

PredictTime String 1563267882975

预测发生时间

Status String Success

预测状态

RequestId String D30C1AF9-84F2-42CB-848E-6DA26876E93F

请求ID

示例

请求示例


http(s)://ivision.cn-beijing.aliyuncs.com/?Action=ImagePredict
&DataUrl=https://xxxxx
&ModelId=c8e2b6418f5
&<公共请求参数>

正常返回示例

XML 格式

<ImagePredictResponse>
	  <ImagePredict>
		    <DataUrl>https://ivision-demo.oss-cn-beijing.aliyuncs.com/demo/predict/23.jpg</DataUrl>
		    <ModelId>c8e2b6418f564576bf2cd9974a48a548</ModelId>
		    <PredictId>50a78d3fe02f433289454dda3c9d28d9</PredictId>
		    <PredictResult>{"objects":[{"rect":{"top":144,"left":902,"width":131,"height":317},"tagId":"1","probability":0.44434074,"properties":{"gloves":{"result":true,"probability":0.014203418046236038}}},{"rect":{"top":207,"left":1308,"width":90,"height":350},"tagId":"1","probability":0.43234333,"properties":{"gloves":{"result":true,"probability":0.5115339159965515}}},{"rect":{"top":198,"left":1212,"width":108,"height":356},"tagId":"1","probability":0.4100843,"properties":{"gloves":{"result":false,"probability":0.993920087814331}}},{"rect":{"top":464,"left":503,"width":367,"height":447},"tagId":"1","probability":0.2605576,"properties":{"gloves":{"result":false,"probability":0.9955440163612366}}},{"rect":{"top":23,"left":1320,"width":52,"height":171},"tagId":"1","probability":0.18526281,"properties":{"gloves":{"result":true,"probability":0.017729753628373146}}}]}</PredictResult>
		    <predictTime>1563267882975</predictTime>
		    <status>Success</status>
	  </ImagePredict>
	  <RequestId>D30C1AF9-84F2-42CB-848E-6DA26876E93F</RequestId>
</ImagePredictResponse>

JSON 格式

{
	"ImagePredict":{
		"PredictId":"50a78d3fe02f433289454dda3c9d28d9",
		"DataUrl":"https://ivision-demo.oss-cn-beijing.aliyuncs.com/demo/predict/23.jpg",
		"ModelId":"c8e2b6418f564576bf2cd9974a48a548",
		"status":"Success",
		"predictTime":"1563267882975",
		"PredictResult":"{\"objects\":[{\"rect\":{\"top\":144,\"left\":902,\"width\":131,\"height\":317},\"tagId\":\"1\",\"probability\":0.44434074,\"properties\":{\"gloves\":{\"result\":true,\"probability\":0.014203418046236038}}},{\"rect\":{\"top\":207,\"left\":1308,\"width\":90,\"height\":350},\"tagId\":\"1\",\"probability\":0.43234333,\"properties\":{\"gloves\":{\"result\":true,\"probability\":0.5115339159965515}}},{\"rect\":{\"top\":198,\"left\":1212,\"width\":108,\"height\":356},\"tagId\":\"1\",\"probability\":0.4100843,\"properties\":{\"gloves\":{\"result\":false,\"probability\":0.993920087814331}}},{\"rect\":{\"top\":464,\"left\":503,\"width\":367,\"height\":447},\"tagId\":\"1\",\"probability\":0.2605576,\"properties\":{\"gloves\":{\"result\":false,\"probability\":0.9955440163612366}}},{\"rect\":{\"top\":23,\"left\":1320,\"width\":52,\"height\":171},\"tagId\":\"1\",\"probability\":0.18526281,\"properties\":{\"gloves\":{\"result\":true,\"probability\":0.017729753628373146}}}]}"
	},
	"RequestId":"D30C1AF9-84F2-42CB-848E-6DA26876E93F"
}

错误码

访问错误中心查看更多错误码。