gpt4 book ai didi

python - Tensorflow 对象检测 API 中未检测到任何内容

转载 作者:太空狗 更新时间:2023-10-29 18:33:44 25 4
gpt4 key购买 nike

我正在尝试实现 Tensorflow 对象检测 API 示例。我正在关注 sentdex入门视频。示例代码运行完美,它还显示了用于测试结果的图像,但未显示检测到的对象周围的边界。仅显示平面图像,没有任何错误。

我正在使用此代码:This Github link .

这是我运行示例代码后的结果。

enter image description here

另一张没有任何检测的图像。

enter image description here

我在这里缺少什么?代码包含在上面的链接中,没有错误日志。

结果依次为box、score、classes、num。

  [[[ 0.74907303  0.14624023  1.          1.        ]
[ 0. 0. 1. 1. ]
[ 0. 0.20880508 1. 1. ]
[ 0.74907303 0.14624023 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0.74907303 0.14624023 1. 1. ]
[ 0.74907303 0.14624023 1. 1. ]
[ 0.74907303 0.14624023 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0.74907303 0.14624023 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0.74907303 0.14624023 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0.74907303 0.14624023 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0.20934391 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0.20880508 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[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]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]]]
[[ 0.03587547 0.02224986 0.0186467 0.01096812 0.01003207 0.00654409
0.00633549 0.00534311 0.0049596 0.00410213 0.00362371 0.00339186
0.00308251 0.00303347 0.00293389 0.00277099 0.00269575 0.00266825
0.00263925 0.00263331 0.00258657 0.00240822 0.0022581 0.00186967
0.00184311 0.00180467 0.00177475 0.00173655 0.00172811 0.00171935
0.00171891 0.00170288 0.00163755 0.00162967 0.00160273 0.00156545
0.00153615 0.00140941 0.00132407 0.00131524 0.0013105 0.00129431
0.0012582 0.0012553 0.00122365 0.00119186 0.00115651 0.00115186
0.00112369 0.00107097 0.00105805 0.00104338 0.00102719 0.00102337
0.00100349 0.00097762 0.00096851 0.00092741 0.00088506 0.00087696
0.0008734 0.00084826 0.00084135 0.00083513 0.00083398 0.00082068
0.00080583 0.00078979 0.00078059 0.00077476 0.00075448 0.00074426
0.00074421 0.00070195 0.00068741 0.00068138 0.00067262 0.00067125
0.00067033 0.00066035 0.00064729 0.00064205 0.00061964 0.00061794
0.00060835 0.00060465 0.00059548 0.00059479 0.00059461 0.00059436
0.00059426 0.00059411 0.00059406 0.00059392 0.00059365 0.00059351
0.00059191 0.00058798 0.00058682 0.00058148]]
[[ 1. 1. 18. 32. 62. 60. 63. 67. 61. 49. 31. 84. 50. 54.
15. 44. 44. 49. 31. 56. 88. 28. 88. 52. 17. 32. 38. 75.
3. 33. 48. 59. 35. 57. 47. 51. 19. 27. 72. 4. 84. 6.
55. 20. 58. 65. 61. 82. 42. 34. 40. 21. 43. 64. 39. 62.
36. 22. 79. 46. 16. 40. 41. 77. 16. 48. 78. 77. 89. 86.
27. 8. 87. 5. 25. 70. 80. 76. 75. 67. 65. 37. 2. 9.
73. 63. 29. 30. 69. 66. 68. 26. 71. 12. 45. 83. 13. 85.
74. 23.]]
[ 100.]
[[[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0.68494415 1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
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0.68494415 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0.68494415 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0.68494415 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0. 1. 1. ]
[ 0. 0.68494415 1. 1. ]
[ 0. 0.68494415 1. 1. ]]]
[[ 0.01044297 0.0098214 0.00942165 0.00846471 0.00613666 0.00398615
0.00357754 0.0030054 0.00255861 0.00236574 0.00232631 0.00220291
0.00185227 0.0016354 0.0015979 0.00145072 0.00143661 0.00141369
0.00122685 0.00118978 0.00108457 0.00104251 0.00099215 0.00096401
0.0008708 0.00084773 0.00080484 0.00078507 0.00078378 0.00076876
0.00072774 0.00071732 0.00071348 0.00070812 0.00069253 0.0006762
0.00067269 0.00059905 0.00059367 0.000588 0.00056114 0.0005504
0.00051472 0.00051057 0.00050973 0.00048486 0.00047297 0.00046204
0.00044787 0.00043259 0.00042987 0.00042673 0.00041978 0.00040494
0.00040087 0.00039576 0.00039059 0.00037274 0.00036831 0.00036417
0.00036119 0.00034645 0.00034479 0.00034078 0.00033771 0.00033605
0.0003333 0.0003304 0.0003294 0.00032326 0.00031787 0.00031773
0.00031748 0.00031741 0.00031732 0.00031729 0.00031724 0.00031722
0.00031717 0.00031708 0.00031702 0.00031579 0.00030416 0.00030222
0.00029739 0.00029726 0.00028289 0.0002653 0.00026325 0.00024584
0.00024221 0.00024156 0.00023911 0.00023335 0.00021619 0.0002001
0.00019127 0.00018342 0.00017273 0.00015509]]
[[ 38. 1. 1. 16. 25. 38. 64. 24. 49. 56. 20. 3. 28. 2.
48. 19. 21. 62. 50. 6. 8. 7. 67. 18. 35. 53. 39. 55.
15. 57. 72. 52. 10. 5. 42. 43. 76. 22. 82. 4. 61. 23.
17. 16. 87. 62. 51. 60. 36. 58. 59. 33. 31. 54. 70. 11.
40. 79. 31. 9. 41. 77. 80. 34. 90. 89. 73. 13. 84. 32.
63. 29. 30. 69. 66. 68. 26. 71. 12. 45. 83. 14. 44. 78.
85. 46. 47. 19. 65. 74. 37. 27. 63. 88. 28. 81. 86. 75.
27. 18.]]
[ 100.]

编辑:根据建议的答案,当我们使用 faster_rcnn_resnet101_coco_2017_11_08 模型时它正在工作。但它更准确,这就是速度较慢的原因。我想要这个应用程序具有高速,因为我将在实时(在网络摄像头上)对象检测中使用它。所以我需要使用更快的模型(ssd_mobilenet_v1_coco_2017_11_08)

最佳答案

问题出在模型:'ssd_mobilenet_v1_coco_2017_11_08'

解决方法:换个版本'ssd_mobilenet_v1_coco_11_06_2017' (这个型号最快,换其他型号会变慢你想要的东西)

只需更改 1 行代码:

# What model to download.
MODEL_NAME = 'ssd_mobilenet_v1_coco_11_06_2017'

当我使用您的代码时,没有显示任何内容,但是当我将其替换为我之前的实验模型'ssd_mobilenet_v1_coco_11_06_2017'时,它工作正常

关于python - Tensorflow 对象检测 API 中未检测到任何内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47237388/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com