Git Product home page Git Product logo

yolov5_in_tf2_keras's Introduction

YOLOv5 in tesnorflow2.x-keras

模型测试

  • 检测效果

()

  • TFLite Android 测试效果:

class [email protected] [email protected]:0.95 precision recall
cat 0.962680 0.672483 0.721003 0.958333
dog 0.934285 0.546893 0.770701 0.923664
total 0.948482 0.609688 0.745852 0.940999

Requirements

pip3 install -r requirements.txt

Get start

  1. 下载数据集
https://www.kaggle.com/datasets/andrewmvd/dog-and-cat-detection/download
或者从releasev1.0下载:
https://github.com/yyccR/yolov5_in_tf2_keras/releases/download/v1.0/JPEGImages.zip

解压数据将images目录修改为JPEGImages, 放到 ./data/cat_dog_face_data下
  1. 训练
python3 train.py
  1. tensorboard
tensorboard --host 0.0.0.0 --logdir ./logs/ --port 8053 --samples_per_plugin=images=40
  1. 查看
http://127.0.0.1:8053
  1. 测试, 修改detect.py里面input_imagemodel_path
python3 detect.py
  1. 评估验证
python3 val.py
  1. 导出TFLite格式
cd ./data
python3 ./h5_to_tfite.py
  1. 导出ONNX格式
cd ./data
python3 ./h5_to_onnx.py

训练自己的数据

  1. labelme打标自己的数据
  2. 打开data/labelme2coco.py脚本, 修改如下地方
input_dir = '这里写labelme打标时保存json标记文件的目录'
output_dir = '这里写要转CoCo格式的目录,建议建一个空目录'
labels = "这里是你打标时所有的类别名, txt文本即可, 每行一个类, 类名无需加引号"
  1. 执行data/labelme2coco.py脚本会在output_dir生成对应的json文件和图片
  2. 修改train.py文件中train_coco_json, val_coco_json, num_class, classes
  3. 开始训练, python3 train.py

yolov5_in_tf2_keras's People

Contributors

yyccr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.