简介
本文档提供关于宠物识别的相关 API 概览以及 SDK 示例代码。
API | 操作描述 |
腾讯云数据万象通过 detect-pet 接口识别并输出画面中宠物,输出其位置(矩形框)和置信度。图片宠物识别请求包属于 GET 请求,请求时需要携带签名。 |
宠物识别
腾讯云数据万象通过 detect-pet 接口识别并输出画面中宠物,输出其位置(矩形框)和置信度。图片宠物识别请求包属于 GET 请求,请求时需要携带签名。
方法原型
func (s *CIService) DetectPet(ctx context.Context, obj string, opt *PetDetectOption) (*PetDetectResult, *Response, error)
请求示例
// 将 examplebucket-1250000000 和 COS_REGION 修改为真实的信息bu, _ := url.Parse("https://examplebucket-1250000000.cos.COS_REGION.myqcloud.com")b := &cos.BaseURL{BucketURL: bu}c := cos.NewClient(b, &http.Client{Transport: &cos.AuthorizationTransport{SecretID: os.Getenv("SECRETID"),SecretKey: os.Getenv("SECRETKEY"),}})obj := "pic/pet.jpeg"opt := &cos.PetDetectOption{}res, _, err := c.CI.DetectPet(context.Background(), obj, opt)log_status(err)fmt.Printf("%+v\\n", res)
参数说明
type PetDetectOption struct {DetectUrl string `url:"detect-url,omitempty"`}
参数名称 | 参数描述 | 类型 | 是否必填 |
DetectUrl | 您可以通过填写 detect-url 处理任意公网可访问的图片链接。不填写 detect-url 时,后台会默认处理 obj ,填写了 detect-url 时,后台会处理 detect-url 链接,无需再填写 obj。 | string | 否 |