Skip to main content

PRIMO: Panoramic Reconstruction with Integrated Microscopy-Specific Optimization

Project description

PRIMO: Panoramic Reconstruction with Integrated Microscopy-Specific Optimization

Python library and command-line tool for stitching a set of overlapping tiles into a single 2D panorama.

Installation

pip install primo-stitch
  • Python 3.10–3.14.
  • If you use a GPU, make sure you have a CUDA-enabled PyTorch (pytorch.org).
  • Model weights are downloaded on the first run — internet access is required.

Command-line usage

primo-stitch is the main entry point.

# minimal — stitch a folder of tiles into a panorama
primo-stitch --tile_dir path/to/tiles --output_file panorama.jpg

# advanced
primo-stitch \
  --tile_dir path/to/tiles \
  --output_file panorama.png \
  --matcher "efficient loftr" \
  --device cuda:0 \
  --blending_mode full \
  --inference_size 0.5 \
  --batch_size 8 \
  --logfile run.log

Options

Flag Default Description
--tile_dir (required) Directory with the input tiles
--output_file panorama.jpg Output panorama path (extension may be adjusted, e.g. .png when alpha is saved)
--cache_dir .cache/ Directory for intermediate results (created automatically, cleaned up after the run)
--matcher xfeat xfeat | efficient loftr | loftr
--device cpu cpu, cuda, cuda:0, ...
--blending_mode full collage — fast paste-over, no correction; mosaic — photocorrection + hard seams, no blending; full — photocorrection + seams + multiband blending
--inference_size 0.3 Matcher input scale relative to the original (0.25, 0.5, 1, ...)
--batch_size 1 Matcher batch size (higher = faster, more memory)
--save_alpha_channel / --no-save_alpha_channel off Save the transparency channel; forces .png output in full mode
--logfile (none) Write a debug log to this file

Python API

from primo import Matcher, Stitcher

matcher = Matcher(
    model='xfeat',            # 'xfeat' | 'efficient loftr' | 'loftr'
    device='cuda:0',          # or 'cpu'
    inference_size=0.5,
    batch_size=8,
)

# the alignment device is taken from the matcher
stitcher = Stitcher(
    matcher,
    blending_mode='full',     # 'collage' | 'mosaic' | 'full'
)

stitcher.stitch(
    input_dir='path/to/tiles',
    output_file='panorama.jpg',
)

Matcher and Stitcher expose additional keyword arguments (alignment, photometric correction, blending) — see their signatures for the full set.

Authors

  • Gleb Nikolaev — Lomonosov Moscow State University
  • Savelii Shashkov — Lomonosov Moscow State University
  • Dmitriy Korshunov — Geological Institute of the Russian Academy of Sciences
  • Andrey Krylov — Lomonosov Moscow State University
  • Alexander Khvostikov (corresponding author) — Lomonosov Moscow State University

Citation

A paper describing PRIMO is currently under review; full citation details (venue, year, DOI) will be added once it is published. Until then, please credit the authors:

@unpublished{primo,
  title  = {PRIMO: Panoramic Reconstruction with Integrated Microscopy-Specific Optimization},
  author = {Nikolaev, Gleb and Shashkov, Savelii and Korshunov, Dmitriy and Krylov, Andrey and Khvostikov, Alexander},
  year   = {2026},
  note   = {Manuscript under review}
}

License

Apache-2.0; bundled third-party components — see THIRD_PARTY_LICENSES.md.

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

primo_stitch-0.2.2.tar.gz (84.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

primo_stitch-0.2.2-py3-none-any.whl (104.9 kB view details)

Uploaded Python 3

File details

Details for the file primo_stitch-0.2.2.tar.gz.

File metadata

  • Download URL: primo_stitch-0.2.2.tar.gz
  • Upload date:
  • Size: 84.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for primo_stitch-0.2.2.tar.gz
Algorithm Hash digest
SHA256 56322902bdb0df56e9b4501f381cb626c6dc49e23676ff2e28b9c2c25303e1dc
MD5 8b080c3ee9c7d72493f5fb32bab68cf9
BLAKE2b-256 d29c0a7ab9e61a2c500be0e53f273e09ac916de4a6ff15fdfcf08d37c159585c

See more details on using hashes here.

File details

Details for the file primo_stitch-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: primo_stitch-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 104.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for primo_stitch-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b4b9220376e6940b35e3967f352a9bcf2e0c21c1a80e8e67b0fe0d91ba6af583
MD5 79c4ee52507e985c8109ec25a19ad1ec
BLAKE2b-256 a8a9b968db116c57850f3ce8d84319162610fafeaf55eb448a30195ecf812892

See more details on using hashes here.

Supported by

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