Skip to content

Changelog

All notable changes to this project are documented here. The format follows Keep a Changelog and the project uses Semantic Versioning.

[Unreleased]

Added

  • predict_tiled(image, model, tile_size): tiled inference in one call for small object detection. It runs any callable model on batches of tiles (NumPy, PyTorch or CuPy, kept on their device), moves boxes to image coordinates, merges duplicates with class-aware NMS and fuses boxes cut by tile borders. Optional full-image pass for large objects.
  • Detections, with to_geojson() and map_polygons(): pass a GeoTIFF's profile to predict_tiled to get detections in map coordinates.
  • tile_batches (batches of tiles with their coordinates, for any array type) and merge_detections (NMS plus seam fusion for boxes you already have).
  • GPU tiling: tile_image, tile_array and iter_tiles accept PyTorch tensors and CuPy arrays and return tiles on the same device (CUDA, MPS or CPU). Tiles are gathered from a zero-copy sliding-window view in one device operation; coordinates stay NumPy.
  • plakakia.nms: class-aware non-maximum suppression that runs on the GPU through torchvision.ops.batched_nms for PyTorch tensors, with a NumPy fallback.
  • plakakia.to_numpy and plakakia.backend helpers (array_namespace, is_device_array).
  • plakakia.onnx.OnnxModel: run an ONNX model on batches of tiles on GPUs and NPUs. providers="auto" picks the fastest ONNX Runtime execution provider available (TensorRT, CUDA, ROCm, CoreML, DirectML, OpenVINO, QNN, Vitis AI, CANN, then CPU). New onnx extra.
  • benchmarks/bench_device.py compares NumPy and PyTorch tiling and NMS on every device.

Changed

  • Redesigned the Streamlit demo (demo/app.py) as the plakakia playground: built-in sample drone photo (with labelled boxes) and hyperspectral cube, overlap in percent, a tile inspector, box visibility, band splitting, mean spectra, a tile gallery, a ZIP download (tiles, YOLO labels, positions) and copy-paste Python / CLI code for the current settings. Uploads accept images, .npy, HDF5 and multi-band TIFF.
  • The demo extra now pulls in h5py and tifffile and needs Streamlit 1.50+.

Documentation

  • New GPU & NPU acceleration guide and a Devices & ONNX API page.
  • New Small object detection guide (train on tiles, predict on tiles, merge the detections with NMS, map them to geographic coordinates) and a small-objects focus on the landing page.
  • New visual, beginner-friendly docs: a landing page with a before/after example and a "why tile?" comparison, a rewritten How tiling works guide with a diagram for every concept, an interactive tiling playground, a step-by-step getting-started page and a glossary.
  • All figures are generated by scripts/make_doc_figures.py with plakakia itself, and the diagrams follow the light/dark theme.
  • New animated README hero (docs/assets/figures/hero.gif, also on the Small object detection page): tiny cars smudged by resizing, then tile → detect → merge with predict_tiled. Generated by scripts/make_hero.py with plakakia and a stand-in OpenCV detector, so it needs no model weights.

[1.0.0] - 2026-11-11

The first release since 0.2.1, and the first with a stable, typed public API. It ships everything from the unpublished 0.3.0 modernisation below plus hyperspectral, multispectral and geospatial (satellite / drone) support.

Upgrading from 0.2.x: YAML configs and output file names keep working, but the Python API is new (for example Settings became TilingConfig and the plakakia.utils_tiling imports moved to the top-level plakakia package). See the 0.3.0 notes below and the docs.

Added

  • tile_array: tile N-D arrays along any axes, with a tile size and stride per axis (e.g. spatial and spectral windows of a hyperspectral cube). Non-tiled axes are kept in place.
  • iter_tiles: zero-copy, lazy tiling for larger-than-memory (memory-mapped) data.
  • tile_grid, window_slices, normalize_axes helpers.
  • tile_image and tile_coordinates accept rectangular tiles ((height, width)) and tile_image takes axes= for channels-first data.
  • read_array / write_array: .npy (memory-mapped), HDF5 (hdf5_dataset selects the dataset, files are always closed) and multi-band TIFF.
  • GeoTIFF support (plakakia[geo]): read_geotiff, write_geotiff, GeoProfile. With georeference: true every tile keeps the CRS, nodata and its own affine transform.
  • Pipeline options: axes, per-axis tile_size/step_size, bands/band_axis, nodata, max_nodata_fraction (vectorised summed-area table), hdf5_dataset, mask_extension.
  • Optional extras hyperspectral (h5py, tifffile) and geo (rasterio).
  • Docs page on hyperspectral and geospatial data, plus example configs.

Changed

  • pad_image takes axes=.
  • Segmentation masks keep their format (png, npy, tif...) instead of always PNG; JPEG masks are still written as PNG.

[0.3.0] - not published

A ground-up modernisation of the code base. The YAML config keys and the output file naming are backwards compatible; the Python API is new.

Added

  • cover_edges option: border-aligned tiles so no pixels are dropped.
  • min_visibility option: keep partially visible boxes (clipped to the tile).
  • save_empty_tiles option to also export background tiles.
  • input_format_annotations: none to tile image folders without labels.
  • YOLO segmentation polygons are accepted as input (converted to boxes).
  • Pascal VOC output writes class names (from annotation_mapping) instead of ids.
  • plakakia CLI (make_tiles kept as an alias), python -m plakakia, --num-workers, --quiet, --verbose and --version flags.
  • Public, typed API (py.typed): tile_coordinates, assign_boxes_to_tiles, box_visibility, clip_boxes_to_tile, select_unique_tiles, Annotations, TilingConfig, run, and readers/writers for every format.
  • Documentation site (MkDocs Material), CI on Linux/macOS/Windows and Python 3.10–3.13, release workflow with PyPI trusted publishing, pre-commit hooks, benchmark script.

Changed

  • Packaging moved to pyproject.toml (hatchling) with a src/ layout, managed with uv (uv.lock).
  • Runtime dependencies reduced from 13 to 4 (numpy, opencv-python-headless, pyyaml, tqdm); pandas, matplotlib, seaborn, scipy, lxml, psutil, imagesize, pyarrow and fastparquet are gone.
  • tile_image uses sliding_window_view instead of as_strided and returns independent, writable tiles.
  • Box-to-tile assignment is a single vectorised operation over all tiles and boxes.
  • Duplicate removal runs per image inside the workers instead of through temporary parquet files and a second pass.
  • TilingConfig (replaces Settings) is immutable, validates eagerly and has no side effects; output directories are created by run.
  • Image I/O is exception based and works with non-ASCII paths; images are read unchanged (grayscale, alpha and 16-bit are preserved).
  • YOLO coordinates are rounded rather than truncated when converted to pixels.

Fixed

  • Boxes drawn with draw_boxes leaked into neighbouring overlapping tiles.
  • Grayscale input to tile_image returned (N, t, t, 1) instead of (N, t, t).
  • pad_image did not shift the boxes, so labels were misaligned with padded tiles.
  • User-provided pad_size and partial-overlap settings were silently overwritten.
  • clear_duplicates compared boxes across different images.
  • Segmentation masks were read as 3-channel BGR and could be saved as lossy JPEG.
  • YOLO label files were opened in append mode, duplicating labels on re-runs.
  • The default config path and the README import path (plakakia.utils_tiling) were broken.

Removed

  • plot_example_tile_with_yolo_annotation and export_yolo_annotation_from_csv.
  • The log, log_folder and validate_settings config keys (ignored with a warning).

[0.2.1]

Last release before the modernisation.