上篇我们写道了,如何利用C#去调用Azure 内容审查服务API,来分析图片的内容,如果你还没有阅读可以先去看一下http://blog.51cto.com/shutong/2349406
通过编写代码的方式我们得到API分析出来的结果,那我们从这些结果中能得到什么信息呢?接下来我们就具体分析一下:
结果分析:
图片1
分析结果:
1. { 2. "ImageUrl": "https://moderatorsampleimages.blob.core.windows.net/samples/sample2.jpg", 3. "ImageModeration": { 4. "CacheID": "bfa532c0-1db9-48de-a82c-976658f3ead1_636855389682874968", 5. "Result": false, 6. "TrackingId": "AE_ibiza_d7f4a439-2eea-483d-89ff-bed92bae1926_ContentModerator.F0_bef26e2e-9f66-42a0-b78a-a7329625bf85", 7. "AdultClassificationScore": 0.021854378283023834, 8. "IsImageAdultClassified": false, 9. "RacyClassificationScore": 0.045791395008563995, 10. "IsImageRacyClassified": false, 11. "AdvancedInfo": [ 12. { 13. "Key": "ImageDownloadTimeInMs", 14. "Value": "1512" 15. }, 16. { 17. "Key": "ImageSizeInBytes", 18. "Value": "273405" 19. } 20. ], 21. "Status": { 22. "Code": 3000, 23. "Description": "OK", 24. "Exception": null 25. } 26. }, 27. "TextDetection": { 28. "Status": { 29. "Code": 3000, 30. "Description": "OK", 31. "Exception": null 32. }, 33. "Metadata": [ 34. { 35. "Key": "ImageDownloadTimeInMs", 36. "Value": "472" 37. }, 38. { 39. "Key": "ImageSizeInBytes", 40. "Value": "273405" 41. } 42. ], 43. "TrackingId": "AE_ibiza_d7f4a439-2eea-483d-89ff-bed92bae1926_ContentModerator.F0_29c6b126-b9b0-45b8-a91b-b17537872905", 44. "CacheId": "b5422d22-60ba-4b0e-9d13-22345a7e0f55_636855389704437977", 45. "Language": "eng", 46. "Text": "IF WE DID \r\nALL \r\nTHE THINGS \r\nWE ARE \r\nCAPABLE \r\nOF DOING, \r\nWE WOULD \r\nLITERALLY \r\nASTOUND \r\nOURSELVE \r\n", 47. "Candidates": [] 48. }, 49. "FaceDetection": { 50. "Status": { 51. "Code": 3000, 52. "Description": "OK", 53. "Exception": null 54. }, 55. "TrackingId": "AE_ibiza_d7f4a439-2eea-483d-89ff-bed92bae1926_ContentModerator.F0_30897ca5-4826-4253-b7c5-8d951895522f", 56. "CacheId": "221a1855-c504-487e-9d45-3b6809851fa1_636855389719124928", 57. "Result": false, 58. "Count": 0, 59. "AdvancedInfo": [ 60. { 61. "Key": "ImageDownloadTimeInMs", 62. "Value": "322" 63. }, 64. { 65. "Key": "ImageSizeInBytes", 66. "Value": "273405" 67. } 68. ], 69. "Faces": [] 70. } 71. },
Content Moderator 检测到这张图片含有文字,它利用光学字符识别 (OCR) 操作可预测图像中是否存在文本内容,并将其提取出来以进行文本审查,以及用于其他用途。 你可以指定语言。 如果未指定语言,则检测默认为英语。
图片2:
分析结果:
1. { 2. "ImageUrl": "https://moderatorsampleimages.blob.core.windows.net/samples/sample5.png", 3. "ImageModeration": { 4. "CacheID": "216621de-bca6-449c-a154-4121adef455d_636855389761935570", 5. "Result": false, 6. "TrackingId": "AE_ibiza_d7f4a439-2eea-483d-89ff-bed92bae1926_ContentModerator.F0_7113e884-fd36-4a7b-a2c2-c97bbbea9a6f", 7. "AdultClassificationScore": 0.0013530384749174118, 8. "IsImageAdultClassified": false, 9. "RacyClassificationScore": 0.0045312256552278996, 10. "IsImageRacyClassified": false, 11. "AdvancedInfo": [ 12. { 13. "Key": "ImageDownloadTimeInMs", 14. "Value": "851" 15. }, 16. { 17. "Key": "ImageSizeInBytes", 18. "Value": "2278902" 19. } 20. ], 21. "Status": { 22. "Code": 3000, 23. "Description": "OK", 24. "Exception": null 25. } 26. }, 27. "TextDetection": { 28. "Status": { 29. "Code": 3000, 30. "Description": "OK", 31. "Exception": null 32. }, 33. "Metadata": [ 34. { 35. "Key": "ImageDownloadTimeInMs", 36. "Value": "404" 37. }, 38. { 39. "Key": "ImageSizeInBytes", 40. "Value": "2278902" 41. } 42. ], 43. "TrackingId": "AE_ibiza_d7f4a439-2eea-483d-89ff-bed92bae1926_ContentModerator.F0_12bffeff-2fc3-4d19-b62b-e519ad9d8952", 44. "CacheId": "fe172aba-1b0b-47d8-9825-97ccb3913632_636855389783347659", 45. "Language": "eng", 46. "Text": "", 47. "Candidates": [] 48. }, 49. "FaceDetection": { 50. "Status": { 51. "Code": 3000, 52. "Description": "OK", 53. "Exception": null 54. }, 55. "TrackingId": "AE_ibiza_d7f4a439-2eea-483d-89ff-bed92bae1926_ContentModerator.F0_648b9a53-b213-4686-8c66-2b15311179c6", 56. "CacheId": "2f015325-3653-487c-a9f5-0df8f953e593_636855389799193925", 57. "Result": true, 58. "Count": 6, 59. "AdvancedInfo": [ 60. { 61. "Key": "ImageDownloadTimeInMs", 62. "Value": "400" 63. }, 64. { 65. "Key": "ImageSizeInBytes", 66. "Value": "2278902" 67. } 68. ], 69. "Faces": [ 70. { 71. "Bottom": 598, 72. "Left": 44, 73. "Right": 268, 74. "Top": 374 75. }, 76. { 77. "Bottom": 620, 78. "Left": 308, 79. "Right": 532, 80. "Top": 396 81. }, 82. { 83. "Bottom": 575, 84. "Left": 594, 85. "Right": 773, 86. "Top": 396 87. }, 88. { 89. "Bottom": 563, 90. "Left": 812, 91. "Right": 955, 92. "Top": 420 93. }, 94. { 95. "Bottom": 611, 96. "Left": 972, 97. "Right": 1151, 98. "Top": 432 99. }, 100. { 101. "Bottom": 510, 102. "Left": 1232, 103. "Right": 1456, 104. "Top": 286 105. } 106. ] 107. } 108. },
该图片我们可以看到是多个人物照,检测人脸有助于检测个人身份信息 (PII),例如图像中的人脸。可以检测每个图像中的潜在人脸和潜在人脸的数量。
响应包括以下信息:
l 人脸计数
l 检测到的人脸的位置列表
图片3
[该图片含有不可描述的成分,这里就不贴出了]
分析结果:
1. { 2. "ImageUrl": "http://pic.pimg.tw/k110107632/1387547248-3785354604.jpg", 3. "ImageModeration": { 4. "CacheID": "bcfeb01b-a272-44c2-99c1-ddb06b986c76_636855389832432013", 5. "Result": true, 6. "TrackingId": "AE_ibiza_d7f4a439-2eea-483d-89ff-bed92bae1926_ContentModerator.F0_61f83a02-dae1-42c8-ab04-c046c87e71cb", 7. "AdultClassificationScore": 0.79699718952178955, 8. "IsImageAdultClassified": true, 9. "RacyClassificationScore": 0.9772266149520874, 10. "IsImageRacyClassified": true, 11. "AdvancedInfo": [ 12. { 13. "Key": "ImageDownloadTimeInMs", 14. "Value": "379" 15. }, 16. { 17. "Key": "ImageSizeInBytes", 18. "Value": "27436" 19. } 20. ], 21. "Status": { 22. "Code": 3000, 23. "Description": "OK", 24. "Exception": null 25. } 26. }, 27. "TextDetection": { 28. "Status": { 29. "Code": 3000, 30. "Description": "OK", 31. "Exception": null 32. }, 33. "Metadata": [ 34. { 35. "Key": "ImageDownloadTimeInMs", 36. "Value": "2" 37. }, 38. { 39. "Key": "ImageSizeInBytes", 40. "Value": "27436" 41. } 42. ], 43. "TrackingId": "AE_ibiza_d7f4a439-2eea-483d-89ff-bed92bae1926_ContentModerator.F0_7f007517-4ae5-4f83-a706-aef9ae7b6937", 44. "CacheId": "b20a0404-4f79-4836-99fc-791e00e696bc_636855389845711870", 45. "Language": "eng", 46. "Text": "", 47. "Candidates": [] 48. }, 49. "FaceDetection": { 50. "Status": { 51. "Code": 3000, 52. "Description": "OK", 53. "Exception": null 54. }, 55. "TrackingId": "AE_ibiza_d7f4a439-2eea-483d-89ff-bed92bae1926_ContentModerator.F0_0831709f-edc0-4efd-8adc-f21f5857c884", 56. "CacheId": "c5e7a1e2-2db7-4edd-9999-f9ba3a3efeef_636855389856806468", 57. "Result": false, 58. "Count": 0, 59. "AdvancedInfo": [ 60. { 61. "Key": "ImageDownloadTimeInMs", 62. "Value": "2" 63. }, 64. { 65. "Key": "ImageSizeInBytes", 66. "Value": "27436" 67. } 68. ], 69. "Faces": [] 70. } 71. }
它会评估成人和猥亵内容,并返回分析结果,评估操作返回 0 到 1 之间的置信度分数。 它还返回等于 true 或 false 的布尔数据。 这些值可预测图像是否包含潜在的成人或猥亵内容。
评语:我们可以使用代码方式或者其他方式提取你需要的信息放在你应用中,这样我们就可以实现智能内容审核服务。而不需要人工去干预。