全部产品
云市场

FindImages 搜索图片

更新时间:2019-10-09 16:42:46

描述

根据指定条件,如时间、地点、标签、人物特征等,搜索媒体集 Set 内图片。并按给定要求进行排序。

搜索结果依赖索引的建立,返回结果与实际值可能有数秒的数据延迟。

请求参数

Parameter Type Required Comment
Project string Y Project 名称。
SetId string Y 媒体集 Set 的唯一标识。
TagNames JSON string N 标签列表,给出多个时,只有同时包含其中所有标签的图片会被返回,格式:
["猫","动物"]
ImageSizeRange JSON string N 图片大小范围,格式:
{"MinWidth":100,"MaxWidth":3000,"MinHeight":50,"MaxHeight":5000}
ImageTimeRange JSON string N 照片时间范围,该时间由 EXIF 信息获得,格式:
{"Start":"1970-01-01T00:00:01.544Z","End":"2199-01-01T00:00:01.544Z"}
CreateTimeRange JSON string N 图片加入 set 的时间范围,格式:
{"Start":"1970-01-01T00:00:01.544Z","End":"2199-01-01T00:00:01.544Z"}
ModifyTimeRange JSON string N 图片更新的时间范围,格式:
{"Start":"1970-01-01T00:00:01.544Z","End":"2199-01-01T00:00:01.544Z"}
FacesModifyTimeRange JSON string N 人脸信息更新的时间范围,格式:
{"Start":"1970-01-01T00:00:01.544Z","End":"2199-01-01T00:00:01.544Z"}
TagsModifyTimeRange JSON string N 标签信息更新的时间范围,格式:
{"Start":"1970-01-01T00:00:01.544Z","End":"2199-01-01T00:00:01.544Z"}
SourceType string N 来源类型
SourceUriPrefix string N 来源 Uri 的前缀
Gender string N 性别,可选值为: MALE / FEMALE
GroupId string N 人脸分组 ID。参考人脸聚类功能
AgeRange JSON string N 年龄范围,格式:
{"Start":0,"End":99}
LocationBoundary JSON string N 地理位置范围,格式:
{"TopLeft":"50.2,100.1","BottomRight":"30.5,120.1"}
提供左上和右下两个顶点,格式为 lat,long ,以逗号分隔的浮点数。注意 Top 需要大于 Bottom , Left 需要小于 Right 。
Emotion string N 表情,可选值为: HAPPY / SAD / ANGRY / SURPRISED / SCARED / DISGUSTED / CALM
RemarksAPrefix string N Remarks 标记信息,前缀匹配
RemarksBPrefix string N Remarks 标记信息,前缀匹配
RemarksCPrefix string N Remarks 标记信息,前缀匹配
RemarksDPrefix string N Remarks 标记信息,前缀匹配
ExternalId string N 外部 ID,用于和您的应用层的 ID (如果有)进行绑定
OCRContentsMatch string N OCR 识别的内容检索
AddressLineContentsMatch string N 地址搜索,仅对有地理信息标记的媒体文件(即 Location 有值)有效
OrderBy string N 排序字段,可选值为: CreateTime / ModifyTime / ImageTime / RemarksA / RemarksB / RemarksC / RemarksD
Order string N 排序方式,升序/降序分别为:ASC / DESC
Marker string N Marker 翻页标记
Limit int N 返回结果的最大数量,1~100,默认20

返回参数

Parameter Type Comment
RequestId string 该次请求的唯一识别码。
SetId string 媒体集 Set 的唯一标识。
Images []Image 搜索到的图片详细信息数组。
NextMarker string Marker 翻页标记

示例

请求示例

  1. POST https://imm.cn-shanghai.aliyuncs.com
  2. ?Action=FindImages
  3. &Project=test-project
  4. &SetId=test-set
  5. &Gender=MALE
  6. ...

此处的示例,目的是展示关键参数,还需要其他的公共参数才能正常调用,推荐使用 SDK 来发送 API

