Zheng-Chong / CatVTON

CatVTON is a simple and efficient virtual try-on diffusion model with 1) Lightweight Network (899.06M parameters totally), 2) Parameter-Efficient Training (49.57M parameters trainable) and 3) Simplified Inference (< 8G VRAM for 1024X768 resolution).
Other
951 stars 114 forks source link

Person image is cropped #51

Closed mrunhap closed 2 months ago

mrunhap commented 2 months ago

As you can see the input image shown in the result is different from the person image I uploaded, I tried different param but also didn't work.

I also check the person image on server /tmp/gradio/xxx/composite.png, it's not cropped.

image

Zheng-Chong commented 2 months ago

Since the model only accepts images of size 768x1024, we crop the input person image to fit the corresponding aspect ratio. You can adjust the aspect ratio of the input image to 4:3 to avoid cropping or edit the resize&crop code to padding rather than crop.

mrunhap commented 2 months ago

Since the model only accepts images of size 768x1024, we crop the input person image to fit the corresponding aspect ratio. You can adjust the aspect ratio of the input image to 4:3 to avoid cropping or edit the resize&crop code to padding rather than crop.

Thanks! It work.

WalkingwithAI commented 2 months ago

Since the model only accepts images of size 768x1024, we crop the input person image to fit the corresponding aspect ratio. You can adjust the aspect ratio of the input image to 4:3 to avoid cropping or edit the resize&crop code to padding rather than crop.

大佬我改了下pipeline.py中的代码,把check_inputs函数中的: image = resize_and_crop(image, (width, height)) mask = resize_and_crop(mask, (width, height)) 改成: image = resize_and_padding(image, (width, height)) mask = resize_and_padding(mask, (width, height)) 但是没有生效,输出图片依然是有裁剪的。

麻烦大佬有空看下。