Polyp-Gen: Realistic and Diverse Polyp Image Generation for Endoscopic Dataset Expansion
Paper • 2501.16679 • Published
How to use Saint-lsy/Polyp-Gen-sd2-inpainting with Diffusers:
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline
from diffusers.utils import load_image
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("Saint-lsy/Polyp-Gen-sd2-inpainting", dtype=torch.bfloat16, device_map="cuda")
prompt = "Turn this cat into a dog"
input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")
image = pipe(image=input_image, prompt=prompt).images[0]Polyp-Gen is a text-guided full-automatic diffusion-based endoscopic image generation framework for realistic and diverse polyp image generation for endoscopic dataset expansion, as presented in Polyp-Gen: Realistic and Diverse Polyp Image Generation for Endoscopic Dataset Expansion. You can use our model for polyp generation.
Code is available here.
This model card is based on stable-diffusion-2-inpainting model, available here.
If you find this work helpful, please consider to star🌟 this repo and cite the following paper:
@article{liu2025polyp,
title={Polyp-Gen: Realistic and Diverse Polyp Image Generation for Endoscopic Dataset Expansion},
author={Liu, Shengyuan and Chen, Zhen and Yang, Qiushi and Yu, Weihao and Dong, Di and Hu, Jiancong and Yuan, Yixuan},
journal={arXiv preprint arXiv:2501.16679},
year={2025}
}
Base model
sd2-community/stable-diffusion-2-inpainting