🚀 REALEDIT: Reddit Edits As a Large-scale Empirical Dataset for Image Transformations
REALEDITは、画像変換のための大規模な実証データセットです。このプロジェクトは、画像変換タスクにおける研究や開発に役立つデータとモデルを提供します。
Project page: https://peter-sushko.github.io/RealEdit/
Data: https://huggingface.co/datasets/peter-sushko/RealEdit
🚀 クイックスタート
推論を実行するには、2つの方法があります。🧨Diffusersを使用する方法と、元のInstructPix2Pixパイプラインを使用する方法です。
✨ 主な機能
- 画像変換タスクに特化した大規模データセットを提供
- 2種類の推論実行方法をサポート
📦 インストール
Option 1: With 🧨Diffusers
必要なライブラリをインストールします。
pip install torch==2.7.0 diffusers==0.33.1 transformers==4.51.3 accelerate==1.6.0 pillow==11.2.1 requests==2.32.3
Option 2: via InstructPix2Pix pipeline
リポジトリをクローンし、ディレクトリ構造を設定します。
git clone https://github.com/timothybrooks/instruct-pix2pix.git
cd instruct-pix2pix
mkdir checkpoints
微調整済みのチェックポイントをcheckpoints
ディレクトリにダウンロードします。
cd checkpoints
💻 使用例
Option 1: With 🧨Diffusers
import torch
import requests
import PIL
from diffusers import StableDiffusionInstructPix2PixPipeline, EulerAncestralDiscreteScheduler
model_id = "peter-sushko/RealEdit"
pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained(
model_id,
torch_dtype=torch.float16,
safety_checker=None
)
pipe.to("cuda")
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
url = "https://raw.githubusercontent.com/AyanaBharadwaj/RealEdit/refs/heads/main/example_imgs/simba.jpg"
def download_image(url):
image = PIL.Image.open(requests.get(url, stream=True).raw)
image = PIL.ImageOps.exif_transpose(image)
image = image.convert("RGB")
return image
image = download_image(url)
prompt = "give him a crown"
result = pipe(prompt, image=image, num_inference_steps=50, image_guidance_scale=2).images[0]
result.save("output.png")
Option 2: via InstructPix2Pix pipeline
リポジトリのルートに戻り、InstructPix2Pixのインストールガイドに従って環境を設定します。
単一の画像を編集するには、以下のコマンドを実行します。
python edit_cli.py \
--input [YOUR_IMG_PATH] \
--output imgs/output.jpg \
--edit "YOUR EDIT INSTRUCTION" \
--ckpt checkpoints/realedit_model.ckpt
📄 ライセンス
このプロジェクトはCCライセンスの下で提供されています。
📚 ドキュメント
引用
このチェックポイントが役に立った場合は、以下のように引用してください。
@misc{sushko2025realeditredditeditslargescale,
title={REALEDIT: Reddit Edits As a Large-scale Empirical Dataset for Image Transformations},
author={Peter Sushko and Ayana Bharadwaj and Zhi Yang Lim and Vasily Ilin and Ben Caffee and Dongping Chen and Mohammadreza Salehi and Cheng-Yu Hsieh and Ranjay Krishna},
year={2025},
eprint={2502.03629},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2502.03629},
}
データセット情報
属性 |
詳情 |
モデルタイプ |
image-to-image |
訓練データ |
peter-sushko/RealEdit |