A simple util to make your dataset flexable.
Project description
dataset-utils
A simple util to make your dataset flexable.
Requirements
- Python >3.6
- pillow 6.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.0.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for datasetutils-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b8af8474350317af48e0156cf6262fc45967a135fd04aa240938b05f7950821 |
|
MD5 | b796cf5518a43b449f5a103abcdf52dd |
|
BLAKE2b-256 | 4942ac4970955d9cada6c07eb18923c345213cc17bff698b6fea308a69f5e9af |