Tool to create,modify YOLO dataset and much more...
Project description
yolo-splitter
Tool to create YOLO dataset
Installation
pip install yolosplitter
Uses
from yolosplitter import YoloSplitter
ys = YoloSplitter(imgFormat=['.jpg', '.jpeg', '.png'], labelFormat=['.txt'] )
# use this function if Image & Labels are in the same folder
df = ys.from_mixed_dir(input_dir="mydataset")
# If folder contains train test valid set already (yolo dataset)
df = ys.from_yolo_dir("mydataset")
# saves the Images and labels in "new_dataset" dir. with data.yaml file.
# change save=True if you want to create new dataset
ys.split_and_save(DF=df,output_dir="new_datset", ratio=(0.7, 0.2,0.1 ) ,save=False,shuffle=False)
# YOLO directory contaning (train,valid,test)
df = ys.from_yolo_dir("pot_holes")
df
# Dataframe contains Image names, Label names, annoations and class names.
# In the dataframe, we can observe the number of classes present in each image.
Input Directory
MyDataset/
├── 02.png
├── 02.txt
├── 03.png
├── 03.txt
├── 04.png
├── 04.txt
├── 05.png
├── 05.txt
├── 06.png
├── 06.txt
├── 07.png
├── 07.txt
├── 08.png
├── 08.txt
├── 09.png
├── 09.txt
├── 10.png
├── 10.txt
├── 11.png
└── 11.txt
Output Directory
MyDataset-splitted/
├── data.yaml
├── train
│ ├── images
│ │ ├── 03.png
│ │ ├── 04.png
│ │ ├── 05.png
│ │ ├── 07.png
│ │ ├── 08.png
│ │ ├── 09.png
│ │ └── 10.png
│ └── labels
│ ├── 03.txt
│ ├── 04.txt
│ ├── 05.txt
│ ├── 07.txt
│ ├── 08.txt
│ ├── 09.txt
│ └── 10.txt
└── val
├── images
│ ├── 02.png
│ ├── 06.png
│ └── 11.png
└── labels
├── 02.txt
├── 06.txt
└── 11.txt
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
yolosplitter-0.3.1.tar.gz
(4.4 kB
view hashes)
Built Distribution
Close
Hashes for yolosplitter-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd31b8aae16cb5dfd8c1e3c44cec0dde3161144e565a68b42309f959f8e473ba |
|
MD5 | e060a9bb3592ef2ececf1e8aa3a3c5de |
|
BLAKE2b-256 | 7d262f1f22fafbe967c8bfc71d03c00b5a3ac8f28e7d117a856211e41e4c5769 |