A package for generalized image classification using In-Context-Learning with PyTorch.
Project description
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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pictsure-0.1.1.tar.gz.
File metadata
- Download URL: pictsure-0.1.1.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d544b33b26a6a23a19b3e455ec7570d9e6092f89648b7042b57735b70bd79d40
|
|
| MD5 |
0722dc594c76a408e3b069ffd7984527
|
|
| BLAKE2b-256 |
c8f6421e5cae34c885de064a90a12e02a5825f952e1e1c4d00d801d574843e9f
|
Provenance
The following attestation bundles were made for pictsure-0.1.1.tar.gz:
Publisher:
publish.yml on PictSure/pictsure-library
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pictsure-0.1.1.tar.gz -
Subject digest:
d544b33b26a6a23a19b3e455ec7570d9e6092f89648b7042b57735b70bd79d40 - Sigstore transparency entry: 259150002
- Sigstore integration time:
-
Permalink:
PictSure/pictsure-library@c22c4466933a9ddbaaa81669dcc82fd34789e9a8 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/PictSure
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c22c4466933a9ddbaaa81669dcc82fd34789e9a8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pictsure-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pictsure-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62d737839867903e3ee5a449e024a5e41f3263b27fb5f17889b697089d0b0219
|
|
| MD5 |
0ae1905fd5f23219859f23d4f5fe2931
|
|
| BLAKE2b-256 |
70411729318e4ef5656e112de84d7e119ef01934a44a0875820b94d563817f70
|
Provenance
The following attestation bundles were made for pictsure-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on PictSure/pictsure-library
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pictsure-0.1.1-py3-none-any.whl -
Subject digest:
62d737839867903e3ee5a449e024a5e41f3263b27fb5f17889b697089d0b0219 - Sigstore transparency entry: 259150011
- Sigstore integration time:
-
Permalink:
PictSure/pictsure-library@c22c4466933a9ddbaaa81669dcc82fd34789e9a8 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/PictSure
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c22c4466933a9ddbaaa81669dcc82fd34789e9a8 -
Trigger Event:
release
-
Statement type: