1 Star 0 Fork 61

陈工 / keras-yolo3

forked from cungudafa / keras-yolo3 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

keras-yolo3

参考博客:

【Yolo3】一文掌握图像标注、训练、识别(Keras+TensorFlow-gpu)

【Keras+TensorFlow+Yolo3】教你如何识别影视剧人手模型

环境

环境:windows10 + anaconda3(conda4.8.2)+ labelImg1.8.1 + VSCode

版本:python3.6.0 + opencv4.1.0 + yolo3 +keras 2.3.1 +tensorflow-gpu2.1.0

环境安装记录:

【GPU】win10 (1050Ti)+anaconda3+python3.6+CUDA10.0+tensorflow-gpu2.1.0

库:numpy1.18.2、Pillow7.0.0、matplotlib 、python-opencv4.2.0

目录

原始目录:docs/tree_old.txt

我重新整合了一下目录结构:docs/tree.txt

运行过程

1.下载

  1. 下载项目框架

    git clone https://gitee.com/cungudafa/keras-yolo3.git
  2. 下载权重

    单独下载yolov3.weights 权重,放在项目根目录下

  3. 将 DarkNet 的.weights文件转换成 Keras 的.h5文件

    python convert.py -w yolov3.cfg yolov3.weights model_data/yolo_weights.h5

    可以查看到我们的模型结构: docs/model_summary.txt

2.标签分类

下载数据集:(我这里用hand进行试验,你可以用你自己的标注数据集

本次使用的数据集来自:牛津大学Arpit Mittal, Andrew Zisserman和 Phil Torr

在这里插入图片描述

资料下载:

我们用到的数据集为VOC格式:我们仅下载evaluation_code.tar.gz(13.8M)即可。

在这里插入图片描述

将下载的数据集复制到项目路径下:(事实是数据集有400+图片,我训练起来太累了,容易过拟合,这里只用了009985-010028共40+张图片进行训练)

在这里插入图片描述

运行script目录下获取标签:

  1. voc标签格式:voc_annotation.py

  2. yolo标签格式:yolo_annotation.py

3.训练

  1. 修改train.py中训练轮速、路径(可选步骤)

  2. 训练 train.py(50轮和100轮,各保存一次)保存在logs目录下

神经网络可视化,在根目录下运行:tensorboard --logdir=logs\

会将运行记录打印到浏览器中 在这里插入图片描述 打开浏览器查看:http://localhost:6006/

可视化查看神经网络loss:

  1. 项目目录下运行:

    tensorboard --logdir=logs\
  2. 浏览器查看:http://localhost:6006/

    在这里插入图片描述

4.测试

参考tf2-keras-yolo3,可以直接对图片和视频进行检测。

我另外封装了一下检测部分的代码:识别部分keras-yolo3-recognize

运行predict.py或者:

# 图片检测
python yolo_video.py --image
再输入图片路径

# 视频检测
python yolo_video.py --input img\test.mp4

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

参考:

  1. https://github.com/qqwweee/keras-yolo3

  2. https://github.com/bubbliiiing/yolo3-keras

  3. https://github.com/AaronJny/tf2-keras-yolo3

MIT License Copyright (c) 2020 cungudafa Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

图像标注、训练、识别(Keras2.3.1+TensorFlow-gpu2.1.0 + cuda10.0) 展开 收起
Python
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/cfx666/keras-yolo3.git
git@gitee.com:cfx666/keras-yolo3.git
cfx666
keras-yolo3
keras-yolo3
master

搜索帮助

14c37bed 8189591 565d56ea 8189591