A lightweight inference pipeline for pseudo-labeling and model prototyping.
Project description
Pseudo-Labeling Inference Pipeline
A lightweight inference pipeline for running various models on datasets like CIFAR-10, ImageNet, etc., configured via Hydra.
Quick Start
1. Setup Environment
Ensure your environment is set up with the required dependencies.
pip install -r requirements.txt
# Or use the existing conda env
conda activate proxy-det
2. Run Inference
Run the main script. By default, it runs resnet18 on cifar10 (or whatever defaults are in configs/config.yaml).
python main.py
3. Verify Setup & Usage
Run the included example script to understand how to interact with the dataset wrappers and verify your environment.
python src/test/example_usage.py
Features
- Batch Inference: Efficiently run pytorch models on standard datasets.
- Streaming Data: Support for streaming huge datasets (e.g., ImageNet-1k) from Hugging Face without downloading.
- Label Mapping: Auto-map predictions between different label spaces (e.g., ImageNet -> CIFAR10).
Project Structure
├── configs/ # Hydra configs
├── src/
│ ├── datasets/ # Dataset wrappers (standard & streaming)
│ ├── models/ # Model definitions
│ ├── inference/ # Inference engine
│ ├── test/ # Tests and verification scripts
├── main.py # Entry point
└── requirements.txt
Testing & Verification
The project includes a src/test directory with unit tests and examples.
Run Unit Tests:
python src/test/test_wrappers.py
Tests all wrappers including streaming and reliability edge cases.
Run Usage Example:
python src/test/example_usage.py
Demonstrates how to initialize wrappers (both local and streaming) and access data.
Output
Results are saved to the outputs/ directory by default.
Filename Format:
[dataset_name]-[model_name]-[split].csv
CSV Structure:
sample_id,prediction,confidence,ground_truth
cifar10_test_0,776,0.2668,3
...
sample_id: Unique identifier for the sample.prediction: The class index predicted by the model (mapped to target dataset space if applicable).confidence: The probability/confidence score of the prediction.ground_truth: The actual class label.
Label Mapping
To handle label discrepancies (e.g., ImageNet model on CIFAR10), the system automatically maps equivalent classes using JSON files in configs/mappings/.
- Model Config: Models define their
source_dataset(e.g.,imagenet1k). - Logic: If
source != target, predictions are mapped. Unmapped classes become-1. - Supported Mappings: ImageNet1k -> Imagenette, CIFAR10 (208 classes), CIFAR100 (131 classes).
Project details
Release history Release notifications | RSS feed
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 pseudo_labeling-0.1.0.tar.gz.
File metadata
- Download URL: pseudo_labeling-0.1.0.tar.gz
- Upload date:
- Size: 32.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbab52af2248738dc93d00dda3f8f3943c98afdc9c6fef3162b23a3b710989cd
|
|
| MD5 |
a13e84f6bcc45d862c6581d22498c763
|
|
| BLAKE2b-256 |
c50392790c00479dc67348cdde67305d5a1d762fe4a84f66665df1f14bab99bc
|
Provenance
The following attestation bundles were made for pseudo_labeling-0.1.0.tar.gz:
Publisher:
workflow.yml on ViGeng/pseudo-labeling
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pseudo_labeling-0.1.0.tar.gz -
Subject digest:
dbab52af2248738dc93d00dda3f8f3943c98afdc9c6fef3162b23a3b710989cd - Sigstore transparency entry: 955142104
- Sigstore integration time:
-
Permalink:
ViGeng/pseudo-labeling@f33e125508b60cecda518fcff69c40fc26ba9e21 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ViGeng
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@f33e125508b60cecda518fcff69c40fc26ba9e21 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pseudo_labeling-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pseudo_labeling-0.1.0-py3-none-any.whl
- Upload date:
- Size: 43.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
938d22a19ef287c8f5f7de630316844605d3f6a4f8838efbc2efed95fcbe7b66
|
|
| MD5 |
71793eb82e5f931eec70e63a624db635
|
|
| BLAKE2b-256 |
b7f3d2badcddb404bd37b8ddfd5441ffeabb0771b91e7c6cec35207097cdf1f5
|
Provenance
The following attestation bundles were made for pseudo_labeling-0.1.0-py3-none-any.whl:
Publisher:
workflow.yml on ViGeng/pseudo-labeling
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pseudo_labeling-0.1.0-py3-none-any.whl -
Subject digest:
938d22a19ef287c8f5f7de630316844605d3f6a4f8838efbc2efed95fcbe7b66 - Sigstore transparency entry: 955142105
- Sigstore integration time:
-
Permalink:
ViGeng/pseudo-labeling@f33e125508b60cecda518fcff69c40fc26ba9e21 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ViGeng
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@f33e125508b60cecda518fcff69c40fc26ba9e21 -
Trigger Event:
push
-
Statement type: