Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ldm superresolution #3710

Merged
merged 3 commits into from
Nov 10, 2022
Merged

add ldm superresolution #3710

merged 3 commits into from
Nov 10, 2022

Conversation

westfish
Copy link
Contributor

@westfish westfish commented Nov 9, 2022

PR types

New features

PR changes

Models

Description

ppdiffusers新增超分(Super-Resolution)任务
ppdiffusers新增LDM Super-Resolution Pipeline,支持LDM Super-resolution任务和预训练模型

使用方法:

import paddle
from ppdiffusers import LDMSuperResolutionPipeline
from PIL import Image

pipe = LDMSuperResolutionPipeline.from_pretrained('CompVis/ldm-super-resolution-4x-openimages')

img = Image.open('p2526-resize.jpeg')
super_img = pipe(img, num_inference_steps=100, eta=1)
super_img = super_img['images'][0]

效果展示:
原图片
p2526-resize

超分图片
p2526-resize-res—pp

@JunnYu JunnYu self-requested a review November 9, 2022 07:28
def preprocess(image):
w, h = image.size
w, h = map(lambda x: x - x % 32, (w, h)) # resize to integer multiple of 32
image = image.resize((w, h), resample=PIL.Image.LANCZOS)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个PIL.Image.LANCZOS建议看一下我之前的改法

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是吧 #3457

@westfish westfish requested a review from guoshengCS November 9, 2022 08:53
@guoshengCS
Copy link
Contributor

看HF那个已经合入了,HF那个当前用的model id是什么呢,是否需要一致呢

@westfish
Copy link
Contributor Author

好的 我把这个id都一致改为CompVis/ldm-super-resolution-4x-openimages

@westfish westfish merged commit d37fd7f into develop Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants