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, withto_geojson()andmap_polygons(): pass a GeoTIFF's profile topredict_tiledto get detections in map coordinates.tile_batches(batches of tiles with their coordinates, for any array type) andmerge_detections(NMS plus seam fusion for boxes you already have).- GPU tiling:
tile_image,tile_arrayanditer_tilesaccept 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 throughtorchvision.ops.batched_nmsfor PyTorch tensors, with a NumPy fallback.plakakia.to_numpyandplakakia.backendhelpers (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). Newonnxextra.benchmarks/bench_device.pycompares 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
demoextra now pulls inh5pyandtifffileand 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.pywith 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 withpredict_tiled. Generated byscripts/make_hero.pywith 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_axeshelpers.tile_imageandtile_coordinatesaccept rectangular tiles ((height, width)) andtile_imagetakesaxes=for channels-first data.read_array/write_array:.npy(memory-mapped), HDF5 (hdf5_datasetselects the dataset, files are always closed) and multi-band TIFF.- GeoTIFF support (
plakakia[geo]):read_geotiff,write_geotiff,GeoProfile. Withgeoreference: trueevery tile keeps the CRS, nodata and its own affine transform. - Pipeline options:
axes, per-axistile_size/step_size,bands/band_axis,nodata,max_nodata_fraction(vectorised summed-area table),hdf5_dataset,mask_extension. - Optional extras
hyperspectral(h5py, tifffile) andgeo(rasterio). - Docs page on hyperspectral and geospatial data, plus example configs.
Changed¶
pad_imagetakesaxes=.- 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_edgesoption: border-aligned tiles so no pixels are dropped.min_visibilityoption: keep partially visible boxes (clipped to the tile).save_empty_tilesoption to also export background tiles.input_format_annotations: noneto 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. plakakiaCLI (make_tileskept as an alias),python -m plakakia,--num-workers,--quiet,--verboseand--versionflags.- 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 asrc/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_imageusessliding_window_viewinstead ofas_stridedand 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(replacesSettings) is immutable, validates eagerly and has no side effects; output directories are created byrun.- 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_boxesleaked into neighbouring overlapping tiles. - Grayscale input to
tile_imagereturned(N, t, t, 1)instead of(N, t, t). pad_imagedid not shift the boxes, so labels were misaligned with padded tiles.- User-provided
pad_sizeand partial-overlap settings were silently overwritten. clear_duplicatescompared 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_annotationandexport_yolo_annotation_from_csv.- The
log,log_folderandvalidate_settingsconfig keys (ignored with a warning).
[0.2.1]¶
Last release before the modernisation.