PictSure: In-Context Learning for Image Classification
PictSure is a deep learning library designed for in-context learning using images and labels. It allows users to provide a set of labeled reference images and then predict labels for new images based on those references. This approach eliminates the need for traditional training, making it highly adaptable for various classification tasks.
Features
- In-Context Learning: Predict labels for new images using a set of reference images without traditional model training.
- Multiple Model Architectures: Choose between ResNet and ViT-based models for your specific needs.
- Pretrained Models: Use our pretrained models or train your own.
- Torch Compatibility: Fully integrated with PyTorch, supporting CPU and GPU.
- Easy-to-use CLI: Manage models and weights through a simple command-line interface.
Installation
pip install PictSure
Quick Start
from PictSure import PictSure
import torch
DEVICE = "cpu" # or cuda, mps
model = PictSure.from_pretrained("pictsure/pictsure-vit")
model = model.to(DEVICE)
# Set your reference images and labels
model.set_context_images(reference_images, reference_labels)
# Make predictions on new images
predictions = model.predict(new_images)
Examples
For a complete working example, check out the Jupyter notebook in the Examples directory:
Examples/example.ipynb
This notebook demonstrates:
- Model initialization
- Loading and preprocessing images
- Setting up reference images
- Making predictions
- Visualizing results
Citation
If you use this work, please cite it using the following BibTeX entry:
@article{schiesser2025pictsure,
title={PictSure: Pretraining Embeddings Matters for In-Context Learning Image Classifiers},
author={Schiesser, Lukas and Wolff, Cornelius and Haas, Sophie and Pukrop, Simon},
journal={arXiv preprint arXiv:2506.14842},
year={2025}
}
License
This project is open-source under the MIT License.
Contributing
Contributions and suggestions are welcome! Open an issue or submit a pull request.
Contact
For questions or support, open an issue on GitHub.
Release files for PictSure 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pictsure-0.2.4.tar.gz | 17.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pictsure-0.2.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.9 kB
Release files / pictsure-0.2.4.tar.gz
| Download URL | pictsure-0.2.4.tar.gz |
|---|---|
| Size | 17.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5ece21a4db9782a4841ec9def8eb341c89550921a8f86cdb86108974afd7ead6
|
|
BLAKE2b-256 checksum How to use checksums |
73029f40de14e65ed20f56cba5412d0412fdb011a56d54fd5370184822904c4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 12, 2026.
Transparency logRelease files / pictsure-0.2.4-py3-none-any.whl
| Download URL | pictsure-0.2.4-py3-none-any.whl |
|---|---|
| Size | 18.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3bcba09ee15951b1e0ce1e7700d31bc23a02e878d1f30dc3ac9cb74743aa39b4
|
|
BLAKE2b-256 checksum How to use checksums |
770ce4eeabec3fc0f0956436bd55db3fb559cbddcafe08d79d4e652dd36b70b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 12, 2026.
Transparency log