成功返回示例

  1. {
  2. "RequestId": "45E6DF1A-8BA9-4625-92E5-7CC3720AE6AA",
  3. "Images": [
  4. {
  5. "FacesModifyTime": "2018-12-10T13:21:04Z",
  6. "RemarksA": "",
  7. "RemarksB": "",
  8. "RemarksC": "",
  9. "RemarksD": "",
  10. "ExternalId": "",
  11. "Faces": [
  12. {
  13. "Age": 29,
  14. "GenderConfidence": 0.9999929666519165,
  15. "Attractive": 0.82,
  16. "EmotionDetails": {
  17. "SAD": 0.042305514216423035,
  18. "CALM": 0.01735937036573887,
  19. "ANGRY": 0.0006993188872002065,
  20. "HAPPY": 0.9367565512657166,
  21. "SCARED": 0.00042747409315779805,
  22. "DISGUSTED": 0.000687692838255316,
  23. "SURPRISED": 0.00029603135772049427
  24. },
  25. "Gender": "MALE",
  26. "FaceConfidence": 0.9912033081054688,
  27. "Emotion": "HAPPY",
  28. "FaceId": "784a46dd2c7c178bbe9263eadad975465e87f28b1ae466d053a367168d13944d",
  29. "FaceAttributes": {
  30. "GlassesConfidence": 0.9999994039535522,
  31. "Glasses": "SUNGLASSES",
  32. "RaceConfidence": 0.9999105334281921,
  33. "Beard": "BEARD",
  34. "MaskConfidence": 1,
  35. "Race": "WHITE",
  36. "BeardConfidence": 0.9999915957450867,
  37. "FaceBoundary": {
  38. "Top": 58,
  39. "Height": 232,
  40. "Width": 233,
  41. "Left": 369
  42. },
  43. "Mask": "NONE"
  44. }
  45. },
  46. {
  47. "Age": 26,
  48. "GenderConfidence": 0.9999945759773254,
  49. "Attractive": 0.84,
  50. "EmotionDetails": {
  51. "SAD": 4.52852269572368e-11,
  52. "CALM": 0.0000013925485973231844,
  53. "ANGRY": 7.444113034327238e-12,
  54. "HAPPY": 0.9999986290931702,
  55. "SCARED": 3.7784754491898553e-11,
  56. "DISGUSTED": 4.140164600041629e-11,
  57. "SURPRISED": 1.5267035413657482e-9
  58. },
  59. "Gender": "FEMALE",
  60. "FaceConfidence": 0.9771245121955872,
  61. "Emotion": "HAPPY",
  62. "FaceId": "1a620304298194be4ce3257f04bd0c6deffb06606d69160beb20b1f140985085",
  63. "FaceAttributes": {
  64. "GlassesConfidence": 1,
  65. "Glasses": "SUNGLASSES",
  66. "RaceConfidence": 0.9999966025352478,
  67. "Beard": "NONE",
  68. "MaskConfidence": 1,
  69. "Race": "WHITE",
  70. "BeardConfidence": 1,
  71. "FaceBoundary": {
  72. "Top": 182,
  73. "Height": 166,
  74. "Width": 167,
  75. "Left": 159
  76. },
  77. "Mask": "NONE"
  78. }
  79. }
  80. ],
  81. "SourcePosition": "",
  82. "Exif": "{\n \"FileSize\": {\"value\": \"63362\"},\n \"Format\": {\"value\": \"jpg\"},\n \"ImageHeight\": {\"value\": \"480\"},\n \"ImageWidth\": {\"value\": \"640\"},\n \"ResolutionUnit\": {\"value\": \"2\"},\n \"XResolution\": {\"value\": \"72/1\"},\n \"YResolution\": {\"value\": \"72/1\"}}",
  83. "ImageUri": "oss://imm-test/testcases/test.jpg",
  84. "ImageWidth": 640,
  85. "ImageFormat": "jpg",
  86. "SourceType": "image",
  87. "ModifyTime": "2018-12-10T13:21:02Z",
  88. "FileSize": 63362,
  89. "Tags": [
  90. {
  91. "TagConfidence": 0.6040770411491394,
  92. "TagLevel": 1,
  93. "TagName": "动物"
  94. },
  95. {
  96. "TagConfidence": 0.6040770411491394,
  97. "TagLevel": 2,
  98. "ParentTagName": "动物",
  99. "TagName": "宠物"
  100. },
  101. {
  102. "TagConfidence": 0.6040770411491394,
  103. "TagLevel": 3,
  104. "ParentTagName": "宠物",
  105. "TagName": "猫"
  106. },
  107. {
  108. "TagConfidence": 0.6040770411491394,
  109. "TagLevel": 4,
  110. "ParentTagName": "猫",
  111. "TagName": "狸花猫"
  112. }
  113. ],
  114. "SourceUri": "oss://imm-test/testcases/test.jpg",
  115. "CreateTime": "2018-12-10T13:21:02Z",
  116. "RequestId": "072C5C98-1284-46C6-80FB-0DD5B4C5EA87",
  117. "FacesStatus": "Success",
  118. "TagsStatus": "Success",
  119. "FacesFailReason": "",
  120. "TagsFailReason": "",
  121. "SetId": "test-set",
  122. "ImageHeight": 480
  123. }
  124. ],
  125. "SetId": "Set-b247df7d-1072-4c56-85eb-b9f4813a0e44",
  126. "NextMarker": ""
  127. }

若在使用中有疑问,请参考 FAQ,或者进入 钉钉用户群 实时交流。