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.0.tar.gz (84.1 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.0-py3-none-any.whl (104.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: primo_stitch-0.2.0.tar.gz
  • Upload date:
  • Size: 84.1 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.0.tar.gz
Algorithm Hash digest
SHA256 dbfebc539447000748392aa62c42d404642eb46ec4834d84132a1245d9f05851
MD5 32d0632dda692d7571389a65dce8da79
BLAKE2b-256 3cdc7d38d46048b9bc91771a6b2cb56525d5d96335531bd8a6208ccdb9794e59

See more details on using hashes here.

File details

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

File metadata

  • Download URL: primo_stitch-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 104.8 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 75e6a67f584308f00a89c2991657bb78f68c7e0fa70ec3fd598b41d4640c6f43
MD5 9857436e33dcc7814b0467383a67e4a9
BLAKE2b-256 2e0a0caf25e2ad33aadee6de174e7e8d252ff59e4e7eac3819e00217d4844f88

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