Coder Social home page Coder Social logo

yolo-dataset-object-cutter's Introduction

YOLO-Dataset-Object-Cutter

YOLO目标检测数据集目标小图裁剪工具

A tool to cut YOLO series dataset's object crop image

使用方法

Usage

python yolo_object_cutter.py --dataset-path ./your_dataset_path --save-path ./saved_dir

or

python yolo_object_cutter.py -src ./your_dataset_path -dst ./saved_dir -w 4

支持多进程并行加速处理,进程数使用--workers(-w)控制

Support multiprocess, by passing --workers(-w)

同时支持Pillow和OpenCV进行裁剪操作(优先Pillow)

Support both Pillow and OpenCV for cropping operations (prioritize Pillow)

适用于对于以此目录结构存储的数据集(yolov5官方的coco128数据集目录结构):

Applicable to datasets stored in this directory structure (YOLOv5 official coco128 dataset directory structure):

image_dataset
    - images
        - no1.jpg
        - no2.jpg
        ...
    - labels
        - no1.txt
        - no2.txt
        ...

使用此程序可以将数据集中每张图片标注的内容对应的小图裁剪下来并保存到目标文件夹 目标文件夹的目录结构为

This program allows you to crop the corresponding small images of each annotated image in the dataset and save them to the target folder The directory structure of the target folder is

dst_dir
    - no1
      - no1_0_x1_y1_x2_y2.jpg
      - no1_1_x1_y1_x2_y2.jpg
      ...
    - no2
      - no2_0_x1_y1_x2_y2.jpg
      ...
      ...

(PS:小图命名规则为{文件名_类别索引_(目标框)左上角x坐标_左上角y坐标_右下角x坐标_右下角y坐标.图像扩展名})

(PS: The naming convention for small images is {file name_category index_(target box)top left corner x-coordinate_top left corner y-coordinate_bottom right corner x-coordinate_bottom right corner y-coordinate.image_extension})

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.