plemeri / transparent-background

This is a background removing tool powered by InSPyReNet (ACCV 2022)
MIT License
731 stars 80 forks source link

ValueError: operands could not be broadcast together with shapes (512,512,4) (3,) (512,512,4) #3

Closed me-devms closed 1 year ago

me-devms commented 1 year ago

ValueError: operands could not be broadcast together with shapes (512,512,4) (3,) (512,512,4)

plemeri commented 1 year ago

Hi, can you tell me how to reproduce the error?

me-devms commented 1 year ago

Use png image as input instead of jpeg you will get error, It should take both png and jpeg

plemeri commented 1 year ago

Thanks for the quick reply. Can you send me the image you used via e-mail? the address is taehoon1018@postech.ac.kr

me-devms commented 1 year ago

Sent

plemeri commented 1 year ago

Unfortunately, I cannot reproduce the error. Here are the results for every option we provide.

new bg blur green map overlay rgba
my-design (6)_background my-design (6)_blur my-design (6)_green my-design (6)_map my-design (6)_overlay my-design (6)_rgba

Did you try installing our latest version? Currently it is 1.1.3. If so, could you tell me which command did you use if you used command-line or script if you used our API?

me-devms commented 1 year ago

It's issue with api

plemeri commented 1 year ago

It's issue with api

Can you tell me the whole script you used to reproduce the error?

me-devms commented 1 year ago

It's same as you have documented

plemeri commented 1 year ago

I think the issue came from the format of the input image. I should have mentioned about this for the API usage to convert it if it isn't RGB. You might want to try convert function. Here's a simple change in the script.

# before
img = Image.open('samples/aeroplane.jpg')

# after
img = Image.open('samples/aeroplane.jpg').convert('RGB')

Hope this works!

me-devms commented 1 year ago

Done ! Thanks

plemeri commented 1 year ago

Done ! Thanks

Awesome, have a great day!