参照:
https://blog.csdn.net/weixin_43472830/article/details/88181516#commentsedit
基本思想:将图片传入到YOLO网络中进行识别,解析返回的信息,进行画框,写文字。
返回信息的格式:[{‘label’: ‘dog’, ‘confidence’: 0.87201697, ‘topleft’: {‘x’: 282, ‘y’: 152}, ‘bottomright’: {‘x’: 555, ‘y’: 509}}]
先看代码:
在这个程序中需要用到opencv和matplotlib以及Tensorflow,因此需要在Tensorflow环境下安装opencv和matplotlib,同样的道理,打开anaconda navigator后选择not installed,搜索matplotlib,即可进行安装
将需要识别的图片放到darkflow-master文件夹下,在anaconda prompt中运行:
最糙心的就是每次运行提示我计算机CPU计算能力不行,简直是头大…
识别结果: