LibreAI / 画像 / contrastive-unpaired-translation
// image · taesungp/contrastive-unpaired-translation

contrastive-unpaired-translation

contrastive-unpaired-translationは、taesungpが公開しているオープンソースの画像プロジェクトです(GitHub: taesungp/contrastive-unpaired-translation)。GitHubスターは2,556、フォークは452で、NOASSERTIONライセンスの下で公開されています。GitHubでの最終更新は2023年9月5日です。

CUT — contrastive unpaired image-to-image translation in PyTorch, faster and lighter than CycleGAN (ECCV 2020)

★ 2.6k スター⑂ 452 フォークNOASSERTION更新 2023年9月
▦ ビジュアル — このプロジェクトのREADMEには埋め込み可能なスクリーンショットがないため、
ここではプレースホルダーを表示しています。下のガイド自体は完全な内容です。
// プロジェクトの基本情報

プロジェクト基本情報

GitHubスター
2,556
フォーク
452
ライセンス
NOASSERTION
GitHubでの最終更新
2023年9月5日
カテゴリ
画像
掲載タイプ
完全なインストールガイド
公式サイト
Official site
// 仕組み

仕組み

  1. Clarify your goal

    Gather two unpaired image collections (domains A and B) — e.g. horses and zebras — or download one of the provided datasets; decide CUT vs FastCUT vs single-image SinCUT.

  2. Clone the repo

    Clone into a folder named CUT, as the README's getting-started shows.

  3. Install dependencies

    pip install -r requirements.txt (or conda env create -f environment.yml); optionally start a visdom server to watch training.

  4. Train and test

    Download a dataset with the provided script, train with train.py, then generate results with test.py — or skip training using the pretrained models and launcher scripts.

// 機能

選ばれる理由

PatchNCE contrastive loss

Patchwise contrastive learning ties corresponding patches of input and output together, replacing cycle consistency and its inverse network.

Faster, lighter than CycleGAN

The authors report faster training and lower memory than CycleGAN, with stronger distribution matching in their experiments.

FastCUT variant

A lighter configuration (no identity loss, higher lambda_NCE) described as using half the GPU memory and training twice as fast as CycleGAN.

Single-image translation (SinCUT)

Each 'domain' can be just one image, using StyleGAN2-based components adopted in the repo.

Pretrained models

Downloadable pretrained checkpoints (Cityscapes, Horse2Zebra, Cat2Dog) with launcher scripts and FID evaluation instructions.

Launcher scripts

Experiment launchers generate the long train/test command lines for the provided datasets.

Advertisement
// 自分で実行

自分で実行してみる

  1. Clone the repo

    Clone CUT into a directory named CUT, as the README shows.

    git clone https://github.com/taesungp/contrastive-unpaired-translation.git
    cd contrastive-unpaired-translation
  2. Install dependencies

    Install PyTorch and the other requirements with pip (or use the conda environment file).

    pip install -r requirements.txt
  3. Train and test

    Download the example dataset, train CUT, then run the test script.

    bash ./datasets/download_cut_dataset.sh grumpifycat
    python train.py --dataroot ./datasets/grumpifycat --name grumpycat_CUT --CUT_mode CUT
    python test.py --dataroot ./datasets/grumpifycat --name grumpycat_CUT --CUT_mode CUT --phase train
// 活用例

作れるもの

CUT exists because of the work it streamlines: the unpaired translation problem was defined by CycleGAN, in the classic PyTorch codebase that also carries pix2pix — still the implementation most translation projects are measured against.

Advertisement
// よくある質問

よくある質問

Who maintains CUT?

The authors — Taesung Park, Alexei A. Efros, Richard Zhang and Jun-Yan Zhu (UC Berkeley / Adobe Research) — published it with their ECCV 2020 paper.

Is it free?

The code is public research code; GitHub lists its license as NOASSERTION, so read the repository's license file before reusing it commercially.

Does it need a paid API key?

No — training and inference run locally in PyTorch on your own GPU.

How does it compare to CycleGAN?

CycleGAN enforces cycle consistency with a second generator. CUT uses a contrastive PatchNCE loss instead, which the authors show trains faster with less memory; FastCUT is the even lighter option.

How do I get started?

Clone, pip install -r requirements.txt, download the grumpifycat dataset, and run the train.py command from the README.

// さらに探索

似ているツール

画像

pytorch-CycleGAN-and-pix2pix

The classic PyTorch implementation of CycleGAN and pix2pix for image-to-image translation

★ 25.3k スターNOASSERTION
ガイドを見る →
画像

diffusers

🤗 Diffusers: State-of-the-art diffusion models for image, video, and audio generation in PyTorch.

★ 34.6k スターApache-2.0
ガイドを見る →
画像

DragGAN

Unofficial DragGAN implementation: drag points on a GAN image to edit it interactively

★ 4.9k スターNOASSERTION
ガイドを見る →
画像

EcomGen

Local-first AI e-commerce image suite generator for solo sellers

★ 133 スターMIT
ガイドを見る →
画像

pollinations-image-lab

Modern AI image lab on Pollinations.ai — models, seeds, history, transparency

★ 117 スターMIT
ガイドを見る →
画像

pixelshift-editor

Desktop image editor with AI effects, built for modern apps

★ 114 スターCustom
ガイドを見る →
// 代替候補

代替候補: 画像

LibreAIカタログに掲載された画像プロジェクトの中で最もスターの多いもの — contrastive-unpaired-translationが合わなかった場合に検討したい、現実的な候補リストです。

// さらに見る image

さらに見る: 画像

カタログの中でcontrastive-unpaired-translationとスター数が近い画像プロジェクト — 前後の棚もそのまま見て回れます。

contrastive-unpaired-translationを入手する

無料でオープン — ソースコードを入手して、リポジトリにスターを付け、作り始めましょう。