Code Monkey home page Code Monkey logo

dbnet's Introduction

差分二值化(DB)文本检测代码使用说明

本文代码主要来自

环境要求

  • pytorch 1.4+
  • torchvision 0.5+
  • gcc 4.9+

使用说明

下载步骤

依次执行以下命令

  1. mkdir DB
  2. cd DB/
  3. git init
  4. git clone https://github.com/WenmuZhou/DBNet.pytorch.git

数据准备工作

将训练的图片导入./DBNet.pytorch/datasets/train/img 中 将训练的图片数据导入./DBNet.pytorch/datasets/train/gt 中 将测试的图片导入./DBNet.pytorch/datasets/test/img 中 将测试的图片数据导入./DBNet.pytorch/datasets/test/gt

- 图片要求用`.jpg`格式
- 图片数据要求用`.txt`格式,其内部格式要求如下:
`x1, y1, x2, y2, x3, y3, x4, y4, 文字内容`

设置train.txt数据

打开my_standard output.py文件,按照注释更改路径 用命令窗口运行 . my_standard output.py 生成名为 train.txt的文件,再将其移动到 dataset

设置test.txt数据

打开my_standard output.py文件,按照注释更改路径 用命令窗口运行 . my_standard output.py 生成名为 test.txt的文件,再将其移动到 dataset

训练

  1. 在配置文件config/icdar2015_resnet18_fpn_DBhead_polyLR.yaml中对以下两个路径进行设置

    1. dataset['train']['dataset'['data_path']'----上一步train.txt的路径
    2. dataset['validate']['dataset'['data_path']--------上一步test.txt的路径
  2. 在DBNet.pytorch文件夹下用命令窗口执行 bash singlel_gpu_train.sh

  • 生成的model在 /DBNet.pytorch/output/DBNet_resnet18_FPN_DBHead/checkpoint/

测试

  1. 在[eval.sh]最后的''中输入model的路径(有两个,选一个就行)
  2. 在DBNet.pytorch文件夹下用命令窗口执行 bash eval.sh

If this repository helps you,please star it. Thanks.

dbnet's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

液压姬 avatar

Forkers

zzwei1

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.