A PyTorch library for multi-modal image translation with diffusion bridges, GANs, and transformer backbones.
Project description
pytorch-image-translation-models
A PyTorch library for multi-modal image translation with diffusion bridges, GANs, and transformer backbones.
Installation
Install from PyPI
pip install pytorch-image-translation-models
Install from source
pip install -e .
With optional dependencies:
# With training extras (accelerate, peft, datasets, tensorboard)
pip install -e ".[training]"
# With metrics extras (torchmetrics, lpips, torch-fidelity, scipy)
pip install -e ".[metrics]"
# Everything
pip install -e ".[all]"
Note: PyTorch is listed as a dependency but you may want to install a specific CUDA build first. See PyTorch — Get Started for details.
Quick Start
Examples default to device="cuda". If your environment is CPU-only, replace "cuda" with "cpu".
from PIL import Image
# Baseline method (UNSB)
from src.pipelines.unsb import UNSBPipeline
unsb = UNSBPipeline.from_pretrained(
"path/to/UNSB-ckpt/horse2zebra", # https://huggingface.co/BiliSakura/UNSB-ckpt
subfolder="generator",
scheduler_num_timesteps=5,
scheduler_tau=0.01,
)
unsb.to("cuda")
unsb_out = unsb(source_image=source, output_type="pil")
unsb_out.images[0].save("unsb_output.png")
# Community method (DiffuseIT) - text/image-guided diffusion translation
from examples.community.diffuseit import load_diffuseit_community_pipeline
pipe = load_diffuseit_community_pipeline(
"/path/to/BiliSakura/DiffuseIT-ckpt/imagenet256-uncond",
)
pipe.to("cuda")
out = pipe(
source_image=source,
prompt="Black Leopard",
source="Lion",
use_range_restart=True,
use_noise_aug_all=True,
output_type="pil",
)
out.images[0].save("diffuseit_output.png")
# Community method (E3Diff)
from examples.community.e3diff import E3DiffPipeline
e3diff = E3DiffPipeline.from_pretrained("path/to/E3Diff-ckpt/SEN12")
e3diff.to("cuda")
community_out = e3diff(source_image=source, num_inference_steps=50, output_type="pil")
community_out.images[0].save("e3diff_output.png")
Documentation
All information regarding per-method checkpoint folder conventions required by from_pretrained(...), as well as comprehensive package documentation, is integrated below.
| Doc | Description |
|---|---|
| Checkpoint layouts | Provides detailed checkpoint folder structures, naming conventions, and requirements for each pipeline and the from_pretrained(...) API. |
| Features | Documents supported models, schedulers, pipelines, data types, training methods, and evaluation metrics. |
| Metrics README | One-stop usage for paired/unpaired metrics and custom HuggingFace/local checkpoints. |
| Datasets | Common image-to-image translation datasets (pix2pix, CycleGAN) with paper and download links. |
| Examples | Extended usage patterns and code snippets for pipelines such as I2SB, DDBM, UNSB, and Local Diffusion. |
| Package structure | Overview of the codebase organization, modules, and directories. |
| Credits | Citations for reference papers and third-party contributions. |
Credits
This repository/package is primarily built upon 4th-MAVIC-T by the EarthBridge Team:
- Zheyuan Chen — bilisakura@zju.edu.cn
- Yuanshen Guan — guanys@mail.ustc.edu.cn
License
MIT
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 pytorch_image_translation_models-0.5.0.tar.gz.
File metadata
- Download URL: pytorch_image_translation_models-0.5.0.tar.gz
- Upload date:
- Size: 307.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c877bfb3be6bd48ff5e0e7a585db5fb83f3afc15af3f521584c03f43c5170db5
|
|
| MD5 |
1a06de326e0aa32e315df84d52310ffa
|
|
| BLAKE2b-256 |
011976656cd56342a17ce47ddae8d0666bbf408dc2f1c4c96901c39357990059
|
Provenance
The following attestation bundles were made for pytorch_image_translation_models-0.5.0.tar.gz:
Publisher:
publish.yml on Bili-Sakura/pytorch-image-translation-models
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytorch_image_translation_models-0.5.0.tar.gz -
Subject digest:
c877bfb3be6bd48ff5e0e7a585db5fb83f3afc15af3f521584c03f43c5170db5 - Sigstore transparency entry: 1106538420
- Sigstore integration time:
-
Permalink:
Bili-Sakura/pytorch-image-translation-models@cfe48ad4415266f20a8cc66f8530cea6b2861f04 -
Branch / Tag:
refs/tags/0.5.0 - Owner: https://github.com/Bili-Sakura
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cfe48ad4415266f20a8cc66f8530cea6b2861f04 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pytorch_image_translation_models-0.5.0-py3-none-any.whl.
File metadata
- Download URL: pytorch_image_translation_models-0.5.0-py3-none-any.whl
- Upload date:
- Size: 425.0 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 |
535b6a48e9381f8c36836592c3e221a43e65fb8fe161affc6916741ad6884f37
|
|
| MD5 |
2be88b0c57d275e274c8bba72b088776
|
|
| BLAKE2b-256 |
1c90362bb348142b4d955280e6c84c707cae5615575d26ef31db9b804d13bfaa
|
Provenance
The following attestation bundles were made for pytorch_image_translation_models-0.5.0-py3-none-any.whl:
Publisher:
publish.yml on Bili-Sakura/pytorch-image-translation-models
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytorch_image_translation_models-0.5.0-py3-none-any.whl -
Subject digest:
535b6a48e9381f8c36836592c3e221a43e65fb8fe161affc6916741ad6884f37 - Sigstore transparency entry: 1106538481
- Sigstore integration time:
-
Permalink:
Bili-Sakura/pytorch-image-translation-models@cfe48ad4415266f20a8cc66f8530cea6b2861f04 -
Branch / Tag:
refs/tags/0.5.0 - Owner: https://github.com/Bili-Sakura
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cfe48ad4415266f20a8cc66f8530cea6b2861f04 -
Trigger Event:
release
-
Statement type: