Skip to main content

Simet

Simet is a lightweight, extensible framework for evaluating synthetic image datasets against real datasets. It gives you:

  • A unified pipeline to load images (from local folders or built-in datasets), apply transforms, extract features (Inception-v3 out of the box), and run metrics such as FID, Precision/Recall (FAISS), and ROC-AUC.
  • Restraints (threshold checks) to enforce quality bars (e.g., FID ≤ 40, ROC-AUC ≥ 0.85) and return a single pass/fail.
  • A CLI for simple or fully-configurable runs, and a clean Python API for scripting.
  • Practical scalability features: feature caching, subsampling, FAISS IVF indexes, optional AMP, and deterministic seeding.

Installation

pip install simet

Python 3.12 is needed. CUDA is optional (for faster feature extraction and FAISS GPU support).


Quick start

1) Fast check with the CLI (simple two-paths mode)

simet simple /path/to/real_images /path/to/synth_images

Runs a minimal pipeline (no restraints) using default transforms and Inception-v3 feature extraction, printing metric (FID, Precision/Recall, ROC AUC) results.

2) Full pipeline from YAML

simet pipeline pipeline.yaml

pipeline.yaml example:

pipeline:
  loader:
    real_provider:
      type: LocalProviderWithoutClass
      path: data/real
    synth_provider:
      type: LocalProviderWithoutClass
      path: data/synth
    provider_transform:
      type: InceptionTransform
    feature_extractor:
      type: InceptionFeatureExtractor

  restraints:
    - type: FIDRestraint
      upper_bound: 40.0
    - type: PrecisionRecallRestraint
      lower_bound: [0.70, 0.60]
    - type: RocAucRestraint
      lower_bound: 0.85

CLI returns exit code 0 if all restraints pass.


Python API

from pathlib import Path
from simet.dataset_loaders import DatasetLoader
from simet.feature_extractor import InceptionFeatureExtractor
from simet.pipeline import Pipeline
from simet.providers import LocalProviderWithoutClass
from simet.restraints import FIDRestraint, PrecisionRecallRestraint, RocAucRestraint
from simet.services import LoggingService, SeedingService
from simet.transforms import InceptionTransform

LoggingService.setup_logging()
SeedingService.set_global_seed(42)

loader = DatasetLoader(
    real_provider=LocalProviderWithoutClass(Path("data/real")),
    synth_provider=LocalProviderWithoutClass(Path("data/synth")),
    provider_transform=InceptionTransform(),
    feature_extractor=InceptionFeatureExtractor(),
)

pipeline = Pipeline(
    loader=loader,
    restraints=[
        FIDRestraint(upper_bound=40.0),
        PrecisionRecallRestraint(lower_bound=[0.70, 0.60]),
        RocAucRestraint(lower_bound=0.85),
    ],
)

ok = pipeline.run()
print("PASS" if ok else "FAIL")

CLI reference

simet simple REAL_PATH SYNTH_PATH [--log-path LOG_DIR]

Run a simple pipeline with default settings.

simet simple-pipeline CONFIG_PATH [--log-path LOG_DIR]

Run YAML mode without restraints.

Example simple.yaml:

pipeline:
  real_path: data/real
  synth_path: data/synth
  metrics: [FID, PrecisionRecall, RocAuc]

Specifying no metrics will run all available (FID, Precision/Recall, ROC AUC).

simet pipeline CONFIG_PATH [--log-path LOG_DIR]

Run the full configurable pipeline (providers, transforms, feature extractor, restraints).


Concepts & Extensibility

  • Providers → simet.providers: local or built-in datasets.
  • Transforms → simet.transforms: image preprocessing (e.g. InceptionTransform).
  • Feature Extractors → simet.feature_extractor: cached Inception-v3 features.
  • Metrics → simet.metrics: FID, Precision/Recall (FAISS), ROC-AUC.
  • Restraints → simet.restraints: wrap metrics with thresholds.
  • Services → logging, seeding, caching, subsampling.

Add custom components by subclassing:

Provider → providers.base.Provider
Transform → transforms.base.Transform
Feature Extractor → feature_extractor.FeatureExtractor
Metric → metrics.base.Metric
Restraint → restraints.base.Restraint[T]

and register them via the corresponding *Parser.


Scalability notes

  • FAISS IVF & batched search for large sets
  • GPU / AMP support
  • Feature caching per dataset hash
  • Subsampling to balance dataset sizes
  • Deterministic seeding via SeedingService

Examples

See main for a complete demo.


License

MIT (or your chosen license)

Metadata

Release files for simet 1.0.0.post1

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

Source distribution (sdist)

Source distribution for simet 1.0.0.post1
File Size Uploaded
simet-1.0.0.post1.tar.gz 60.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simet 1.0.0.post1
File Interpreter ABI Platform
simet-1.0.0.post1-py3-none-any.whl Python 3 none any Details

Total release size: 147.4 kB

Release files / simet-1.0.0.post1.tar.gz

Download URL simet-1.0.0.post1.tar.gz
Size 60.5 kB
Tags Source
SHA-256 checksum
How to use checksums
663a93e78cd61a936adfc2f510592bcf1311bf4927f61372a6c8ebca5ad7fa04
BLAKE2b-256 checksum
How to use checksums
27ea11a91c75a04abc00ebbd48e3181434b0d037ac2641ce5eb119e7465107a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.23

Release files / simet-1.0.0.post1-py3-none-any.whl

Download URL simet-1.0.0.post1-py3-none-any.whl
Size 86.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c17f5d6a7a8824e146cefc2d859ce5f3493f9c738a76f185f0a41b6fc3b609a
BLAKE2b-256 checksum
How to use checksums
11e562c73d654fb50ee014953e085628647b3680e9f8bd808fb9b153b6037adb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.23

Release history Release notifications | RSS feed

This release

1.0.0.post1 This release

2 release files

1.0.0

2 release files

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