Skip to main content

semsketch

Dense per-pixel image features from a classical filter bank and foundation models, as used by SemSketch's interactive segmentation, plus the classifiers it trains on them.

import torch
from semsketch import Embedder, available_models

# Classical features only: runs anywhere, including the CPU.
features = Embedder(classical=True)(torch.rand(2, 1, 256, 256))  # (2, 37, 256, 256)

# Foundation models (CUDA or Apple's MPS); weights download on first use.
print(available_models())
embedder = Embedder(classical=False, models=["diffusion/ssd1b", "sam3/neck12"])
features = embedder(images)  # (B, 640 + 320, H, W)

# Each source separately.
by_source = embedder.embed_sources(images)  # {"diffusion/ssd1b": ..., "sam3/neck12": ...}

Images are (B, 1 or 3, H, W) tensors, float in [0, 1] or uint8; a single (C, H, W) or (H, W) image is treated as a batch of one. The output is (B, C, H, W) float32, the sources concatenated in embedder.sources order.

Models

  • classical: 37 channels per image channel (Gaussian, Sobel, Hessian and difference-of-Gaussians responses at several scales, and membrane projections).
  • diffusion/<unet>: Stable Diffusion UNet activations (ssd1b is SemSketch's default).
  • sam3/neck, sam3/neck12: SAM3 image-encoder features.
  • vulture/dinov2_vits14: Vulture's FeatUp-upsampled DINOv2. It needs tldr-group's Vulture, which PyPI does not carry: pip install https://github.com/tldr-group/vulture/archive/c3c728a326d99217bac6956c936af277a92bacda.tar.gz.
  • alibi-dinov3: SemSketch's ALiBi DINOv3 backbone.
  • Any DINOv3 or C-RADIO Hugging Face ID, or a local .pth backbone checkpoint.

Each model's grid is lifted bilinearly to every pixel; the features are the raw lifted channels, without the per-image PCA SemSketch's segmenter fits on them. OpenAI embeddings are not supported.

Downloads

Weights go to Hugging Face's cache (~/.cache/huggingface, or HF_HOME) unless Embedder(model_dir=...) or SEMSKETCH_MODEL_DIR names another folder. Gated models (SAM3, DINOv3) ask for a Hugging Face token when none is set (HF_TOKEN or hf auth login), and say where to accept their licence.

Licence

GPL-3.0-or-later. The models it downloads have their own licences; see THIRD_PARTY_NOTICES.md.

Metadata

Release files for semsketch 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for semsketch 0.1.0
File Size Uploaded Provenance Actions
semsketch-0.1.0.tar.gz 100.1 kB Without provenance Details for semsketch-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for semsketch 0.1.0
File Interpreter ABI Platform Actions
semsketch-0.1.0-py3-none-any.whl Python 3 none any Details for semsketch-0.1.0-py3-none-any.whl

Total release size: 214.4 kB

Release files / semsketch-0.1.0.tar.gz

Download URL semsketch-0.1.0.tar.gz
Size 100.1 kB
Tags Source
SHA-256 checksum
How to use checksums
dfcde0ecf009ab62309cdada527979e3272c30573d24cf04713c078b4fbd7c5e
BLAKE2b-256 checksum
How to use checksums
3505d17a9efe875a43ed12ca8fc1d72dfe8cb1814dda98b02d589ad9ecc327e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / semsketch-0.1.0-py3-none-any.whl

Download URL semsketch-0.1.0-py3-none-any.whl
Size 114.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ce5e609f233a770434aa76a6f93eb3165af68fd2b8fd4cab0f62cc71c233a79
BLAKE2b-256 checksum
How to use checksums
12b261f61bd0184d90be48f07b111562264358795e2d2e64f6a9f8b2eeb30af8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for semsketch 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page