Skip to main content

A simple util to make your dataset flexable.

Project description


A simple util to make your dataset flexable.


Build Status


  • Python >3.6
  • pillow 6.1.0


PyPI version

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))) \

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")'s')'output/{idx}.png', format='png')

will yield to result in the output directory:

output.png output.png output.png

Project details

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 hashes)

Uploaded source

Built Distribution

datasetutils-0.1.1-py3-none-any.whl (5.2 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page