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

Proposal for the handling of B&W images #74

Closed
lcipolina opened this issue Dec 27, 2021 · 2 comments
Closed

Proposal for the handling of B&W images #74

lcipolina opened this issue Dec 27, 2021 · 2 comments

Comments

@lcipolina
Copy link

Hello!
Thank you for this fantastic model.

I am using it with Black and White images (i.e. gray) which only have 2 channels.
Your code reads images using matplot lib, which will only read the 2 channels of an BnW image.

It will be better to read images using openCV, which adds the extra channel.

So replacing everything that reads the image like this:

img = plt.imread(fname)[:,:,:3] #this won't work in BnW

by using:

img = cv2.imread(fname) #this adds the extra channel and converts to np array on the fly

I can make the changes in your code and crete a pull request if you want.

Cheers, Lucia.

@cohimame
Copy link
Collaborator

cohimame commented Dec 27, 2021

Hello!

Thank you for appeciacion of our model and interest in our research!

Please feel free to create a pull request.

What's your impression of the performance of LaMa in B&W domain btw?

@windj007
Copy link
Collaborator

Hi! Could you please point to the places we use plt.imread? I do no see any in our main code

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

No branches or pull requests

4 participants