OOTDiffusion icon indicating copy to clipboard operation
OOTDiffusion copied to clipboard

Output a black image

Open maopian2333 opened this issue 11 months ago • 2 comments

Hi, i run the inference code and finally get a black image with a warning: /opt/conda/lib/python3.9/site-packages/diffusers/image_processor.py:97: RuntimeWarning: invalid value encountered in cast images = (images * 255).round().astype("uint8") . It seems something wrong.

Then i change the input size to (576, 768), it gets good result without any warning.

what is the problem?

maopian2333 avatar Mar 01 '24 12:03 maopian2333

Hi, i run the inference code and finally get a black image with a warning: /opt/conda/lib/python3.9/site-packages/diffusers/image_processor.py:97: RuntimeWarning: invalid value encountered in cast images = (images * 255).round().astype("uint8") . It seems something wrong.

Then i change the input size to (576, 768), it gets good result without any warning.

what is the problem?

does this work good with any custom images?

sudip550 avatar Mar 01 '24 15:03 sudip550

@maopian2333 What is your original input? It seems your image format is wrong.

levihsu avatar Mar 02 '24 06:03 levihsu

Hi, i run the inference code and finally get a black image with a warning: /opt/conda/lib/python3.9/site-packages/diffusers/image_processor.py:97: RuntimeWarning: invalid value encountered in cast images = (images * 255).round().astype("uint8") . It seems something wrong. Then i change the input size to (576, 768), it gets good result without any warning. what is the problem?

does this work good with any custom images?

@sudip550 I tried both the images in VITON-HD and the images in my own dataset, the results are the same.

maopian2333 avatar Mar 03 '24 02:03 maopian2333

Hi, i run the inference code and finally get a black image with a warning: /opt/conda/lib/python3.9/site-packages/diffusers/image_processor.py:97: RuntimeWarning: invalid value encountered in cast images = (images * 255).round().astype("uint8") . It seems something wrong. Then i change the input size to (576, 768), it gets good result without any warning. what is the problem?

does this work good with any custom images?

@sudip550 I tried both the images in VITON-HD and the images in my own dataset, the results are the same.

Can you please show us your results

sudip550 avatar Mar 03 '24 02:03 sudip550

@maopian2333 What is your original input? It seems your image format is wrong.

@levihsu The inputs are all jpg images. Results are good when image size is resized to (576,768).

`cloth_img = Image.open(cloth_path).resize((576, 768)) model_img = Image.open(model_path).resize((576, 768)) keypoints = openpose_model(model_img.resize((384, 512))) model_parse, _ = parsing_model(model_img.resize((384, 512)))

mask, mask_gray = get_mask_location(model_type, category_dict_utils[category], model_parse, keypoints) mask = mask.resize((576, 768), Image.NEAREST) mask_gray = mask_gray.resize((576, 768), Image.NEAREST)`

maopian2333 avatar Mar 03 '24 03:03 maopian2333

@sudip550 It gets good results when input size is resized to (576,768). result1

It gets black images when input size is resized to (768, 1024) as original. result2

maopian2333 avatar Mar 03 '24 03:03 maopian2333

This problem should be caused by incorrect python package versions. I install the packages following the list you provide, then the results are good without any problem. Thanks for your work!

maopian2333 avatar Mar 03 '24 15:03 maopian2333