Giter VIP home page Giter VIP logo

datasettool's Introduction

Dataset Tools

从零创建自己的数据集并用于目标检测

1. 数据准备

1.1 准备文件

├── VOCdevkit
|   └── VOC2020
|   	├── JPEGImages
|   	└── Annotations

首先创建如上所示的目录结构,并将所有图片放到 JPEGImages 中。

1.2 标注数据

下载 labelImg 标注软件,对图片进行标注,并将标注的文件保存到 Annotations目录中。

1.3 格式化文件

该过程会去除为标记的图片,并将文件以连续的整数进行命名。

python src/format_dataset.py <path/VOC2020>

2. 创建 VOC 格式数据集

python src/create_voc.py <path/VOC2020> -t 0.6 -v 0.2

指定数据集的根目录 VOC2020,并指定训练集和测试集的比例,即可生成 VOC 格式数据集。默认的划分比例为0.7:0.15:0.15

3. 转换

3.1 用于 darknet 训练

修改 voc_to_yolo.py 中的 sets, classes 及最后两行和自己的数据集对应,

进入 VOCdevkit 所在目录,然后运行下边命令,即可将标注转为为 Yolo 所需格式,同时生成 train.txttest.txt

python voc_to_yolo.py <path/vocdevkit>

根据数据集生成 Anchor

Anchor 对模型的影响比较大,Anchor 先验不合理会导致更多的失配。 根据对数据集的 bbox 聚类,获取新的 anchor 的大小和比例。

python src/gen_anchor.py <xml/root/path> -c cluster_num -d input_size

datasettool's People

Contributors

graysnail avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

haobabuhaoba

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.