Skip to main content

Add your description here

Project description

histotuner

Supported token-extraction backends

histotuner can append multiple model-specific token tables into the same SpatialData Zarr while keeping shared geometry layers model-agnostic.

Currently supported token extractors:

  • hf-hub:bioptimus/H-optimus-1
  • hf-hub:MahmoodLab/UNI2-h
  • hf-hub:paige-ai/Virchow2
  • hf-hub:Wangyh/mSTAR
  • hf-hub:prov-gigapath/prov-gigapath
  • owkin/phikon-v2
  • MahmoodLab/conchv1_5
  • WenchuanZhang/Patho-CLIP-L
  • majiabo/GPFM

Token-grid semantics

All currently supported models export a unified 14x14 token grid so token tables can be compared directly across models.

  • phikon-v2 exports a native 14x14 patch-token grid.
  • hf-hub:bioptimus/H-optimus-1, hf-hub:Wangyh/mSTAR, and hf-hub:prov-gigapath/prov-gigapath export native 14x14 grids.
  • hf-hub:MahmoodLab/UNI2-h and hf-hub:paige-ai/Virchow2 have native 16x16 patch-token grids after special tokens are stripped, and histotuner adaptively average-pools them to 14x14.
  • conchv1_5 is special:
    • the native vision encoder runs at 448x448 with patch16
    • that produces a native 28x28 patch-token grid
    • histotuner average-pools each non-overlapping 2x2 token neighborhood to export a compatibility 14x14 token grid
  • Patho-CLIP-L is also special:
    • the native CLIP-L/14 vision encoder produces a 24x24 patch-token grid at 336x336 input resolution
    • histotuner adaptively average-pools that native 24x24 grid to export a compatibility 14x14 token grid
  • GPFM is also special:
    • the native DINOv2 ViT-L/14 encoder produces a 16x16 patch-token grid at 224x224 input resolution
    • histotuner adaptively average-pools that native 16x16 grid to export a compatibility 14x14 token grid

That pooling choice is deliberate so downstream single-cell workflows can consume every supported model through the same 14x14 token layout. For the pooled models, this is a compatibility semantic rather than the model's native tokenization:

  • UNI2-h and Virchow2: pooled from native 16x16
  • conchv1_5: pooled from native 28x28
  • Patho-CLIP-L: pooled from native 24x24
  • GPFM: pooled from native 16x16

Not yet supported for token extraction

  • none from the current requested set

O2 batch job generation

To generate one embedder.yaml and one embed_cluster.sh per sample folder on O2:

python generate_o2_jobs.py \
  --root-dir /n/scratch/users/a/ajn16/histotuner/full \
  --template-yaml embedder.yaml \
  --template-shell embed_cluster.sh \
  --output-dir /n/scratch/users/a/ajn16/histotuner/generated_jobs

  python generate_o2_jobs.py \
  --root-dir /n/scratch/users/a/ajn16/histotuner/heonly \
  --template-yaml embedder_HEonly.yaml \
  --template-shell embed_cluster_HEonly.sh \
  --output-dir /n/scratch/users/a/ajn16/histotuner/generated_jobs

To preview the sbatch submissions for the generated job scripts:

python submit_generated_jobs.py \
  --generated-dir /n/scratch/users/a/ajn16/histotuner/generated_jobs \
  --dry-run

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

histotuner-0.2.8.tar.gz (138.2 kB view details)

Uploaded Source

Built Distribution

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

histotuner-0.2.8-py3-none-any.whl (149.3 kB view details)

Uploaded Python 3

File details

Details for the file histotuner-0.2.8.tar.gz.

File metadata

  • Download URL: histotuner-0.2.8.tar.gz
  • Upload date:
  • Size: 138.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.13

File hashes

Hashes for histotuner-0.2.8.tar.gz
Algorithm Hash digest
SHA256 2895cf4f9f02b846ba3f44e9fa604137bdb0aa485e9100d17d5e534bca784ea9
MD5 ee5eefd915e2be444c2cca436e5925f7
BLAKE2b-256 4737907e5fde78eca912f32f723695b6a8669ade8f29a538a4ff231a29a37cac

See more details on using hashes here.

File details

Details for the file histotuner-0.2.8-py3-none-any.whl.

File metadata

  • Download URL: histotuner-0.2.8-py3-none-any.whl
  • Upload date:
  • Size: 149.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.13

File hashes

Hashes for histotuner-0.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 fd611518c459967c479a794dcb090ca6a10bdac705a9aded26f873d46d316a00
MD5 6013d5c4eff0e1a1f1f1cf224e5c2238
BLAKE2b-256 f3893ab6489a578e70eeb5e62617712e9cdc0cbec37b4d98a680da16efd08b70

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