Skip to content

plakakia

Find small objects in big images. Cut them into model-sized tiles, bring the labels along, and put the detections back.
πλακάκια, Greek for "tiles"

Get started in 5 minutes Detect small objects See how tiling works

Big image in, model-ready tiles out

Object detectors and segmentation models expect small inputs, often 640 × 640 pixels. Aerial photos, satellite scenes, microscopy slides and factory inspection images are much bigger. plakakia slides a window over the image, cuts it into tiles, and moves every bounding box or mask into the tile it belongs to.

A large aerial image with an overlapping grid of tiles drawn on top

One 2400 × 1500 aerial image with 194 labelled cars, cut into 15 overlapping 640 × 640 tiles (step_size=480, cover_edges=True).
➜

tile tile tile tile tile tile

Tiles at full resolution, each with its own label file. Boxes are shifted into tile coordinates and clipped at the border.

Made for small objects

Insects on a sticky trap, cells under a microscope, cars seen from space: small objects are the hardest thing for a detector, and resizing makes them harder. Shrinking a 2400-pixel image to a 640-pixel model input makes it 3.75 times smaller. A car that was 14 pixels wide becomes 4 pixels wide, and there is little left for a model to learn from. Tiling keeps every pixel.

A parking lot, blurry after resizing the whole image

❌ Resized to 640 px: the cars are a few pixels each.

The same parking lot, sharp, from a tile

✅ Tiled at native resolution: every detail is kept.

Train on tiles, predict on tiles, and merge the detections back onto the full image, with any model. The small object detection guide

Three lines of Python

import cv2
from plakakia import tile_image

image = cv2.imread("aerial.jpg")  # (1500, 2400, 3)
tiles, coords = tile_image(image, tile_size=640, step_size=480, cover_edges=True)
tiles.shape  # (15, 640, 640, 3): a batch, ready for your model
coords[0]  # [0, 0, 640, 640]: (x1, y1, x2, y2) of tile 0 in the image

Or tile a whole labelled dataset, on every CPU core, with one command:

plakakia --config config.yaml

What you get

  • Labels come along


    Bounding boxes in YOLO, Pascal VOC or COCO, and segmentation masks, are cut with the image. Choose how much of an object must be visible to keep it.

    Boxes and tiles

  • Fast and small


    Vectorised NumPy with no Python loop over tiles, and a multiprocess pipeline. Only four dependencies: numpy, opencv-python-headless, pyyaml, tqdm.

    Offline tiling

  • Any image, any axes


    Grayscale, RGB(A), 16-bit, multispectral and hyperspectral cubes, channels-first or last. Tile along the spatial axes, the spectral axis, or both.

    Hyperspectral data

  • Maps stay maps


    Satellite and drone GeoTIFF tiles keep their coordinate system, so they open in QGIS exactly where they belong. Mostly empty tiles can be skipped.

    Geospatial data

  • See it before you run it


    Drag a slider and watch the grid change in the browser, or upload your own image to the Streamlit demo.

    Tiling playground

  • Typed and tested


    Fully type-annotated (py.typed, strict mypy) and tested on Linux, macOS and Windows, Python 3.10 to 3.13.

    API reference

Where it helps

Field Typical image What plakakia does
Insect monitoring Sticky traps and camera traps, insects of a few pixels Native-resolution tiles for training and inference
Drones and aerial survey 6000 × 4000 photos, tiny objects Tiles plus YOLO labels for detector training
Satellite imagery Multi-band GeoTIFF scenes Georeferenced tiles, nodata filtering
Microscopy and pathology Gigapixel slides, tiny cells Memory-mapped tiling, box and mask tiles
Industrial inspection High-resolution line-scan images Overlapping tiles so no defect is cut in half
Hyperspectral imaging (H, W, 224 bands) cubes Spatial and spectral windows

New to tiling? Start with How tiling works: it explains every idea with a picture and lets you play with the settings.