Skip to content

Image resize issue #84

@DamienGaullier

Description

@DamienGaullier

Hi,
I have an issue with my output image which does not have the same dimensions as the input one.
Original image: 640x480
Output image: 576x512
Do you know why ?

here the sample :

import numpy

from controlnet_aux.processor import MidasDetector
from PIL import Image

image_path = "d:/temp/cat.png"
model_path = "d:/model/dreamshaper-v8.0"

convertedImage = Image.open(image_path)
resolution = min(convertedImage.size)

processor = MidasDetector.from_pretrained(model_path)
controlnet_image = processor(
    input_image=convertedImage,
    a=numpy.pi * 2.0,
    bg_th=0.1,
    depth_and_normal=False,
    detect_resolution=resolution,
    image_resolution=resolution,
    output_type='pil'
)

controlnet_image.save("d:/temp/cat_result.png") 

cat
cat_result

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions