Giter Site home page Giter Site logo

division-of-data's Introduction

人工智能数据集划分脚本

你好,欢迎使用本脚本。本脚本食用方法十分简单,原理是提取目录中的文件名称,随机打乱,放到对应的数组中,后续再对数组中的内容进行对比,提取存在标签的图片,最后将图片和标签划分到训练集、验证集、测试集。

怎么使用?

不想修改?

默认情况下,我提供了一个自动选择根路径的函数,如果你不做任何修改,可以直接按要求选择未划分的数据集即可。

各个集的划分情况如下:

训练集:70%

验证集:20%

测试集:10%

我很勤快?

如果不能满足你的需求,那么请按要求修改:

1、修改数据划分比例

查看脚本第86行,修改数组中的两个元素即可,第一个对应训练集,第二个对应验证集,测试集会自动计算剩余空间。

PERCENTAGE = [0.7, 0.2]

2、修改路径

如果可视化选择工具无法满足需求,那么您的路径可能需要更改,更改路径请查看脚本第78行~80行,将脚本第78行注释,修改第80行代码。

# tk.Tk().withdraw()
# 打开资源管理器对话框选择根路径
PATH = r"D:\Projects\Python\yolov5-6.1\traffic_light_data"

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.