A simple util to make your dataset flexable.
Project description
dataset-utils
A simple util to make your dataset flexable.
Builds
Requirements
- Python >3.6
- pillow 6.1.0
Installation
pip install datasetutils==0.1.0
How to
from PIL.ImageDraw import ImageDraw
from datasetutils.datasets import MixInDataset
from datasetutils.mutations import ResizeMutation
from datasetutils.pasting import LeftCornerPastingRule, RandomPastingRule
dataset = \
MixInDataset(root='dummy-data', mixing='landscapes',to_mix_with='figures') \
.add_mutation_mixing(ResizeMutation((250, 250))) \
.add_mutation_to_mix_with(ResizeMutation((128, 128))) \
.paste_as(RandomPastingRule(250))
for idx, (image, box) in enumerate(dataset.mix(2,2)):
draw = ImageDraw(image)
draw.rectangle([box.minx, box.miny, box.width+box.minx, box.height+box.miny], width=6, outline="red")
image.show('s')
image.save(f'output/{idx}.png', format='png')
will yield to result in the output directory:
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
datasetutils-0.1.1.tar.gz
(3.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file datasetutils-0.1.1.tar.gz.
File metadata
- Download URL: datasetutils-0.1.1.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a765add7dd30b4ebc330b950930fb44753edb518e33cd8d50ce5d29701f230ee
|
|
| MD5 |
f44b516cb7e7e12d422b6b206f1f0c7d
|
|
| BLAKE2b-256 |
98b975aa2b2c5d29282872bda5fbe1f2788df5e27765e5118ca92261a77517d2
|
File details
Details for the file datasetutils-0.1.1-py3-none-any.whl.
File metadata
- Download URL: datasetutils-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c25d73cd67ca6a0273300abb36c9123479fc1d71261ebec4b763a6c777c577c
|
|
| MD5 |
84dda7574f66f85971fade73ff23e286
|
|
| BLAKE2b-256 |
73b421872eaf4e5487dfa62afe3dec6f16a396167389534586bb3590941d4eab
|