图像搜索 IMAGESEARCH-添加图片:请求示例

时间:2024-07-22 17:30:36

请求示例

  • 方式一:使用图片的BASE64编码
    POST https://{endpoint}/v1/{project_id}/{instance_name}/image
    
    {
      "path" : "/../image.jpg",
      "file" : "/9j/4AAQSkZJRgABAgEASABIAAD/4RFZRXhpZgAATU0AKgAAAAgABwESAAMAAAABAAEAAAEaAAUAAAABAAAAYgEbAAUAAAABAAAA..."
    }
  • 方式二:使用图片的url
    POST https://{endpoint}/v1/{project_id}/{instance_name}/image
    
    {
      "path" : "https://bucketName.obs.myhuaweicloud.com/image/test1.jpg"
    }
  • 方式三:使用图片的BASE64编码和标签
    POST https://{endpoint}/v1/{project_id}/{instance_name}/image
    
    {
      "path" : "https://bucketName.obs.myhuaweicloud.com/image/test1.jpg",
      "file" : "/9j/4AAQSkZJRgABAgEASABIAAD/4RFZRXhpZgAATU0AKgAAAAgABwESAAMAAAABAAEAAAEaAAUAAAABAAAAYgEbAAUAAAABAAAA...",
      "tags" : {
        "test-tags" : "test-image"
      }
    }
  • 方式四:使用图片的url和标签
    POST https://{endpoint}/v1/{project_id}/{instance_name}/image
    
    {
      "path" : "https://bucketName.obs.myhuaweicloud.com/image/test1.jpg",
      "tags" : {
        "test-tags" : "test-image"
      }
    }
support.huaweicloud.com/api-imagesearch/imagesearch_02_0010.html